|
@@ -1,27 +1,29 @@
|
|
|
#!groovy
|
|
|
-def port = 7777
|
|
|
+load "$JENKINS_HOME/.env/.envfile"
|
|
|
pipeline {
|
|
|
agent {
|
|
|
label 'master'
|
|
|
}
|
|
|
+
|
|
|
options {
|
|
|
timestamps()
|
|
|
}
|
|
|
+
|
|
|
stages {
|
|
|
- stage("build project") {
|
|
|
- steps {
|
|
|
- sh 'go build main.go webPage.go'
|
|
|
- }
|
|
|
+ stage("build project") {
|
|
|
+ steps {
|
|
|
+ sh 'go build main.go webPage.go'
|
|
|
+ }
|
|
|
}
|
|
|
- stage("deploy docker") {
|
|
|
+ stage("deploy docker") {
|
|
|
steps{
|
|
|
- sh 'docker stop schedule || exit 0'
|
|
|
- sh 'docker rm schedule || exit 0'
|
|
|
- sh 'docker build -t basic .'
|
|
|
- sh 'docker run -d --name schedule -p 7777:7777 -t basic'
|
|
|
+ sh 'docker stop schedule || exit 0'
|
|
|
+ sh 'docker rm schedule || exit 0'
|
|
|
+ sh 'docker build -t basic .'
|
|
|
+ sh 'docker run -d --name schedule -p ${env.PORT}:${env.PORT} -t basic'
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
+ }
|
|
|
post {
|
|
|
success {
|
|
|
echo 'I succeeeded!'
|