From 15286b137d549d1bb045c270863bd7870362a16a Mon Sep 17 00:00:00 2001 From: Thomas Kooi Date: Sun, 28 May 2017 13:52:42 +0200 Subject: [PATCH 1/4] Add env variable to configure pipeline schedule worker cron job --- README.md | 1 + assets/runtime/config/gitlabhq/gitlab.yml | 2 +- assets/runtime/env-defaults | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 71f51ac8..1a6db05e 100644 --- a/README.md +++ b/README.md @@ -848,6 +848,7 @@ Below is the complete list of available options that can be used to customize yo | `GITLAB_SHARED_DIR` | The directory to store the build artifacts. Defaults to `/home/git/data/shared` | | `GITLAB_ARTIFACTS_ENABLED` | Enable/Disable GitLab artifacts support. Defaults to `true`. | | `GITLAB_ARTIFACTS_DIR` | Directory to store the artifacts. Defaults to `$GITLAB_SHARED_DIR/artifacts` | +| `GITLAB_PIPELINE_SCHEDULE_WORKER_CRON` | Cron notation for the Gitlab pipeline schedule worker. Defaults to `'0 */12 * * *'` | | `GITLAB_LFS_ENABLED` | Enable/Disable Git LFS support. Defaults to `true`. | | `GITLAB_LFS_OBJECTS_DIR` | Directory to store the lfs-objects. Defaults to `$GITLAB_SHARED_DIR/lfs-objects` | | `GITLAB_MATTERMOST_ENABLED` | Enable/Disable GitLab Mattermost for *Add Mattermost button*. Defaults to `false`. | diff --git a/assets/runtime/config/gitlabhq/gitlab.yml b/assets/runtime/config/gitlabhq/gitlab.yml index 9a223be7..3b80ca2b 100644 --- a/assets/runtime/config/gitlabhq/gitlab.yml +++ b/assets/runtime/config/gitlabhq/gitlab.yml @@ -193,7 +193,7 @@ production: &base cron: "0 * * * *" # Execute scheduled triggers pipeline_schedule_worker: - cron: "0 */12 * * *" + cron: {{GITLAB_PIPELINE_SCHEDULE_WORKER_CRON}} # Remove expired build artifacts expire_build_artifacts_worker: cron: "50 * * * *" diff --git a/assets/runtime/env-defaults b/assets/runtime/env-defaults index b7772e05..46999e24 100644 --- a/assets/runtime/env-defaults +++ b/assets/runtime/env-defaults @@ -101,6 +101,9 @@ GITLAB_WORKHORSE_TIMEOUT=${GITLAB_WORKHORSE_TIMEOUT:-5m0s} GITLAB_ARTIFACTS_ENABLED=${GITLAB_ARTIFACTS_ENABLED:-true} GITLAB_ARTIFACTS_DIR="${GITLAB_ARTIFACTS_DIR:-$GITLAB_SHARED_DIR/artifacts}" +## Cron Jobs +GITLAB_PIPELINE_SCHEDULE_WORKER_CRON=${GITLAB_PIPELINE_SCHEDULE_WORKER_CRON:-'0 */12 * * *'} + ## LFS GITLAB_LFS_ENABLED=${GITLAB_LFS_ENABLED:-true} GITLAB_LFS_OBJECTS_DIR="${GITLAB_LFS_OBJECTS_DIR:-$GITLAB_SHARED_DIR/lfs-objects}" From 53f50a977712ef99549c1e956bcf4ccfda3392f2 Mon Sep 17 00:00:00 2001 From: Glowbal Date: Thu, 8 Jun 2017 20:38:36 +0200 Subject: [PATCH 2/4] Add configure cron jobs step --- assets/runtime/functions | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/assets/runtime/functions b/assets/runtime/functions index 7d4a647f..ebd31c57 100644 --- a/assets/runtime/functions +++ b/assets/runtime/functions @@ -825,6 +825,16 @@ gitlab_configure_gravatar() { fi } +gitlab_configure_cron_jobs() { + echo "Configuring gitlab::cron_jobs..." + + if [[ -n ${GITLAB_PIPELINE_SCHEDULE_WORKER_CRON} ]]; then + update_template ${GITLAB_CONFIG} GITLAB_PIPELINE_SCHEDULE_WORKER_CRON + else + exec_as_git sed -i "/{{GITLAB_PIPELINE_SCHEDULE_WORKER_CRON}}/d" ${GITLAB_CONFIG} + fi +} + gitlab_configure_analytics_google() { if [[ -n ${GOOGLE_ANALYTICS_ID} ]]; then echo "Configuring gitlab::analytics:google..." @@ -1385,6 +1395,7 @@ configure_gitlab() { gitlab_configure_oauth gitlab_configure_ldap gitlab_configure_gravatar + gitlab_configure_cron_jobs gitlab_configure_analytics gitlab_configure_backups gitlab_configure_registry From d51f6ca40235399af5031224202a0b9fb3b9c7be Mon Sep 17 00:00:00 2001 From: Abel Tay Date: Wed, 21 Jun 2017 11:13:41 +0800 Subject: [PATCH 3/4] Update the base Ubuntu image --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index bf21ec4f..0a39265a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM sameersbn/ubuntu:14.04.20170503 +FROM sameersbn/ubuntu:14.04.20170608 MAINTAINER sameer@damagehead.com ENV GITLAB_VERSION=9.2.7 \ From ad68271db16ef8390d746e463c7b030a4b249d79 Mon Sep 17 00:00:00 2001 From: Peter Leitzen Date: Sun, 4 Jun 2017 19:56:50 +0200 Subject: [PATCH 4/4] Expose `DB_COLLATION` parameter --- README.md | 1 + assets/runtime/config/gitlabhq/database.yml | 2 +- assets/runtime/env-defaults | 1 + assets/runtime/functions | 3 +++ 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9f23f0f8..352a3ab3 100644 --- a/README.md +++ b/README.md @@ -905,6 +905,7 @@ Below is the complete list of available options that can be used to customize yo | `SIDEKIQ_MEMORY_KILLER_MAX_RSS` | Non-zero value enables the SidekiqMemoryKiller. Defaults to `1000000`. For additional options refer [Configuring the MemoryKiller](http://doc.gitlab.com/ce/operations/sidekiq_memory_killer.html) | | `DB_ADAPTER` | The database type. Possible values: `mysql2`, `postgresql`. Defaults to `postgresql`. | | `DB_ENCODING` | The database encoding. For `DB_ADAPTER` values `postresql` and `mysql2`, this parameter defaults to `unicode` and `utf8` respectively. | +| `DB_COLLATION` | The database collation. Defaults to `utf8_general_ci` for `DB_ADAPTER` `mysql2`. This parameter is not supported for `DB_ADAPTER` `postresql` and will be removed. | | `DB_HOST` | The database server hostname. Defaults to `localhost`. | | `DB_PORT` | The database server port. Defaults to `3306` for mysql and `5432` for postgresql. | | `DB_NAME` | The database database name. Defaults to `gitlabhq_production` | diff --git a/assets/runtime/config/gitlabhq/database.yml b/assets/runtime/config/gitlabhq/database.yml index 018d28a3..9cfd8037 100644 --- a/assets/runtime/config/gitlabhq/database.yml +++ b/assets/runtime/config/gitlabhq/database.yml @@ -4,7 +4,7 @@ production: adapter: {{DB_ADAPTER}} encoding: {{DB_ENCODING}} - collation: utf8_general_ci + collation: {{DB_COLLATION}} reconnect: false database: {{DB_NAME}} host: {{DB_HOST}} diff --git a/assets/runtime/env-defaults b/assets/runtime/env-defaults index b7772e05..13396e7d 100644 --- a/assets/runtime/env-defaults +++ b/assets/runtime/env-defaults @@ -34,6 +34,7 @@ NGINX_HSTS_MAXAGE=${NGINX_HSTS_MAXAGE:-31536000} ## DATABASE DB_ADAPTER=${DB_ADAPTER:-} DB_ENCODING=${DB_ENCODING:-} +DB_COLLATION=${DB_COLLATION:-} DB_HOST=${DB_HOST:-} DB_PORT=${DB_PORT:-} DB_NAME=${DB_NAME:-} diff --git a/assets/runtime/functions b/assets/runtime/functions index 7d4a647f..2b2e51df 100644 --- a/assets/runtime/functions +++ b/assets/runtime/functions @@ -150,10 +150,12 @@ gitlab_finalize_database_parameters() { case ${DB_ADAPTER} in mysql2) DB_ENCODING=${DB_ENCODING:-utf8} + DB_COLLATION=${DB_COLLATION:-utf8_general_ci} DB_PORT=${DB_PORT:-3306} ;; postgresql) DB_ENCODING=${DB_ENCODING:-unicode} + # DB_COLLATION: Not supported for postgresql and will be removed below. DB_PORT=${DB_PORT:-5432} ;; *) @@ -205,6 +207,7 @@ gitlab_configure_database() { update_template ${GITLAB_DATABASE_CONFIG} \ DB_ADAPTER \ DB_ENCODING \ + DB_COLLATION \ DB_HOST \ DB_PORT \ DB_NAME \