Jenkinsfile changes
gitea/salix/test There was a failure building this commit Details

This commit is contained in:
Juan Ferrer 2019-12-23 15:02:30 +01:00
parent e2830badb9
commit 77d454e519
2 changed files with 18 additions and 7 deletions

21
Jenkinsfile vendored
View File

@ -21,7 +21,18 @@ pipeline {
} else { } else {
env.COMMITTER_EMAIL = env.GIT_COMMITTER_EMAIL; env.COMMITTER_EMAIL = env.GIT_COMMITTER_EMAIL;
} }
/*
switch (env.BRANCH_NAME) {
case 'master':
env.FRONT_PORT = SALIX_MASTER_FRONT_PORT
env.BACK_PORT = SALIX_MASTER_BACK_PORT
break
case 'test':
env.FRONT_PORT = SALIX_TEST_FRONT_PORT
env.BACK_PORT = SALIX_TEST_BACK_PORT
break
}
*/
switch (env.BRANCH_NAME) { switch (env.BRANCH_NAME) {
case 'master': case 'master':
env.NODE_ENV = 'production' env.NODE_ENV = 'production'
@ -35,16 +46,16 @@ pipeline {
configFileProvider([ configFileProvider([
configFile(fileId: "salix.env", configFile(fileId: "salix.env",
variable: 'SALIX_ENV') variable: 'ENV_FILE')
]) { ]) {
sh 'source "$SALIX_ENV"' sh '. "$ENV_FILE"'
} }
configFileProvider([ configFileProvider([
configFile(fileId: "salix.${env.NODE_ENV}.env", configFile(fileId: "salix.${env.NODE_ENV}.env",
variable: 'SALIX_LOCAL_ENV') variable: 'LOCAL_ENV_FILE')
]) { ]) {
sh 'source "$SALIX_LOCAL_ENV"' sh '. "$LOCAL_ENV_FILE"'
} }
} }
} }

View File

@ -6,14 +6,14 @@ services:
context: . context: .
dockerfile: front/Dockerfile dockerfile: front/Dockerfile
ports: ports:
- ${PORT_FRONT}:80 - ${FRONT_PORT}:80
deploy: deploy:
replicas: 3 replicas: 3
back: back:
image: registry.verdnatura.es/salix-back:${BRANCH_NAME} image: registry.verdnatura.es/salix-back:${BRANCH_NAME}
build: . build: .
ports: ports:
- ${PORT_BACK}:3000 - ${BACK_PORT}:3000
environment: environment:
- NODE_ENV - NODE_ENV
configs: configs: