From 516cfdff0405d57fc5ff53019c73043230a3d8ef Mon Sep 17 00:00:00 2001 From: Tayyeb Date: Sun, 30 Jul 2017 09:26:06 +0430 Subject: [PATCH 1/3] update gitlab-ce to 9.4.2 and gitlab-runner to 9.4.1 --- templates/gitlab-multi-runner/0/docker-compose.yml | 4 ++-- templates/gitlab-multi-runner/0/rancher-compose.yml | 2 +- templates/gitlab-multi-runner/config.yml | 2 +- templates/gitlab/0/docker-compose.yml | 2 +- templates/gitlab/0/rancher-compose.yml | 2 +- templates/gitlab/config.yml | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/templates/gitlab-multi-runner/0/docker-compose.yml b/templates/gitlab-multi-runner/0/docker-compose.yml index c331348..f0cabfc 100644 --- a/templates/gitlab-multi-runner/0/docker-compose.yml +++ b/templates/gitlab-multi-runner/0/docker-compose.yml @@ -3,7 +3,7 @@ version: '2' services: gitlab-runner-config: - image: gitlab/gitlab-runner:alpine-v9.3.0 + image: gitlab/gitlab-runner:alpine-v9.4.1 stdin_open: true volumes: - /etc/gitlab-runner/ @@ -31,7 +31,7 @@ services: io.rancher.container.start_once: 'true' gitlab-runner: - image: gitlab/gitlab-runner:alpine-v9.3.0 + image: gitlab/gitlab-runner:alpine-v9.4.1 stdin_open: true volumes: - /var/run/docker.sock:/var/run/docker.sock diff --git a/templates/gitlab-multi-runner/0/rancher-compose.yml b/templates/gitlab-multi-runner/0/rancher-compose.yml index ab5c198..e2c9479 100644 --- a/templates/gitlab-multi-runner/0/rancher-compose.yml +++ b/templates/gitlab-multi-runner/0/rancher-compose.yml @@ -2,7 +2,7 @@ version: '2' catalog: name: "gitlab-multi-runner" - version: "9.3.0" + version: "9.4.1" description: "a Gitlab pipelines multi-runner, that will spawn privates runners in your infra." minimum_rancher_version: v1.5.0 # maximum_rancher_version: diff --git a/templates/gitlab-multi-runner/config.yml b/templates/gitlab-multi-runner/config.yml index eca0b3c..bbd9c0f 100644 --- a/templates/gitlab-multi-runner/config.yml +++ b/templates/gitlab-multi-runner/config.yml @@ -1,5 +1,5 @@ name: gitlab-multi-runner description: | a Gitlab pipelines multi-runner, that will spawn privates runners in your infra. -version: 9.3.0 +version: 9.4.1 category: Continuous Integration diff --git a/templates/gitlab/0/docker-compose.yml b/templates/gitlab/0/docker-compose.yml index 9422535..d1d4bb9 100644 --- a/templates/gitlab/0/docker-compose.yml +++ b/templates/gitlab/0/docker-compose.yml @@ -15,7 +15,7 @@ services: - ${https_port}:443/tcp labels: io.rancher.container.hostname_override: container_name - image: gitlab/gitlab-ce:9.3.3-ce.0 + image: gitlab/gitlab-ce:9.4.2-ce.0 volumes: - gitlab-app-data:/var/opt/gitlab - gitlab-log-data:/var/log/gitlab diff --git a/templates/gitlab/0/rancher-compose.yml b/templates/gitlab/0/rancher-compose.yml index b382043..083028c 100644 --- a/templates/gitlab/0/rancher-compose.yml +++ b/templates/gitlab/0/rancher-compose.yml @@ -1,6 +1,6 @@ .catalog: name: Gitlab Community - version: 9.3.3-ce.0 + version: 9.4.2-ce.0 description: | Gitlab CE is a free GitHub alternative minimum_rancher_version: v0.56.0 diff --git a/templates/gitlab/config.yml b/templates/gitlab/config.yml index a4ad423..de84bde 100644 --- a/templates/gitlab/config.yml +++ b/templates/gitlab/config.yml @@ -1,5 +1,5 @@ name: Gitlab Community description: | Gitlab CE is a free GitHub alternative -version: 9.3.3-ce.0 +version: 9.4.2-ce.0 category: Versioning From c1e33ae921f0434d470f5f6cdf43c9642481d73c Mon Sep 17 00:00:00 2001 From: Tayyeb Date: Tue, 1 Aug 2017 07:15:55 +0430 Subject: [PATCH 2/3] gitlab-ce to 9.4.2 and gitlab-runner to 9.4.1 added as new version --- .../gitlab-multi-runner/0/docker-compose.yml | 4 +- .../gitlab-multi-runner/0/rancher-compose.yml | 2 +- .../gitlab-multi-runner/1/docker-compose.yml | 46 +++++++++++++ .../gitlab-multi-runner/1/rancher-compose.yml | 37 ++++++++++ templates/gitlab/0/docker-compose.yml | 2 +- templates/gitlab/0/rancher-compose.yml | 2 +- templates/gitlab/1/README.md | 9 +++ templates/gitlab/1/docker-compose.yml | 26 +++++++ templates/gitlab/1/rancher-compose.yml | 69 +++++++++++++++++++ 9 files changed, 192 insertions(+), 5 deletions(-) create mode 100644 templates/gitlab-multi-runner/1/docker-compose.yml create mode 100644 templates/gitlab-multi-runner/1/rancher-compose.yml create mode 100644 templates/gitlab/1/README.md create mode 100644 templates/gitlab/1/docker-compose.yml create mode 100644 templates/gitlab/1/rancher-compose.yml diff --git a/templates/gitlab-multi-runner/0/docker-compose.yml b/templates/gitlab-multi-runner/0/docker-compose.yml index f0cabfc..c331348 100644 --- a/templates/gitlab-multi-runner/0/docker-compose.yml +++ b/templates/gitlab-multi-runner/0/docker-compose.yml @@ -3,7 +3,7 @@ version: '2' services: gitlab-runner-config: - image: gitlab/gitlab-runner:alpine-v9.4.1 + image: gitlab/gitlab-runner:alpine-v9.3.0 stdin_open: true volumes: - /etc/gitlab-runner/ @@ -31,7 +31,7 @@ services: io.rancher.container.start_once: 'true' gitlab-runner: - image: gitlab/gitlab-runner:alpine-v9.4.1 + image: gitlab/gitlab-runner:alpine-v9.3.0 stdin_open: true volumes: - /var/run/docker.sock:/var/run/docker.sock diff --git a/templates/gitlab-multi-runner/0/rancher-compose.yml b/templates/gitlab-multi-runner/0/rancher-compose.yml index e2c9479..ab5c198 100644 --- a/templates/gitlab-multi-runner/0/rancher-compose.yml +++ b/templates/gitlab-multi-runner/0/rancher-compose.yml @@ -2,7 +2,7 @@ version: '2' catalog: name: "gitlab-multi-runner" - version: "9.4.1" + version: "9.3.0" description: "a Gitlab pipelines multi-runner, that will spawn privates runners in your infra." minimum_rancher_version: v1.5.0 # maximum_rancher_version: diff --git a/templates/gitlab-multi-runner/1/docker-compose.yml b/templates/gitlab-multi-runner/1/docker-compose.yml new file mode 100644 index 0000000..f0cabfc --- /dev/null +++ b/templates/gitlab-multi-runner/1/docker-compose.yml @@ -0,0 +1,46 @@ +version: '2' + +services: + + gitlab-runner-config: + image: gitlab/gitlab-runner:alpine-v9.4.1 + stdin_open: true + volumes: + - /etc/gitlab-runner/ + tty: true + command: + - register + - -n + - --url + - ${GITLAB_URL} + - --registration-token + - ${GITLAB_TOKEN} + - --tag-list + - ${GITLAB_TAGS} + - --executor + - docker + - --description + - Rancher Docker Runner + - --docker-image + - docker:latest + - --docker-volumes + - /var/run/docker.sock:/var/run/docker.sock + - --docker-privileged + labels: + io.rancher.container.pull_image: always + io.rancher.container.start_once: 'true' + + gitlab-runner: + image: gitlab/gitlab-runner:alpine-v9.4.1 + stdin_open: true + volumes: + - /var/run/docker.sock:/var/run/docker.sock + tty: true + volumes_from: + - gitlab-runner-config + command: + - run + labels: + io.rancher.sidekicks: gitlab-runner-config + io.rancher.container.pull_image: always + io.rancher.scheduler.global: 'true' diff --git a/templates/gitlab-multi-runner/1/rancher-compose.yml b/templates/gitlab-multi-runner/1/rancher-compose.yml new file mode 100644 index 0000000..e2c9479 --- /dev/null +++ b/templates/gitlab-multi-runner/1/rancher-compose.yml @@ -0,0 +1,37 @@ +version: '2' + +catalog: + name: "gitlab-multi-runner" + version: "9.4.1" + description: "a Gitlab pipelines multi-runner, that will spawn privates runners in your infra." + minimum_rancher_version: v1.5.0 + # maximum_rancher_version: + # upgrade_from: # The previous versions that this template can be upgraded from + questions: + - variable: "GITLAB_URL" + label: "Gitlab Url" + description: "Url to your Gitlab CI endpoint" + type: "string" + default: "https://gitlab.com/ci" + required: true + + - variable: "GITLAB_TOKEN" + label: "Gitlab Token" + description: "Token provided in you project settings" + type: "string" + default: "xxxxxxxxxxxxxxxxxxxx" + required: true + + - variable: "GITLAB_TAGS" + label: "Gitlab Tags" + description: "Tags to apply" + type: "string" + default: "dev" + required: false + +services: + gitlab-runner-config: + scale: 1 + start_on_create: true + gitlab-runner: + start_on_create: true diff --git a/templates/gitlab/0/docker-compose.yml b/templates/gitlab/0/docker-compose.yml index d1d4bb9..9422535 100644 --- a/templates/gitlab/0/docker-compose.yml +++ b/templates/gitlab/0/docker-compose.yml @@ -15,7 +15,7 @@ services: - ${https_port}:443/tcp labels: io.rancher.container.hostname_override: container_name - image: gitlab/gitlab-ce:9.4.2-ce.0 + image: gitlab/gitlab-ce:9.3.3-ce.0 volumes: - gitlab-app-data:/var/opt/gitlab - gitlab-log-data:/var/log/gitlab diff --git a/templates/gitlab/0/rancher-compose.yml b/templates/gitlab/0/rancher-compose.yml index 083028c..b382043 100644 --- a/templates/gitlab/0/rancher-compose.yml +++ b/templates/gitlab/0/rancher-compose.yml @@ -1,6 +1,6 @@ .catalog: name: Gitlab Community - version: 9.4.2-ce.0 + version: 9.3.3-ce.0 description: | Gitlab CE is a free GitHub alternative minimum_rancher_version: v0.56.0 diff --git a/templates/gitlab/1/README.md b/templates/gitlab/1/README.md new file mode 100644 index 0000000..ca11a7c --- /dev/null +++ b/templates/gitlab/1/README.md @@ -0,0 +1,9 @@ +# GitLab CE + +GitLab CE is a free alternative to GitHub + +Stack based on official GitLab version: latest + +https://hub.docker.com/r/gitlab/gitlab-ce/ + + diff --git a/templates/gitlab/1/docker-compose.yml b/templates/gitlab/1/docker-compose.yml new file mode 100644 index 0000000..d1d4bb9 --- /dev/null +++ b/templates/gitlab/1/docker-compose.yml @@ -0,0 +1,26 @@ +version: '2' +volumes: + gitlab-app-data: + driver: ${volumedriver} + gitlab-log-data: + driver: ${volumedriver} + gitlab-conf-files: + driver: ${volumedriver} + +services: + gitlab-server: + ports: + - ${ssh_port}:22/tcp + - ${http_port}:80/tcp + - ${https_port}:443/tcp + labels: + io.rancher.container.hostname_override: container_name + image: gitlab/gitlab-ce:9.4.2-ce.0 + volumes: + - gitlab-app-data:/var/opt/gitlab + - gitlab-log-data:/var/log/gitlab + - gitlab-conf-files:/etc/gitlab + environment: + GITLAB_OMNIBUS_CONFIG: | + external_url '${gitlab_omnipus_prefix}${gitlab_hostname}' + registry_external_url '${gitlab_omnipus_prefix}${registry_gitlab_hostname}' diff --git a/templates/gitlab/1/rancher-compose.yml b/templates/gitlab/1/rancher-compose.yml new file mode 100644 index 0000000..083028c --- /dev/null +++ b/templates/gitlab/1/rancher-compose.yml @@ -0,0 +1,69 @@ +.catalog: + name: Gitlab Community + version: 9.4.2-ce.0 + description: | + Gitlab CE is a free GitHub alternative + minimum_rancher_version: v0.56.0 + maintainer: "Alexis Ducastel " + uuid: gitlab-0 + questions: + - variable: "gitlab_hostname" + description: "Gitlab hostname (without uri scheme http:// or https://)" + label: "Hostname:" + required: true + default: "git.example.com" + type: "string" + - variable: "registry_gitlab_hostname" + description: "Registry Gitlab hostname (without uri scheme http:// or https://)" + label: "Registry hostname:" + required: true + default: "registry.example.com" + type: "string" + - variable: "gitlab_omnipus_prefix" + label: "Gitlab external_url prefix:" + description: | + This is needed for the docker-compose file to set the correct external_url + default: 'http://' + required: true + type: "enum" + options: + - 'http://' + - 'https://' + - variable: "http_port" + description: "HTTP port to expose on host. Will be used to bind TCP" + label: "HTTP port:" + required: true + default: 80 + type: "int" + - variable: "https_port" + description: "HTTPS port to expose on host. Will be used to bind TCP" + label: "HTTPS port:" + required: true + default: 443 + type: "int" + - variable: "ssh_port" + description: "SSH port to expose on host. Will be used to bind TCP" + label: "SSH port:" + required: true + default: 22 + type: "int" + - variable: "volumedriver" + description: "Choose the Volume Driver being used.(Option: local or rancher-nfs)" + label: "Volume Driver:" + required: true + default: local + type: "enum" + options: + - local + - rancher-nfs + +gitlab-server: + scale: 1 + retain_ip: true + health_check: + port: 80 + interval: 30000 + unhealthy_threshold: 3 + strategy: recreate + response_timeout: 2000 + healthy_threshold: 2 From 69539807d524e7b2fd1b14dcf2890b91f0c93414 Mon Sep 17 00:00:00 2001 From: Tayyeb Date: Wed, 2 Aug 2017 01:43:48 +0430 Subject: [PATCH 3/3] review fixes --- .../1/{docker-compose.yml => docker-compose.yml.tpl} | 5 +++-- templates/gitlab-multi-runner/1/rancher-compose.yml | 10 +++++++++- 2 files changed, 12 insertions(+), 3 deletions(-) rename templates/gitlab-multi-runner/1/{docker-compose.yml => docker-compose.yml.tpl} (89%) diff --git a/templates/gitlab-multi-runner/1/docker-compose.yml b/templates/gitlab-multi-runner/1/docker-compose.yml.tpl similarity index 89% rename from templates/gitlab-multi-runner/1/docker-compose.yml rename to templates/gitlab-multi-runner/1/docker-compose.yml.tpl index f0cabfc..a765ee8 100644 --- a/templates/gitlab-multi-runner/1/docker-compose.yml +++ b/templates/gitlab-multi-runner/1/docker-compose.yml.tpl @@ -27,7 +27,6 @@ services: - /var/run/docker.sock:/var/run/docker.sock - --docker-privileged labels: - io.rancher.container.pull_image: always io.rancher.container.start_once: 'true' gitlab-runner: @@ -42,5 +41,7 @@ services: - run labels: io.rancher.sidekicks: gitlab-runner-config - io.rancher.container.pull_image: always io.rancher.scheduler.global: 'true' + {{- if ne .Values.host_label ""}} + io.rancher.scheduler.affinity:host_label: ${host_label} + {{- end}} diff --git a/templates/gitlab-multi-runner/1/rancher-compose.yml b/templates/gitlab-multi-runner/1/rancher-compose.yml index e2c9479..4c737e4 100644 --- a/templates/gitlab-multi-runner/1/rancher-compose.yml +++ b/templates/gitlab-multi-runner/1/rancher-compose.yml @@ -29,9 +29,17 @@ catalog: default: "dev" required: false + - variable: "host_label" + label: "Host with Label to deploy gitlab-runner on" + description: | + Host label to use as gitlab-runner 'value' tag. + Example: 'gitlab-runner=true' + type: "string" + default: "" + required: false + services: gitlab-runner-config: - scale: 1 start_on_create: true gitlab-runner: start_on_create: true