1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- #!groovy
- def GetLog() {
- withCredentials([string(credentialsId: 'JenkinsApi', variable: 'token')])
- responce = httprequest(httpMode: 'GET',
- url: 'http//admin:token@${BUILD_URL}/consoleText',
- validResponces: '200')
- return responce
- }
- pipeline {
- agent {
- label 'master'
- }
- 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!'
-
- }
- unstable {
- echo 'I am unstable :/'
- }
- failure {
- echo 'I failed :((('
- <<<<<<< HEAD
- echo GetLog()
- =======
- sh 'curl "${BUILD_URL}/consoleText" > /tmp/test.txt'
- >>>>>>> 5518cc11c8ddaf2485f2e6e569815856ea1619fc
- }
- changed {
- echo 'things were different before...'
- }
- }
- }
|