This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Copyright (c) 2020, Saeid Bostandoust | |
# ssbostan@linuxmail.org | |
# https://b9t.ir | |
# All rights reserved. | |
PIPELINE_PROJECT_NAME="YOUR-PROJECT-NAME" | |
if [[ ! -d "./$PIPELINE_PROJECT_NAME" ]]; then | |
git clone YOUR-GIT-ADDRESS | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
tar -zcf /backups/backup-$(date +%Y%m%d).tar.gz --absolute-names /data | |
rm -f /backups/backup-$(date -d 'now - 7 days' +%Y%m%d).tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pipeline { | |
agent any | |
stages { | |
stage("Build") { | |
steps { | |
echo "Build stage." | |
} | |
} | |
stage("Test") { | |
steps { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pipeline { | |
agent none | |
stages { | |
stage("Build") { | |
agent any | |
steps { | |
echo "Build stage." | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pipeline { | |
agent { | |
label "linux" | |
} | |
stages { | |
stage("Build") { | |
steps { | |
echo "Build stage." | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pipeline { | |
agent { | |
docker "alpine" | |
} | |
stages { | |
stage("Build") { | |
steps { | |
sh "hostname" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pipeline { | |
agent { | |
dockerfile true | |
} | |
stages { | |
stage("Build") { | |
steps { | |
sh "hostname" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pipeline { | |
agent any | |
environment { | |
SAMPLE_GLOBAL_ENV_VAR = "Test global ENV variables." | |
} | |
stages { | |
stage("Build") { | |
environment { | |
SAMPLE_STAGE_ENV_VAR = "Test stage ENV variables." | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pipeline { | |
agent any | |
environment { | |
SAMPLE_ENV = credentials("simple-secret-text") | |
} | |
stages { | |
stage("Release") { | |
steps { | |
// Do not use " for command methods like sh, bat, powershell, pwsh, etc. | |
// Use ' to avoid groovy interpolation and command injection vulnerabilities. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pipeline { | |
agent any | |
environment { | |
MYUSERPASS = credentials("test-user-pass") | |
} | |
stages { | |
stage("Test") { | |
steps { | |
// Do not use " for command methods like sh, bat, powershell, pwsh, etc. | |
// Use ' to avoid groovy interpolation and command injection vulnerabilities. |
OlderNewer