copied the code from the working repo
This commit is contained in:
33
Jenkinsfile
vendored
Normal file
33
Jenkinsfile
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
pipeline {
|
||||
agent any
|
||||
|
||||
environment {
|
||||
PROD_ENV = credentials('prod_env')
|
||||
DEV_ENV = credentials('dev_env')
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('Build') {
|
||||
steps {
|
||||
withCredentials([file(credentialsId: 'dev_env', variable: 'DEV_ENV_FILE')]) {
|
||||
sh 'rm -f ${WORKSPACE}/.env'
|
||||
sh 'cp ${DEV_ENV_FILE} ./.env'
|
||||
}
|
||||
|
||||
sh 'docker compose build'
|
||||
}
|
||||
}
|
||||
|
||||
stage('Deploy for development') {
|
||||
agent { node { label "dev" } }
|
||||
|
||||
when {
|
||||
branch 'dev'
|
||||
}
|
||||
|
||||
steps {
|
||||
sh 'docker compose up -d'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user