From 60561265e89be58eb324d783158cba2a171ab7f5 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Sun, 8 May 2022 23:44:20 +0200 Subject: [PATCH 1/3] Jenkinsfile fixes --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index e33e7216..446b5211 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -23,7 +23,7 @@ services: - node.role == worker cron: image: registry.verdnatura.es/hedera-web:${BRANCH_NAME:?} - command: 'cron -f' + command: '[[ $NODE_ENV == "production" ]] && cron -f' configs: - source: config target: /etc/hedera-web/config.my.php From 7464abc5a41db8034388bf01a4c50cc147c7994c Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Sun, 8 May 2022 23:47:57 +0200 Subject: [PATCH 2/3] Compose fixes --- docker-compose.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index 446b5211..e7a17bb3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -31,6 +31,8 @@ services: - /mnt/appdata:/mnt/storage - /mnt/appdata/image:/var/lib/hedera-web/image-db deploy: + restart_policy: + condition: none placement: constraints: - node.role == worker From 4f82cc9e9ad3d135991d5e7fa389f218d192cc23 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Sun, 8 May 2022 23:54:48 +0200 Subject: [PATCH 3/3] compose fixes --- Jenkinsfile | 6 ++++-- docker-compose.yml | 7 +++---- 2 files changed, 7 insertions(+), 6 deletions(-) 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