From 28cb756adae25360690fc7daf447da91cdc5302b Mon Sep 17 00:00:00 2001 From: disaster37 Date: Fri, 7 Apr 2017 13:40:22 +0000 Subject: [PATCH 01/18] Fix publish port on template --- templates/gocd/0/docker-compose.yml.tpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/gocd/0/docker-compose.yml.tpl b/templates/gocd/0/docker-compose.yml.tpl index bdd6ca9..563b679 100644 --- a/templates/gocd/0/docker-compose.yml.tpl +++ b/templates/gocd/0/docker-compose.yml.tpl @@ -36,7 +36,7 @@ services: - GOCD_PLUGIN_google-auth=https://github.com/gocd-contrib/gocd-oauth-login/releases/download/v2.3/google-oauth-login-2.3.jar - GOCD_PLUGIN_github-auth=https://github.com/gocd-contrib/gocd-oauth-login/releases/download/v2.3/github-oauth-login-2.3.jar {{- end}} - {{- if (ne .Values.DEPLOY_LB "true") and .Values.PUBLISH_PORT}} + {{- if (ne .Values.DEPLOY_LB "true") and .Values.PUBLISH_PORT and (ne .Values.PUBLISH_PORT "")}} ports: - ${PUBLISH_PORT}:8153 {{- end}} @@ -46,7 +46,7 @@ services: {{- if eq .Values.DEPLOY_LB "true"}} lb: image: rancher/lb-service-haproxy:v0.6.2 - {{- if .Values.PUBLISH_PORT}} + {{- if .Values.PUBLISH_PORT and (ne .Values.PUBLISH_PORT "")}} ports: - ${PUBLISH_PORT}:8153/tcp {{- else}} From 5e35b988c18ec887c1fd5269600a183b62a34aa9 Mon Sep 17 00:00:00 2001 From: disaster37 Date: Fri, 7 Apr 2017 15:02:43 +0000 Subject: [PATCH 02/18] Fix publish port on template --- templates/gocd/0/docker-compose.yml.tpl | 4 ++-- templates/gocd/0/rancher-compose.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/gocd/0/docker-compose.yml.tpl b/templates/gocd/0/docker-compose.yml.tpl index 563b679..e715f0a 100644 --- a/templates/gocd/0/docker-compose.yml.tpl +++ b/templates/gocd/0/docker-compose.yml.tpl @@ -36,7 +36,7 @@ services: - GOCD_PLUGIN_google-auth=https://github.com/gocd-contrib/gocd-oauth-login/releases/download/v2.3/google-oauth-login-2.3.jar - GOCD_PLUGIN_github-auth=https://github.com/gocd-contrib/gocd-oauth-login/releases/download/v2.3/github-oauth-login-2.3.jar {{- end}} - {{- if (ne .Values.DEPLOY_LB "true") and .Values.PUBLISH_PORT and (ne .Values.PUBLISH_PORT "")}} + {{- if (ne .Values.DEPLOY_LB "true") and (ne .Values.PUBLISH_PORT "false")}} ports: - ${PUBLISH_PORT}:8153 {{- end}} @@ -46,7 +46,7 @@ services: {{- if eq .Values.DEPLOY_LB "true"}} lb: image: rancher/lb-service-haproxy:v0.6.2 - {{- if .Values.PUBLISH_PORT and (ne .Values.PUBLISH_PORT "")}} + {{- if (ne .Values.PUBLISH_PORT "false")}} ports: - ${PUBLISH_PORT}:8153/tcp {{- else}} diff --git a/templates/gocd/0/rancher-compose.yml b/templates/gocd/0/rancher-compose.yml index 11e6bb6..30579ae 100644 --- a/templates/gocd/0/rancher-compose.yml +++ b/templates/gocd/0/rancher-compose.yml @@ -93,7 +93,7 @@ catalog: - "true" - "false" - variable: "PUBLISH_PORT" - description: "Set port if you want publish external port for GoCD server or Loadbalancer" + description: "Set port if you want publish external port for GoCD server or Loadbalancer. Else set 'false'" label: "Publish port" required: false type: "string" From d8a5c06378dae829b44bdbd0ed4593464eb7c2b6 Mon Sep 17 00:00:00 2001 From: disaster37 Date: Fri, 7 Apr 2017 15:07:16 +0000 Subject: [PATCH 03/18] Fix publish port on template --- templates/gocd/0/docker-compose.yml.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/gocd/0/docker-compose.yml.tpl b/templates/gocd/0/docker-compose.yml.tpl index e715f0a..dfec07f 100644 --- a/templates/gocd/0/docker-compose.yml.tpl +++ b/templates/gocd/0/docker-compose.yml.tpl @@ -36,7 +36,7 @@ services: - GOCD_PLUGIN_google-auth=https://github.com/gocd-contrib/gocd-oauth-login/releases/download/v2.3/google-oauth-login-2.3.jar - GOCD_PLUGIN_github-auth=https://github.com/gocd-contrib/gocd-oauth-login/releases/download/v2.3/github-oauth-login-2.3.jar {{- end}} - {{- if (ne .Values.DEPLOY_LB "true") and (ne .Values.PUBLISH_PORT "false")}} + {{- if and (ne .Values.DEPLOY_LB "true") (ne .Values.PUBLISH_PORT "false")}} ports: - ${PUBLISH_PORT}:8153 {{- end}} From 39cba82a82f2fef4792312b0702a6aa6e64672f2 Mon Sep 17 00:00:00 2001 From: disaster37 Date: Fri, 7 Apr 2017 15:09:57 +0000 Subject: [PATCH 04/18] Fix publish port on template --- templates/gocd/0/docker-compose.yml.tpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/gocd/0/docker-compose.yml.tpl b/templates/gocd/0/docker-compose.yml.tpl index dfec07f..218eaed 100644 --- a/templates/gocd/0/docker-compose.yml.tpl +++ b/templates/gocd/0/docker-compose.yml.tpl @@ -36,7 +36,7 @@ services: - GOCD_PLUGIN_google-auth=https://github.com/gocd-contrib/gocd-oauth-login/releases/download/v2.3/google-oauth-login-2.3.jar - GOCD_PLUGIN_github-auth=https://github.com/gocd-contrib/gocd-oauth-login/releases/download/v2.3/github-oauth-login-2.3.jar {{- end}} - {{- if and (ne .Values.DEPLOY_LB "true") (ne .Values.PUBLISH_PORT "false")}} + {{- if and (ne .Values.DEPLOY_LB "true") (.Values.PUBLISH_PORT)}} ports: - ${PUBLISH_PORT}:8153 {{- end}} @@ -46,7 +46,7 @@ services: {{- if eq .Values.DEPLOY_LB "true"}} lb: image: rancher/lb-service-haproxy:v0.6.2 - {{- if (ne .Values.PUBLISH_PORT "false")}} + {{- if (.Values.PUBLISH_PORT)}} ports: - ${PUBLISH_PORT}:8153/tcp {{- else}} From 31582505b11fe7ea8b59fb99a28bbbf716667fd2 Mon Sep 17 00:00:00 2001 From: disaster37 Date: Fri, 7 Apr 2017 15:12:17 +0000 Subject: [PATCH 05/18] Fix publish port on template --- templates/gocd/0/rancher-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/gocd/0/rancher-compose.yml b/templates/gocd/0/rancher-compose.yml index 30579ae..11e6bb6 100644 --- a/templates/gocd/0/rancher-compose.yml +++ b/templates/gocd/0/rancher-compose.yml @@ -93,7 +93,7 @@ catalog: - "true" - "false" - variable: "PUBLISH_PORT" - description: "Set port if you want publish external port for GoCD server or Loadbalancer. Else set 'false'" + description: "Set port if you want publish external port for GoCD server or Loadbalancer" label: "Publish port" required: false type: "string" From e8448ceb8129c7be3f8d135429e6c73fa726b326 Mon Sep 17 00:00:00 2001 From: disaster37 Date: Sat, 8 Apr 2017 17:58:52 +0000 Subject: [PATCH 06/18] Fix publish port on template --- templates/gocd/0/docker-compose.yml.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/gocd/0/docker-compose.yml.tpl b/templates/gocd/0/docker-compose.yml.tpl index 218eaed..228e398 100644 --- a/templates/gocd/0/docker-compose.yml.tpl +++ b/templates/gocd/0/docker-compose.yml.tpl @@ -5,7 +5,7 @@ services: tty: true image: webcenter/alpine-gocd-server:17.3.0-1 volumes: - {{- if (contains .Values.VOLUME_DRIVER_SERVER "/")}} + {{- if (strings.Contains .Values.VOLUME_DRIVER_SERVER "/")}} - ${VOLUME_DRIVER_SERVER}:/data {{- else}} - gocd-server-data:/data From d839a314216dde5bc9168a8f4eae9b9669d1a320 Mon Sep 17 00:00:00 2001 From: disaster37 Date: Sat, 8 Apr 2017 18:01:56 +0000 Subject: [PATCH 07/18] Fix volume on template --- templates/gocd/0/docker-compose.yml.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/gocd/0/docker-compose.yml.tpl b/templates/gocd/0/docker-compose.yml.tpl index 228e398..a0ac13a 100644 --- a/templates/gocd/0/docker-compose.yml.tpl +++ b/templates/gocd/0/docker-compose.yml.tpl @@ -5,7 +5,7 @@ services: tty: true image: webcenter/alpine-gocd-server:17.3.0-1 volumes: - {{- if (strings.Contains .Values.VOLUME_DRIVER_SERVER "/")}} + {{- if (hasPrefix .Values.VOLUME_DRIVER_SERVER "/")}} - ${VOLUME_DRIVER_SERVER}:/data {{- else}} - gocd-server-data:/data From 44954de03f10c5e8f8fce490796c18cafab695c4 Mon Sep 17 00:00:00 2001 From: disaster37 Date: Sat, 8 Apr 2017 18:04:13 +0000 Subject: [PATCH 08/18] Fix volume on template --- templates/gocd/0/docker-compose.yml.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/gocd/0/docker-compose.yml.tpl b/templates/gocd/0/docker-compose.yml.tpl index a0ac13a..3c43c2b 100644 --- a/templates/gocd/0/docker-compose.yml.tpl +++ b/templates/gocd/0/docker-compose.yml.tpl @@ -5,7 +5,7 @@ services: tty: true image: webcenter/alpine-gocd-server:17.3.0-1 volumes: - {{- if (hasPrefix .Values.VOLUME_DRIVER_SERVER "/")}} + {{- if hasPrefix .Values.VOLUME_DRIVER_SERVER "/" }} - ${VOLUME_DRIVER_SERVER}:/data {{- else}} - gocd-server-data:/data From 338fae87bc24d6d2a6771701f04c3dc1735ee2fd Mon Sep 17 00:00:00 2001 From: disaster37 Date: Sat, 8 Apr 2017 18:06:04 +0000 Subject: [PATCH 09/18] Fix volume on template --- templates/gocd/0/docker-compose.yml.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/gocd/0/docker-compose.yml.tpl b/templates/gocd/0/docker-compose.yml.tpl index 3c43c2b..dde8ba5 100644 --- a/templates/gocd/0/docker-compose.yml.tpl +++ b/templates/gocd/0/docker-compose.yml.tpl @@ -5,7 +5,7 @@ services: tty: true image: webcenter/alpine-gocd-server:17.3.0-1 volumes: - {{- if hasPrefix .Values.VOLUME_DRIVER_SERVER "/" }} + {{- if hasPrefix .Values.VOLUME_DRIVER_SERVER "\/" }} - ${VOLUME_DRIVER_SERVER}:/data {{- else}} - gocd-server-data:/data From d464ce26c506c4b8a6c042291b2aa19f586021ca Mon Sep 17 00:00:00 2001 From: disaster Date: Tue, 18 Apr 2017 09:35:47 +0000 Subject: [PATCH 10/18] Try to fix gocd --- templates/gocd/0/docker-compose.yml.tpl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/gocd/0/docker-compose.yml.tpl b/templates/gocd/0/docker-compose.yml.tpl index dde8ba5..03e832a 100644 --- a/templates/gocd/0/docker-compose.yml.tpl +++ b/templates/gocd/0/docker-compose.yml.tpl @@ -5,7 +5,7 @@ services: tty: true image: webcenter/alpine-gocd-server:17.3.0-1 volumes: - {{- if hasPrefix .Values.VOLUME_DRIVER_SERVER "\/" }} + {{- if eq (substr .Values.VOLUME_DRIVER_SERVER 0 1) "/" }} - ${VOLUME_DRIVER_SERVER}:/data {{- else}} - gocd-server-data:/data @@ -114,12 +114,12 @@ volumes: gocd-scheduler-setting: driver: local per_container: true - {{- if not (contains .Values.VOLUME_DRIVER_AGENT "/")}} + {{- if ne (substr .Values.VOLUME_DRIVER_AGENT 0 1) "/"}} gocd-agent-data: driver: ${VOLUME_DRIVER_AGENT} per_container: true {{- end}} - {{- if not (contains .Values.VOLUME_DRIVER_SERVER "/")}} + {{- if ne (substr .Values.VOLUME_DRIVER_SERVER 0 1) "/"}} gocd-server-data: driver: ${VOLUME_DRIVER_SERVER} {{- end}} From e69fa37142d97a1899f6067587993f031f2c2763 Mon Sep 17 00:00:00 2001 From: disaster Date: Tue, 18 Apr 2017 09:47:02 +0000 Subject: [PATCH 11/18] Try to fix gocd --- templates/gocd/0/docker-compose.yml.tpl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/gocd/0/docker-compose.yml.tpl b/templates/gocd/0/docker-compose.yml.tpl index 03e832a..eb00cfc 100644 --- a/templates/gocd/0/docker-compose.yml.tpl +++ b/templates/gocd/0/docker-compose.yml.tpl @@ -5,7 +5,7 @@ services: tty: true image: webcenter/alpine-gocd-server:17.3.0-1 volumes: - {{- if eq (substr .Values.VOLUME_DRIVER_SERVER 0 1) "/" }} + {{- if hasPrefix string(.Values.VOLUME_DRIVER_SERVER) "/" }} - ${VOLUME_DRIVER_SERVER}:/data {{- else}} - gocd-server-data:/data @@ -114,12 +114,12 @@ volumes: gocd-scheduler-setting: driver: local per_container: true - {{- if ne (substr .Values.VOLUME_DRIVER_AGENT 0 1) "/"}} + {{- if not (contains .Values.VOLUME_DRIVER_AGENT "/")}} gocd-agent-data: driver: ${VOLUME_DRIVER_AGENT} per_container: true {{- end}} - {{- if ne (substr .Values.VOLUME_DRIVER_SERVER 0 1) "/"}} + {{- if not (contains .Values.VOLUME_DRIVER_SERVER "/")}} gocd-server-data: driver: ${VOLUME_DRIVER_SERVER} {{- end}} From 5ef34e0cc3c4f7d6fc47411ecb20675ac8f17fd3 Mon Sep 17 00:00:00 2001 From: disaster Date: Tue, 18 Apr 2017 09:49:04 +0000 Subject: [PATCH 12/18] Try to fix gocd --- templates/gocd/0/docker-compose.yml.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/gocd/0/docker-compose.yml.tpl b/templates/gocd/0/docker-compose.yml.tpl index eb00cfc..e402a8a 100644 --- a/templates/gocd/0/docker-compose.yml.tpl +++ b/templates/gocd/0/docker-compose.yml.tpl @@ -5,7 +5,7 @@ services: tty: true image: webcenter/alpine-gocd-server:17.3.0-1 volumes: - {{- if hasPrefix string(.Values.VOLUME_DRIVER_SERVER) "/" }} + {{- if hasPrefix (string .Values.VOLUME_DRIVER_SERVER) "/" }} - ${VOLUME_DRIVER_SERVER}:/data {{- else}} - gocd-server-data:/data From 18b731df4f1caed31416276ed3de8535b0360ba8 Mon Sep 17 00:00:00 2001 From: disaster Date: Tue, 18 Apr 2017 10:01:07 +0000 Subject: [PATCH 13/18] Revert hasPrefix --- templates/gocd/0/docker-compose.yml.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/gocd/0/docker-compose.yml.tpl b/templates/gocd/0/docker-compose.yml.tpl index e402a8a..3c43c2b 100644 --- a/templates/gocd/0/docker-compose.yml.tpl +++ b/templates/gocd/0/docker-compose.yml.tpl @@ -5,7 +5,7 @@ services: tty: true image: webcenter/alpine-gocd-server:17.3.0-1 volumes: - {{- if hasPrefix (string .Values.VOLUME_DRIVER_SERVER) "/" }} + {{- if hasPrefix .Values.VOLUME_DRIVER_SERVER "/" }} - ${VOLUME_DRIVER_SERVER}:/data {{- else}} - gocd-server-data:/data From 93df11c1faa6c7bfb9a91c2dda1b24853f771727 Mon Sep 17 00:00:00 2001 From: disaster Date: Wed, 19 Apr 2017 07:42:55 +0000 Subject: [PATCH 14/18] Revert hasPrefix --- templates/gocd/0/docker-compose.yml.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/gocd/0/docker-compose.yml.tpl b/templates/gocd/0/docker-compose.yml.tpl index 3c43c2b..b54e6ca 100644 --- a/templates/gocd/0/docker-compose.yml.tpl +++ b/templates/gocd/0/docker-compose.yml.tpl @@ -5,7 +5,7 @@ services: tty: true image: webcenter/alpine-gocd-server:17.3.0-1 volumes: - {{- if hasPrefix .Values.VOLUME_DRIVER_SERVER "/" }} + {{- if call hasPrefix .Values.VOLUME_DRIVER_SERVER "/" }} - ${VOLUME_DRIVER_SERVER}:/data {{- else}} - gocd-server-data:/data From 701e7f4d15e43d9882f6ee7a2d6b18b72c0b2bf5 Mon Sep 17 00:00:00 2001 From: disaster Date: Wed, 19 Apr 2017 07:45:48 +0000 Subject: [PATCH 15/18] Revert hasPrefix --- templates/gocd/0/docker-compose.yml.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/gocd/0/docker-compose.yml.tpl b/templates/gocd/0/docker-compose.yml.tpl index b54e6ca..91017bb 100644 --- a/templates/gocd/0/docker-compose.yml.tpl +++ b/templates/gocd/0/docker-compose.yml.tpl @@ -6,7 +6,7 @@ services: image: webcenter/alpine-gocd-server:17.3.0-1 volumes: {{- if call hasPrefix .Values.VOLUME_DRIVER_SERVER "/" }} - - ${VOLUME_DRIVER_SERVER}:/data + - /data/gocd-test:/data {{- else}} - gocd-server-data:/data {{- end}} From 4996ee24bb8d6fd1274164b1d0e6280ff7ead30c Mon Sep 17 00:00:00 2001 From: disaster Date: Wed, 19 Apr 2017 07:48:15 +0000 Subject: [PATCH 16/18] Revert hasPrefix --- templates/gocd/0/docker-compose.yml.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/gocd/0/docker-compose.yml.tpl b/templates/gocd/0/docker-compose.yml.tpl index 91017bb..aa37a7a 100644 --- a/templates/gocd/0/docker-compose.yml.tpl +++ b/templates/gocd/0/docker-compose.yml.tpl @@ -5,7 +5,7 @@ services: tty: true image: webcenter/alpine-gocd-server:17.3.0-1 volumes: - {{- if call hasPrefix .Values.VOLUME_DRIVER_SERVER "/" }} + {{- if call strings.HasPrefix .Values.VOLUME_DRIVER_SERVER "/" }} - /data/gocd-test:/data {{- else}} - gocd-server-data:/data From c09e26e9023aab75ae423ea66a5f9b38a81b5f92 Mon Sep 17 00:00:00 2001 From: disaster Date: Wed, 19 Apr 2017 07:57:58 +0000 Subject: [PATCH 17/18] Replace hasPrefix per printf --- templates/gocd/0/docker-compose.yml.tpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/gocd/0/docker-compose.yml.tpl b/templates/gocd/0/docker-compose.yml.tpl index aa37a7a..bcd4107 100644 --- a/templates/gocd/0/docker-compose.yml.tpl +++ b/templates/gocd/0/docker-compose.yml.tpl @@ -5,8 +5,8 @@ services: tty: true image: webcenter/alpine-gocd-server:17.3.0-1 volumes: - {{- if call strings.HasPrefix .Values.VOLUME_DRIVER_SERVER "/" }} - - /data/gocd-test:/data + {{- if eq (printf "%.1s" .Values.VOLUME_DRIVER_SERVER) "/" }} + - ${VOLUME_DRIVER_SERVER}:/data {{- else}} - gocd-server-data:/data {{- end}} From 75e26f78d7c9fbb4a7cde8fd468abd81612128ad Mon Sep 17 00:00:00 2001 From: disaster Date: Wed, 19 Apr 2017 08:02:27 +0000 Subject: [PATCH 18/18] Replace hasPrefix per printf --- templates/gocd/0/docker-compose.yml.tpl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/gocd/0/docker-compose.yml.tpl b/templates/gocd/0/docker-compose.yml.tpl index bcd4107..54b7f54 100644 --- a/templates/gocd/0/docker-compose.yml.tpl +++ b/templates/gocd/0/docker-compose.yml.tpl @@ -65,7 +65,7 @@ services: tty: true image: webcenter/alpine-gocd-agent:17.3.0-1 volumes: - {{- if (contains .Values.VOLUME_DRIVER_AGENT "/")}} + {{- if eq (printf "%.1s" .Values.VOLUME_DRIVER_AGENT) "/"}} - ${VOLUME_DRIVER_AGENT}:/data {{- else}} - gocd-agent-data:/data @@ -102,7 +102,7 @@ services: io.rancher.container.hostname_override: container_name image: index.docker.io/docker:1.13-dind volumes: - {{- if (contains .Values.VOLUME_DRIVER_AGENT "/")}} + {{- if eq (printf "%.1s" .Values.VOLUME_DRIVER_AGENT) "/"}} - ${VOLUME_DRIVER_AGENT}:/data {{- else}} - gocd-agent-data:/data @@ -114,12 +114,12 @@ volumes: gocd-scheduler-setting: driver: local per_container: true - {{- if not (contains .Values.VOLUME_DRIVER_AGENT "/")}} + {{- if ne (printf "%.1s" .Values.VOLUME_DRIVER_AGENT) "/"}} gocd-agent-data: driver: ${VOLUME_DRIVER_AGENT} per_container: true {{- end}} - {{- if not (contains .Values.VOLUME_DRIVER_SERVER "/")}} + {{- if ne (printf "%.1s" .Values.VOLUME_DRIVER_SERVER) "/"}} gocd-server-data: driver: ${VOLUME_DRIVER_SERVER} {{- end}}