diff --git a/Jenkinsfile b/Jenkinsfile index 6de5da29..a6157350 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -16,11 +16,13 @@ pipeline { switch (env.BRANCH_NAME) { case 'master': env.NODE_ENV = 'production' - env.REPLICAS = 3 + env.MAIN_REPLICAS = 3 + env.CRON_REPLICAS = 1 break case 'test': env.NODE_ENV = 'test' - env.REPLICAS = 1 + env.MAIN_REPLICAS = 1 + env.CRON_REPLICAS = 0 break } } diff --git a/docker-compose.yml b/docker-compose.yml index e7a17bb3..3d82bab1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -17,13 +17,13 @@ services: - /mnt/appdata/image:/var/lib/hedera-web/image-db - /mnt/appdata/vn-access:/var/lib/hedera-web/vn-access deploy: - replicas: ${REPLICAS:?} + replicas: ${MAIN_REPLICAS:?} placement: constraints: - node.role == worker cron: image: registry.verdnatura.es/hedera-web:${BRANCH_NAME:?} - command: '[[ $NODE_ENV == "production" ]] && cron -f' + command: 'cron -f' configs: - source: config target: /etc/hedera-web/config.my.php @@ -31,8 +31,7 @@ services: - /mnt/appdata:/mnt/storage - /mnt/appdata/image:/var/lib/hedera-web/image-db deploy: - restart_policy: - condition: none + replicas: ${CRON_REPLICAS:?} placement: constraints: - node.role == worker