#!groovy

pipeline {
    agent {
       label 'master'
    }
    options {
       timestamps()
    }
    stages {
     stage("build project") {
       steps {
           sh 'go build main.go webPage.go'
       }
      }
    }
    post {
      success {
        echo 'I succeeeded!'
        sh 'cat $JENKINS_HOME/jobs/$JOB_NAME/builds/$BUILD_NUMBER/log > /tmp/success.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...'
      }
    } 
}