Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #10

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
39 changes: 39 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
pipeline {
// Run on an agent where we want to use Go
agent any

// Ensure the desired Go version is installed for all stages,
// using the name defined in the Global Tool Configuration
tools { go 'go 1.20.7' }


stages {

stage('for dev branch') {
when {
branch 'dev'
}
steps {
echo 'this is only for brunch dev'
}

stage('Build') {
steps {
sh 'go build -o myprogram'
}
}

stage('Test') {
steps {
sh 'go test'
}
}
}

post {
always {
archiveArtifacts artifacts: 'myprogram', onlyIfSuccessful: true
}
}
}