From 8b4565040ea5df9f0a3548374d74d4ddc3447631 Mon Sep 17 00:00:00 2001 From: DJ Mountney Date: Sun, 22 Aug 2021 08:04:10 -0700 Subject: [PATCH] Update GitLab to the 14.2.0 Feature Release --- Dockerfile | 2 +- README.md | 2 +- build-scripts/build.sh | 2 +- hardening_manifest.yaml | 8 +++--- scripts/set-config | 57 ++++++++++++++++++++++++----------------- 5 files changed, 40 insertions(+), 31 deletions(-) diff --git a/Dockerfile b/Dockerfile index edafb46..185d364 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -ARG GITLAB_VERSION=v14.1.2-ubi8 +ARG GITLAB_VERSION=v14.2.0-ubi8 ARG BASE_REGISTRY=nexus-docker-secure.levelup-nexus.svc.cluster.local:18082 ARG BASE_IMAGE=redhat/ubi/ubi8 diff --git a/README.md b/README.md index 0bf1e9c..d7ed0be 100644 --- a/README.md +++ b/README.md @@ -28,5 +28,5 @@ Some of the GitLab containers are build on top of previous containers, building * gitaly - Phase 4 * gitlab-sidekiq - * gitlab-task-runner + * gitlab-toolbox * gitlab-webservice diff --git a/build-scripts/build.sh b/build-scripts/build.sh index 7af2eaf..5e50aec 100755 --- a/build-scripts/build.sh +++ b/build-scripts/build.sh @@ -4,7 +4,7 @@ set -euxo pipefail -TAG=${1:-14.1.2} +TAG=${1:-14.2.0} REPOSITORY=${2:-} DOCKER_OPTS=${DOCKER_OPTS:-""} diff --git a/hardening_manifest.yaml b/hardening_manifest.yaml index f4d454f..102f241 100644 --- a/hardening_manifest.yaml +++ b/hardening_manifest.yaml @@ -5,7 +5,7 @@ name: "gitlab/gitlab/gitlab-ruby" # The most specific version should be the first tag and will be shown # on ironbank.dsop.io tags: - - "14.1.2" + - "14.2.0" - "latest" # Build args passed to Dockerfile ARGs args: @@ -22,7 +22,7 @@ labels: org.opencontainers.image.url: "https://about.gitlab.com/" ## Name of the distributing entity, organization or individual org.opencontainers.image.vendor: "Gitlab" - org.opencontainers.image.version: "14.1.2" + org.opencontainers.image.version: "14.2.0" ## Keywords to help with search (ex. "cicd,gitops,golang") mil.dso.ironbank.image.keywords: "gitlab, git, gitops" ## This value can be "opensource" or "commercial" @@ -43,8 +43,8 @@ maintainers: username: "alfontaine" email: "alan.fontaine@centauricorp.com" resources: - - url: "https://gitlab-ubi.s3.amazonaws.com/ubi8-build-dependencies-v14.1.2-ubi8/gitlab-ruby.tar.gz" + - url: "https://gitlab-ubi.s3.amazonaws.com/ubi8-build-dependencies-v14.2.0-ubi8/gitlab-ruby.tar.gz" filename: "gitlab-ruby.tar.gz" validation: type: "sha256" - value: "029746fba5789266d84bccce7cccc60e689d8106034e0b209599df7e73426340" + value: "20058687f2e64f4fab53806017b2677e11c24713453aa55e0303e58bb3abf4a0" diff --git a/scripts/set-config b/scripts/set-config index f53bcc5..7326429 100755 --- a/scripts/set-config +++ b/scripts/set-config @@ -1,32 +1,41 @@ -#!/usr/bin/env ruby +#!/bin/bash -require 'erb' -require 'fileutils' -require 'yaml' -require 'json' +set -eo pipefail -template_directory = ARGV.shift -config_directory = ARGV.shift || template_directory +TEMPLATE_DIRECTORY="$1" +CONFIG_DIRECTORY="${2:-$1}" -unless template_directory - puts 'usage: set-config []' +if [ -z "$TEMPLATE_DIRECTORY" ]; then + echo 'usage: set-config []' exit 1 -end +fi -puts "Begin parsing .erb files from #{template_directory}" +shopt -s nullglob # Don't enter empty for loops -Dir.glob(File.join(template_directory, '*.erb')).each do |file| - output_file = File.join(config_directory, File.basename(file, '.erb')) - puts "Writing #{output_file}" - template = ERB.new(File.read(file)) - File.write(output_file, template.result) -end +if command -v erb &> /dev/null; then + echo "Begin parsing .erb templates from $TEMPLATE_DIRECTORY" + for template in ${TEMPLATE_DIRECTORY}/*.erb; do + output_file="${CONFIG_DIRECTORY}/$(basename $template '.erb')" + echo "Writing $output_file" + erb -U -r yaml -r json -r fileutils "$template" > "$output_file" + done +fi -if config_directory != template_directory - puts "Copying other config files found in #{template_directory}" +if command -v gomplate &> /dev/null; then + echo "Begin parsing .tpl templates from $TEMPLATE_DIRECTORY" + for template in ${TEMPLATE_DIRECTORY}/*.tpl; do + output_file="${CONFIG_DIRECTORY}/$(basename $template '.tpl')" + echo "Writing $output_file" + gomplate --file "$template" --out "$output_file" + done +fi - Dir.glob(File.join(template_directory, '*.{yml,yaml,toml,rb,json}')).each do |file| - puts "Copying #{File.basename(file)} into #{config_directory}" - FileUtils.cp(file, config_directory) - end -end +if [ "$CONFIG_DIRECTORY" != "$TEMPLATE_DIRECTORY" ]; then + echo "Copying other config files found in $TEMPLATE_DIRECTORY to $CONFIG_DIRECTORY" + for configfile in ${TEMPLATE_DIRECTORY}/*.{yml,yaml,toml,rb,json}; do + echo "Copying $(basename $configfile) into ${CONFIG_DIRECTORY}" + cp "$configfile" "$CONFIG_DIRECTORY/" + done +fi + +shopt -u nullglob -- GitLab