Add deploy
This commit is contained in:
parent
be68067140
commit
507080a398
1 changed files with 14 additions and 26 deletions
40
Jenkinsfile
vendored
40
Jenkinsfile
vendored
|
@ -1,38 +1,26 @@
|
||||||
pipeline {
|
pipeline {
|
||||||
agent any
|
agent any
|
||||||
stages {
|
stages {
|
||||||
stage("Test") {
|
stage('Build') {
|
||||||
steps {
|
steps {
|
||||||
sh 'echo "Running tests"'
|
echo 'Building'
|
||||||
}
|
|
||||||
}
|
|
||||||
stage("Build") {
|
|
||||||
steps {
|
|
||||||
sh 'echo "Hello World"'
|
|
||||||
sh '''
|
|
||||||
echo "Multiline shell steps work too"
|
|
||||||
ls -lah
|
|
||||||
pwd
|
|
||||||
'''
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
post {
|
stage('Test') {
|
||||||
always {
|
steps {
|
||||||
echo 'This will always run'
|
echo 'Testing'
|
||||||
}
|
}
|
||||||
success {
|
}
|
||||||
echo 'This will run only if successful'
|
stage('Deploy - Staging') {
|
||||||
|
steps {
|
||||||
|
sh './deploy staging'
|
||||||
|
sh './run-smoke-tests'
|
||||||
}
|
}
|
||||||
failure {
|
}
|
||||||
echo 'This will run only if failed'
|
stage('Deploy - Production') {
|
||||||
}
|
steps {
|
||||||
unstable {
|
sh './deploy production'
|
||||||
echo 'This will run only if the run was marked unstable'
|
|
||||||
}
|
|
||||||
changed {
|
|
||||||
echo 'This will run only if the state of the Pipeline has changed'
|
|
||||||
echo 'For example, if the Pipeline was previously failing but is now successful'
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue