Jenkins attaching local image in email - selenium

I am facing a problem in following scenario.
i have configured am email to be send after the job is succeed in Jenkins. In that email i am attaching local image to send it over email to other users, using html
The problem i am facing here is once the mail is in my outlook inbox i can download and see the embedded image on my machine but when i open the same email on different user's machine its not displaying image its showing "X" mark.
Please help to resolve the issue.

OK , so assuming you are using a declarative pipeline (because im not sure if you are using pipeline or regular job), you can add this code to your post stage :
post {
always {
echo 'I have finished'
archiveArtifacts 'yourfile.html or any extension'
emailext attachLog: true,
attachmentsPattern: '*.html',
body: 'Smoke Test.\n\nPlease see attachment for Report and build Logs', subject: 'DO NOT REPLY: JENKINS Build Server Notification [${BUILD_STATUS}]${JOB_NAME} Build #${BUILD_NUMBER}', to: 'example#example.com'
}
if you attachment (in my case is yourfile.html) is in your root directory then *.html is good to pick it up, otherwise pass the absolute path to your attachment.
Note : that its better always to archive the artifacts or the files you are trying to use later in the build or in other builds.
Also, make sure you have email extension plugin: Email extension plugin

Related

Strapi restarts server after pdf file upload | Want to bypass that so script is not interrupted

I am building a strapi app that creates a pdf and in which I want to send an email to the user after that, with the pdf attached.
The issue is that the moment the pdf is saved in the upload/files directory the server reloads. Being so, the script is interrupted and the email is never sent.
What I want is that the server doesn't restart at the upload, the script continues and so the email is sent.
I am using strapi v3 and the upload plugin.
I already tried to use the watchIgnoreFiles pointing to the upload/files directory in the admin.js, but the strapi server still restarts. (https://forum.strapi.io/t/change-file-without-triggering-a-reload-of-strapi/4026/8). But I am in doubt if this is the right way, since I am not changing a file, but creating a new one, which is content and not a system file. My admin.js file is as follows:
module.exports = ({ env }) => ({ admin: { autoOpen: false, watchIgnoreFiles: [ './extensions/upload/files/', '**/extensions/upload/files/' ] } })
Thank you for your help.

Moodle File Upload errors: An error occured whilst communicating with the server

With some Uploads in Moodle (3.9) Uploads are not successful, mainly pdf.
The message that comes up is: "An error occured whilst communicating with the server".
not successful requests show
POST /course/dndupload.php undefined
successful requests show
POST /course/dndupload.php HTTP/1.1
When a pdf is reexported with libre office for example the same pdf can be uploaded without problems.
any ideas?
Is the LibreOffice pdf smaller? It could be PHP timing out.
https://docs.moodle.org/311/en/File_upload_size#Modifying_the_php.ini_file
What is the value for max_execution_time ? You can check the PHP values here -
Site administration > Server > PHP info
Also, try switching debug to developer level and see what the error message is.
Site administration > Development > Debugging
Debug messages = Developer
Display debug messages = checked
Although be cautious changing the debug level if its a production site. If you have access to the config.php file then you can specify a user.
// You can specify a comma separated list of user ids that that always see
// debug messages, this overrides the debug flag in $CFG->debug and $CFG->debugdisplay
// for these users only.
// $CFG->debugusers = '2';
Thanks for the response, in the meantime a solution to the problem was found. On the server a measurement against log4j2-vulnerability has been implemented: https://support.f5.com/csp/article/K59329043#proc2. This caused the misbehaviour, the iRule has been removed, now it works again.

Why does my local checkout fails on Spartacus 1.5?

The Error
*polyfills.js:3050 GET https://localhost:9002/rest/v2/powertools/cms/pages?fields=DEFAULT&pageType=ContentPage&pageLabelOrId=/checkout&lang=en&curr=USD 404*
I am not able to perform checkout on both of my local powertools and electronics sites. The Chrome console log complains about the error shown above. Also, I have tried opening the given link in a new tab and it says No content page found matching the provided label or id: /checkout. Checked the WCMS Pages in my local Backoffice, I couldn't find any page with label or id as "checkout".
Could it be that I have to setup my local with the b2c_for_spartacus? (I have setup mine with b2c_b2b_acc_oms recipe instead)
Have you installed your SAP Commerce instance with the Spartacus Sample Data AddOn? The standard Powertools data setup will not include this, but the additions in spartacussampleadataaddon do. Please see links/instructions in https://sap.github.io/cloud-commerce-spartacus-storefront-docs/installing-sap-commerce-cloud/
If installed/setup correctly you should have a content page with UID=Checkout in the powertools-spaContentCatalog content catalog

best way to deploy files to cumulocity devices?

Using the cumulocity java-agent is there a way to upload a file (i.e. zip) to the FILES REPOSITORY, on the Admin page, then either push this file to all my devices or instruct all devices to pull this file?
You can use the software management process (in devicemanagement).
You upload the file to the software management. Afterwards you can use the file from the software plugin. This will create an operation for the device which contains a direct link to the file.
On the device you then just need to call a GET on this link. There is no specific service implemented for that at the moment.
If you are not talking about software but files in general I would recommend a similar process. Send an operatio to the device that contains a download link to the file.
I think SW installer is only half solution as the java-agent may b broken currently (cumulocity-linux-agent-7.29.0). Agent says:
[CumulocityLongPollingTransport-scheduler-3] WARN
c8y.lx.agent.JavaSoftwareDriver - Malformed URL:
common-notification-6.17.0.jar
[CumulocityLongPollingTransport-scheduler-3] WARN
c8y.lx.agent.JavaSoftwareDriver - Malformed URL: commons-io-2.4.jar
[CumulocityLongPollingTransport-scheduler-3] WARN
c8y.lx.agent.JavaSoftwareDriver - Malformed URL:
svenson-1.3.8-6.17.0.jar
The operation actually does not have the full URL only the filename:
{
operations: [
{
...
status: "PENDING",
description: "Update device software.",
c8y_Software: {
rest-representation: "rest-representation-7.29.1.jar",
tinkerforge: "tinkerforge-2.1.2.jar",
...
I could only get the SW installer work with the java agent by hosting the files externally and using such syntax on the admin page:
NAME: tinkerforge-driver
VERSION: http://my_ip/tinkerforge-driver-6.17.0.jar
FILE: http://my_ip/tinkerforge-driver-6.17.0.jar

Cannot open URL. Please check this URL is correct: http://localhost:8080/

I am using IntelliJ Ideea 13.1.4 and I encountered this error - after I Run / Debug my project, after "Artifact portal-webapp:war exploded: Artifact is deployed successfully"
I get this error but it has been working util now...
Do you Have any idea what should it be?
It appears Idea is trying to wait for your page to return 200 response and then open the external web browser. If this does not happen (e.g. your application returns a redirect due to authentication filters), Idea is just spamming your application with requests and then complains about not being able to open the web page.
I was on production profile but I don't know how I was building until now automatic on dev profile. Now I put a -Pdev to the mvn clean install command I had in a .bat file and all is ok.