Jenkins Pipeline script -convert URL notified by slack to a clickable URL - shell

I am trying to send a slack failure notification if the Jenkins build is a failure.
However, whenever the notification comes in slack, it is not a clickable URL. It comes as http://${MASTER_NODE}:1234/job/abc/2/
I am not able to make the master node of Jenkins dynamic, as a result, it just prints as MASTER_NODE and not converting to a clickable URL.
Any possible solution for this?

Instead of using this http://${MASTER_NODE}:1234/job/abc/2/,
$BUILD_URL in custom message
click here to see image

Related

Is there a way to hide all the HTTP request logs from the node terminal output?

When I run a suite of tests using Cypress, I get a TON of HTTP request logs to the terminal output. I think this image best shows the issue. In it, you can see the command I run to start cypress, and that following it comes a long list of every HTTP request made during the tests.
Is there a way to hide them all?
You can add the following to cypress.json:
"morgan": false,
The logs you see are from express (a built-in server within cypress).

console print some error when I deploy my blog to my website

when I finished my vuepress blog and deploy to my website. chrome console always print out the following error message . it's doesn't seem to affect function. but I want to fix it . how can I do ?
console error
Do you trying remove a node of DOM manually?
i.e. document.getElementById("any-element").removeChild("other-element");
You shoudn't to do this, because the Vue is resposible for handling DOM.
But if you need do something like that, you must to verify if the window object exist. Because when you build the Vuepress site, Node.js do a prerender of all HTML files and in this context the window object doesn't exist.

How to clear upload notification after upload is completed in nativescript

I'm using nativescript plugin nativescript-background-http to upload files in background.
Writing only for Android.
Plugin works fine. Plugin displays upload progress in the notification, as required in API26+. When upload is completed (success or error), the notification remains in the drawer until dismissed by the user.
I'm looking for a way to clear the upload notification automatically after success or error.
Has anyone done this before? Guidance on how to access the underlying notification manager that the plugin uses would also be helpful as well.
Notes:
I can't hide the notification completely using androidDisplayNotificationProgress = false option of the plugin, as since API26, Android requires developers to use notifications when running background tasks.
I've searched this question, but couldn't find information about dismissing notifications of the plugin.
Thanks
Set androidAutoClearNotification to true.
(Android only) Used to set if notifications should be cleared
automatically upon upload completion. Default is false. Please note
that setting this to true will also disable the ringtones.

Where in the logs is the Status Message of the Background (async) workflow Stop step?

I have a background workflow that ends with a Stop step. This step has an optional Status Message attribute that I populate with some details I need to be logged.
After the workflow has run I can find the workflow Status Reason (="Succeeded") and other details in the corresponding System Job record. I would also expect to find the stored info in the Message field, but it's not there. I've tried static and dynamic Status Messages, but no success with neither.
Does anybody know where that message is stored?
Basically the Message in Details section of System Job is a placeholder for some useful error message/logging tracker to log with the help of ITracingService.Trace by developer or by platform when something breaks/exception captured.
The status reason is not the good place for logging success scenario message, rather for canceled scenario to pop custom message to user & rolling back the transaction.
Not sure why you want to store there, but better use a custom field or even a note (annotation) can help you in better way. Avoid storing successful workflow execution logs anyway.
Check in system jobs:
Also, uncheck this value:
Then, you could try running the workflow sync. I prefer this than waiting for the async service.

where to config LOG_SLACK_WEBHOOK_URL laravel 5.6.7

How to use slack logging functionality in laravel 5.6.7? I wrote a line LOG_SLACK_WEBHOOK_URL = "my slack url" in .env file and used Log::emergency("alert testing..."); but did not get any notification on slack. Also i have no idea where to configure slack channel it is required or not.
Laravel 8.X
Setting Slack log just in 4 Steps:
Create Channel > Click on Channel Name > click on Integration tab > Click on Add an App
Now search app i.e. incoming webhook > Click on Install > Click on Add to Slack > Scroll down to Select the channel in which you wish to integrate.
Copy Webhook URL > Open .env file & mention below env name with webhook url.
LOG_SLACK_WEBHOOK_URL=COPIED-WEBHOOK-URL
Lastly, Open config/logging.php > Add slack in channels.stack.channels array as below image.
Done!!
I know this might be too late but anyways somebody might find this helpful.
You have to add incoming-webhook app into your slack channel.
It will generate special URL (something like 'https://hooks.slack.com/services/...) for you
Set it in your .evn file or as second argument of env() call in logging.php (as I done it)
Check slack.level value because it is set pretty high and I wanted to get every mesage so I set it to debug (the lowest level possible) (visible in screenshot too)
You can now test if or example with php artisan tinker -> Log::error('Test works');
Hope this will help somebody

Resources