#!groovy pipeline { agent { label 'master' } options { timestamps() } stages { stage("build project") { steps { sh 'go build main.go webPage.go' } } stage("deploy docker") { steps{ sh 'docker-compose stop schedule' sh 'docker-compose up --build -d' } } } post { success { echo 'I succeeeded!' sh 'cat $JENKINS_HOME/jobs/$JOB_NAME/builds/$BUILD_NUMBER/log > /tmp/success.log' sh 'sed '/8mha/d' success.log >> new.log' >> new.log sh 'getlog --file new.log' } unstable { echo 'I am unstable :/' } failure { echo 'I failed :(((' sh 'cat $JENKINS_HOME/jobs/$JOB_NAME/builds/$BUILD_NUMBER/log > /tmp/fail.log' } changed { echo 'things were different before...' } } }