Install suggested plugin
- Folders Plugin
- OWASP Markup Formatter Plugin
- build timeout plugin
- Credentials Binding Plugin
- Timestamper Workspace Cleanup Plugin
- Ant Plugin Gradle Plugin
- Pipeline GitHub Organization
- Folder Plugin
| #!/usr/bin/env bash | |
| # | |
| # Shell script to automate the backup of Microsoft SQL Server vNEXT backups on Linux. | |
| # Written by Bobby Allen <ballen@bobbyallen.me>, 26/04/2017 | |
| # | |
| # Download this script and put into your servers' /usr/bin directory (or symlink) then make it executable (chmod +x) | |
| # | |
| # Usage example (backup databases into /var/backups, keep backups for 5 days, connect to server "localhost" with the account "sa" and a password of "P455w0RD"): | |
| # mssqlbackup "/var/dbbackups" 5 "localhost" "sa" "P455w0rD" |
| #!groovy | |
| import groovy.json.JsonOutput | |
| import groovy.json.JsonSlurper | |
| def label = "mypod-${UUID.randomUUID().toString()}" | |
| podTemplate(label: label, yaml: """ | |
| spec: | |
| containers: | |
| - name: mvn | |
| image: maven:3.3.9-jdk-8 |
| #!/bin/bash | |
| SENDGRID_API_KEY="" | |
| EMAIL_TO="" | |
| FROM_EMAIL="" | |
| FROM_NAME="" | |
| SUBJECT="" | |
| bodyHTML="<p>Email body goes here</p>" |
Install suggested plugin
| #!/bin/bash | |
| if [[ ! $1 ]]; then | |
| echo -e "Usage:\n\n\t$0 'file name'" | |
| exit 1 | |
| fi | |
| f=$(ls 2>/dev/null -l /proc/*/fd/* | fgrep "$1 (deleted" | awk '{print $9}') | |
| if [[ $f ]]; then |
| $Username ="azure_*********@azure.com" | |
| $Password = ConvertTo-SecureString "********" -AsPlainText -Force | |
| $credential = New-Object System.Management.Automation.PSCredential $Username, $Password | |
| $SMTPServer = "smtp.sendgrid.net" | |
| $EmailFrom = "admin@acme.com" | |
| $EmailTo = "user@acme.com" | |
| $Subject = "SendGrid test" | |
| $Body = "SendGrid testing successful" | |
| Send-MailMessage -smtpServer $SMTPServer -Credential $credential -Usessl -Port 587 -from $EmailFrom -to $EmailTo -subject $Subject -Body $Body |
| #!groovy | |
| # Best of Jenkinsfile | |
| # `Jenkinsfile` is a groovy script DSL for defining CI/CD workflows for Jenkins | |
| node { | |
| } |
| " _ _ " | |
| " _ /|| . . ||\ _ " | |
| " ( } \||D ' ' ' C||/ { % " | |
| " | /\__,=_[_] ' . . ' [_]_=,__/\ |" | |
| " |_\_ |----| |----| _/_|" | |
| " | |/ | | | | \| |" | |
| " | /_ | | | | _\ |" | |
| It is all fun and games until someone gets hacked! |
| #!/bin/bash | |
| # Script to convert a *simple* CSV file into an HTML table | |
| # Will fail if field data contains comma or newlines | |
| # | |
| # USAGE: bash csv2html.sh CSV_FN [BORDER_WIDTH] > OUTPUT_HTML_FN | |
| usage (){ | |
| echo "USAGE: $0 CSV_FN [BORDER_WIDTH] > OUTPUT_HTML_FN" | |
| echo "Examples:" | |
| echo "$0 /tmp/input.csv > /tmp/output.html" |
Here's how to save and load docker images:
Example scenario: To save a docker image from a docker repository and save it as a tar file locally.
docker save repositoryname:tag > repotag.tar