Commit b4c19182 authored by DJ Mountney's avatar DJ Mountney

Merge remote-tracking branch 'origin/master' into 1-7-stable

parents c1444e5e 62f7edde
Pipeline #50991452 passed with stages
in 19 minutes and 53 seconds
---
title: Add Gitaly configuration to migrations job
merge_request: 710
author:
type: fixed
---
title: Automate version mapping updates
merge_request: 704
author:
type: other
---
title: Add eks_bootstrap_script
merge_request: 706
author:
type: added
---
title: Allow use of password-less Redis services (external)
merge_request: 665
author: Vic Iglesias
type: added
......@@ -9,10 +9,13 @@ metadata:
data:
configure: |
set -e
mkdir -p /init-secrets/redis /init-secrets/gitaly /init-secrets/shell
mkdir -p /init-secrets/gitaly /init-secrets/shell
cp /init-config/.gitlab_shell_secret /init-secrets/shell/.gitlab_shell_secret
cp /init-config/gitaly_token /init-secrets/gitaly/gitaly_token
{{- if .Values.global.redis.password.enabled }}
mkdir -p /init-secrets/redis
cp /init-config/redis_password /init-secrets/redis/redis_password
{{- end }}
config.toml.erb: |
# The directory where Gitaly's executables are stored
bin_dir = "/usr/local/bin"
......@@ -59,7 +62,9 @@ data:
redis:
host: {{ template "gitlab.redis.host" . }}
port: {{ template "gitlab.redis.port" . }}
{{- if .Values.global.redis.password.enabled }}
pass: "<%= File.read("/etc/gitlab-secrets/redis/redis_password") %>"
{{- end }}
database: nil
namespace: resque:gitlab
......
......@@ -148,11 +148,13 @@ spec:
items:
- key: {{ template "gitlab.gitlab-shell.authToken.key" . }}
path: ".gitlab_shell_secret"
{{- if .Values.global.redis.password.enabled }}
- secret:
name: {{ template "gitlab.redis.password.secret" . }}
items:
- key: {{ template "gitlab.redis.password.key" . }}
path: redis_password
{{- end }}
{{- if .Values.nodeSelector }}
nodeSelector:
{{ toYaml .Values.nodeSelector | indent 8 }}
......
......@@ -8,7 +8,7 @@ metadata:
{{ include "gitlab.standardLabels" . | indent 4 }}
data:
configure: |
{{- include "gitlab.scripts.configure.secrets" (dict "required" "redis shell" ) | nindent 4 -}}
{{- include "gitlab.scripts.configure.secrets" (dict "required" "shell" ) | nindent 4 -}}
mkdir -p /${secret_dir}/ssh
cp /${config_dir}/ssh_host_* /${secret_dir}/ssh/
chmod 0400 /${secret_dir}/ssh/ssh_host_*
......@@ -31,7 +31,9 @@ data:
redis:
host: {{ template "gitlab.redis.host" . }}
port: {{ template "gitlab.redis.port" . }}
{{- if .Values.global.redis.password.enabled }}
pass: "<%= File.read("/etc/gitlab-secrets/redis/password") %>"
{{- end }}
database: nil
namespace: resque:gitlab
......
......@@ -121,11 +121,13 @@ spec:
items:
- key: {{ template "gitlab.gitlab-shell.authToken.key" . }}
path: shell/.gitlab_shell_secret
{{- if .Values.global.redis.password.enabled }}
- secret:
name: {{ template "gitlab.redis.password.secret" . }}
items:
- key: {{ template "gitlab.redis.password.key" . }}
path: redis/password
{{- end }}
# Actual config dirs that will be used in the container
- name: shell-secrets
emptyDir:
......
......@@ -29,12 +29,9 @@ data:
:worker: EmailReceiverWorker
:arbitration_method: redis
:arbitration_options:
:redis_url: {{ template "gitlab.redis.scheme" . }}://:<%= File.read("/etc/gitlab/redis/password") %>@{{ template "gitlab.redis.host" . }}:{{ template "gitlab.redis.port" . }}
:redis_url: {{ template "gitlab.redis.url" . }}
:namespace: mail_room:gitlab
configure: |
set -e
mkdir -p /init-secrets/redis /init-secrets/mailroom
cp /init-config/redis/password /init-secrets/redis/password
cp /init-config/mailroom/password /init-secrets/mailroom/password
{{- include "gitlab.scripts.configure.secrets" (dict "required" "mailroom" "optional" "redis") | nindent 4 }}
# Leave this here - This line denotes end of block to the parser.
{{- end }}
......@@ -106,11 +106,13 @@ spec:
projected:
defaultMode: 0400
sources:
{{- if .Values.global.redis.password.enabled }}
- secret:
name: {{ template "gitlab.redis.password.secret" . }}
items:
- key: {{ template "gitlab.redis.password.key" . }}
path: redis/password
{{- end }}
- secret:
name: {{ .Values.global.appConfig.incomingEmail.password.secret | required "Missing required secret containing the IMAP password for incoming email. Make sure to set `global.appConfig.incomingEmail.password.secret`" }}
items:
......
......@@ -91,11 +91,18 @@ spec:
items:
- key: secrets.yml
path: rails-secrets/secrets.yml
- secret:
name: {{ template "gitlab.gitaly.authToken.secret" . }}
items:
- key: {{ template "gitlab.gitaly.authToken.key" . }}
path: gitaly/gitaly_token
{{- if .Values.global.redis.password.enabled }}
- secret:
name: {{ template "gitlab.redis.password.secret" . }}
items:
- key: {{ template "gitlab.redis.password.key" . }}
path: redis/password
{{- end }}
- secret:
name: {{ template "gitlab.psql.password.secret" . }}
items:
......
......@@ -25,18 +25,15 @@ data:
resque.yml.erb: |
production:
# Redis (single instance)
url: {{ template "gitlab.redis.scheme" . }}://:<%= File.read("/etc/gitlab/redis/password") %>@{{ template "gitlab.redis.host" . }}:{{ template "gitlab.redis.port" . }}
url: {{ template "gitlab.redis.url" . }}
id:
gitlab.yml: |
gitlab.yml.erb: |
production: &base
gitlab:
repositories:
storages:
default:
path: /var/opt/gitlab/repo
gitaly_address: tcp://localhost:8075
{{ include "gitlab.appConfig.gitaly" . | indent 6 }}
{{ include "gitlab.appConfig.repositories" . | indent 6 }}
configure: |
{{- include "gitlab.scripts.configure.secrets" (dict "required" "redis postgres rails-secrets migrations" ) | nindent 4 -}}
{{- include "gitlab.scripts.configure.secrets" (dict "required" "postgres rails-secrets migrations gitaly") | nindent 4 -}}
{{- include "gitlab.psql.ssl.initScript" . | nindent 4 }}
{{- if .Values.global.operator.enabled }}
---
......
......@@ -18,6 +18,13 @@ enabled: true
initialRootPassword: {}
redis:
password: {}
gitaly:
# host: '0.0.0.0'
# port: 8075
# serviceName: 'gitaly'
authToken: {}
# secret: gitaly-secret
# key: token
global:
# imagePullPolicy: IfNotPresent
psql: {}
......@@ -35,6 +42,11 @@ global:
# serverCA: server-ca.pem
redis:
password: {}
gitaly:
internal:
names: ["default"]
external: []
authToken: {}
resources:
requests:
cpu: 50m
......
......@@ -29,7 +29,7 @@ data:
resque.yml.erb: |
production:
# Redis (single instance)
url: {{ template "gitlab.redis.scheme" . }}://:<%= File.read("/etc/gitlab/redis/password") %>@{{ template "gitlab.redis.host" . }}:{{ template "gitlab.redis.port" . }}
url: {{ template "gitlab.redis.url" . }}
id:
gitlab.yml.erb: |
production: &base
......@@ -105,7 +105,7 @@ data:
port: {{ .Values.metrics.port }}
{{- end }}
configure: |
{{- include "gitlab.scripts.configure.secrets" (dict "required" "redis gitaly registry postgres rails-secrets" ) | nindent 4 -}}
{{- include "gitlab.scripts.configure.secrets" (dict "required" "gitaly registry postgres rails-secrets") | nindent 4 -}}
{{- include "gitlab.psql.ssl.initScript" . | nindent 4 }}
# Leave this here - This line denotes end of block to the parser.
{{- end }}
......@@ -239,11 +239,13 @@ spec:
items:
- key: {{ $gitalyKey }}
path: gitaly/gitaly_token
{{- if $.Values.global.redis.password.enabled }}
- secret:
name: {{ $redisSecret }}
items:
- key: {{ $redisKey }}
path: redis/password
{{- end }}
- secret:
name: {{ template "gitlab.psql.password.secret" $ }}
items:
......
......@@ -21,7 +21,7 @@ data:
resque.yml.erb: |
production:
# Redis (single instance)
url: {{ template "gitlab.redis.scheme" . }}://:<%= File.read("/etc/gitlab/redis/password") %>@{{ template "gitlab.redis.host" . }}:{{ template "gitlab.redis.port" . }}
url: {{ template "gitlab.redis.url" . }}
gitlab.yml.erb: |
production: &base
gitlab:
......@@ -73,7 +73,7 @@ data:
## Registry Integration
{{- include "gitlab.appConfig.registry.configuration" $ | nindent 6 }}
configure: |
{{- include "gitlab.scripts.configure.secrets" (dict "required" "redis shell gitaly registry postgres rails-secrets") | nindent 4 -}}
{{- include "gitlab.scripts.configure.secrets" (dict "required" "shell gitaly registry postgres rails-secrets") | nindent 4 -}}
{{- include "gitlab.psql.ssl.initScript" . | nindent 4 }}
if [ ! -f "/${secret_dir}/objectstorage/.s3cfg" ]; then
......
......@@ -122,11 +122,13 @@ spec:
items:
- key: {{ template "gitlab.gitaly.authToken.key" . }}
path: gitaly/gitaly_token
{{- if .Values.global.redis.password.enabled }}
- secret:
name: {{ template "gitlab.redis.password.secret" . }}
items:
- key: {{ template "gitlab.redis.password.key" . }}
path: redis/password
{{- end }}
- secret:
name: {{ template "gitlab.psql.password.secret" . }}
items:
......
......@@ -29,7 +29,7 @@ data:
resque.yml.erb: |
production:
# Redis (single instance)
url: {{ template "gitlab.redis.scheme" . }}://:<%= File.read("/etc/gitlab/redis/password") %>@{{ template "gitlab.redis.host" . }}:{{ template "gitlab.redis.port" . }}
url: {{ template "gitlab.redis.url" . }}
id:
unicorn.rb: |
worker_processes {{ .Values.workerProcesses }}
......@@ -148,12 +148,16 @@ data:
workhorse-config.toml.erb: |
[redis]
URL = "{{ template "gitlab.redis.scheme" . }}://{{ template "gitlab.redis.host" . }}:{{ template "gitlab.redis.port" . }}"
{{- if .Values.global.redis.password.enabled }}
Password = "<%= File.read("/etc/gitlab/redis/password") %>"
{{- end }}
configure: |
set -e
mkdir -p /init-secrets-workhorse/gitlab-workhorse
cp /init-config/gitlab-workhorse/secret /init-secrets-workhorse/gitlab-workhorse/secret
{{- if .Values.global.redis.password.enabled }}
mkdir -p /init-secrets-workhorse/redis
cp /init-config/redis/password /init-secrets-workhorse/redis/
{{- end }}
# Leave this here - This line denotes end of block to the parser.
{{- end }}
......@@ -249,11 +249,13 @@ spec:
items:
- key: {{ template "gitlab.gitaly.authToken.key" . }}
path: gitaly/gitaly_token
{{- if .Values.global.redis.password.enabled }}
- secret:
name: {{ template "gitlab.redis.password.secret" . }}
items:
- key: {{ template "gitlab.redis.password.key" . }}
path: redis/password
{{- end }}
- secret:
name: {{ template "gitlab.psql.password.secret" . }}
items:
......
......@@ -11,11 +11,11 @@ set -e
config_dir="/init-config"
secret_dir="/init-secrets"
for secret in {{ default "redis shell gitaly registry postgres rails-secrets gitlab-workhorse" $.required }} ; do
for secret in {{ default "shell gitaly registry postgres rails-secrets gitlab-workhorse" $.required }} ; do
mkdir -p "${secret_dir}/${secret}"
cp -v -r "${config_dir}/${secret}/." "${secret_dir}/${secret}/"
done
for secret in {{ default "minio objectstorage ldap omniauth smtp" $.optional }} ; do
for secret in {{ default "redis minio objectstorage ldap omniauth smtp" $.optional }} ; do
if [ -e "${config_dir}/${secret}" ]; then
mkdir -p "${secret_dir}/${secret}"
cp -v -r "${config_dir}/${secret}/." "${secret_dir}/${secret}/"
......
......@@ -35,3 +35,10 @@ Return the redis scheme, or redis. Allowing people to use rediss clusters
{{ cat "Invalid redis scheme" $name | fail }}
{{- end -}}
{{- end -}}
{{/*
Return the redis url.
*/}}
{{- define "gitlab.redis.url" -}}
{{ template "gitlab.redis.scheme" . }}://{{- if .Values.global.redis.password.enabled -}}:<%= File.read("/etc/gitlab/redis/password") %>@{{- end -}}{{ template "gitlab.redis.host" . }}:{{ template "gitlab.redis.port" . }}
{{- end -}}
......@@ -32,7 +32,9 @@ function generate_secret_if_needed(){
generate_secret_if_needed {{ template "gitlab.migrations.initialRootPassword.secret" . }} --from-literal={{ template "gitlab.migrations.initialRootPassword.key" . }}=$(gen_random 'a-zA-Z0-9' 64)
# Redis password
{{if .Values.global.redis.password.enabled -}}
generate_secret_if_needed {{ template "gitlab.redis.password.secret" . }} --from-literal={{ template "gitlab.redis.password.key" . }}=$(gen_random 'a-zA-Z0-9' 64)
{{ end }}
{{if not .Values.global.psql.host -}}
# Postgres password
......
......@@ -12,6 +12,7 @@ Disable the `redis` chart and the Redis service it provides, and point the other
You need to set the following parameters:
* `redis.enabled`: Set to `false` to disable the included Redis chart.
* `global.redis.host`: Set to the hostname of the external Redis, can be a domain or an IP address.
* `global.redis.password.enabled`: Set to `false` if the external Redis does not require a password.
* `global.redis.password.secret`: The name of the [secret which contains the token for authentication][redis-secret].
* `global.redis.password.key`: The key within the secret, which contains the token content.
......
......@@ -143,6 +143,7 @@ redis:
serviceName: redis
port: 6379
password:
enabled: true
secret: gitlab-redis
key: redis-password
```
......@@ -152,8 +153,9 @@ redis:
| `host` | String | | The hostname of the Redis server with the database to use. This can be omitted in lieu of `serviceName`. |
| `serviceName` | String | `redis` | The name of the `service` which is operating the Redis database. If this is present, and `host` is not, the chart will template the hostname of the service (and current `.Release.Name`) in place of the `host` value. This is convenient when using Redis as a part of the overall GitLab chart. |
| `port` | Integer | `6379` | The port on which to connect to the Redis server. |
| `password.key` | String | | The `password.key` attribute for PostgreSQL defines the name of the key in the secret (below) that contains the password. |
| `password.secret` | String | | The `password.secret` attribute for PostgreSQL defines the name of the kubernetes `Secret` to pull from. |
| `password.key` | String | | The `password.key` attribute for Redis defines the name of the key in the secret (below) that contains the password. |
| `password.secret` | String | | The `password.secret` attribute for Redis defines the name of the kubernetes `Secret` to pull from. |
| `password.enabled`| Bool | true | The `password.enabled` provides a toggle for using a password with the Redis instance. |
### PostgreSQL
......
......@@ -159,6 +159,7 @@ global:
host: redis.example.com
port: 6379
password:
enabled: true
secret: gitlab-redis
key: redis-password
```
......
......@@ -5,6 +5,54 @@ deploying the `gitlab` chart.
## Creating the EKS cluster
To get started easier, a script is provided to automate the cluster creation.
Alternatively, a cluster can be created manually as well.
### Scripted cluster creation
A [bootstrap script](https://gitlab.com/charts/gitlab/blob/master/scripts/eks_bootstrap_script)
has been created to automate much of the setup process for users on EKS.
The script will:
1. Create a new EKS cluster.
1. Setup `kubectl`, and connect it to the cluster.
1. Initialize Helm and install Tiller.
The script uses [eksctl](https://eksctl.io) to initialize the cluster. If it cannot locate it in your PATH, it will install it
to a temporary location.
To authenticate, eksctl uses the same options as the aws command line. See the AWS documentation for how to
use [environment variables](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-envvars.html), or [configuration files](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html).
The script reads various parameters from environment variables, or command line arguments and an argument
`up` or `down` for bootstrap and clean up respectively.
The table below describes all variables.
| Variable | Description | Default value |
|-----------------|-----------------------------------------------------------------------------|----------------------------------|
| REGION | The region where your cluster lives | us-east-2 |
| CLUSTER_NAME | The name of the cluster | gitlab-cluster |
| CLUSTER_VERSION | The version of your EKS cluster | 1.10 |
| NUM_NODES | The number of nodes required | 2 |
| MACHINE_TYPE | The type of nodes to deploy | m5.xlarge |
| SERVICE_ACCOUNT | The service account name to use for helm/tilller | tiller |
Run the script, by passing in your desired parameters. It can work with the
default parameters.
```bash
./scripts/eks_bootstrap_script up
```
The script can also be used to clean up the created EKS resources:
```bash
./scripts/eks_bootstrap_script down
```
### Manual cluster creation
For the most up to date instructions, follow Amazon's
[EKS getting started guide](https://docs.aws.amazon.com/eks/latest/userguide/getting-started.html).
......
......@@ -88,7 +88,7 @@ installations on OpenShift:
1. Create the service account and `rolebinding` for RBAC and [install Tiller](../tools.md#helm):
```bash
kubectl create -f https://gitlab.com/charts/gitlab/raw/master/doc/helm/examples/rbac-config.yaml
kubectl create -f https://gitlab.com/charts/gitlab/raw/master/doc/installation/examples/rbac-config.yaml
helm init --service-account tiller
```
......
......@@ -35,4 +35,4 @@ gitlab/gitlab 1.4.1 11.6.2
Read more about our charts versioning [here](https://gitlab.com/charts/gitlab/blob/master/doc/development/release.md#chart-versioning)
Check the [releases documentation](../releases/index.md) for information on important releases,
and see the [changelog](https://gitlab.com/charts/gitlab/blob/master/CHANGELOG.md) for the full details on any release.
and see the [changelog](https://gitlab.com/charts/gitlab/blob/master/CHANGELOG.md) for the full details on any release.
......@@ -2,6 +2,29 @@
# Checks that appropriate gke params are set and
# that gcloud and kubectl are properly installed and authenticated
function need_tool(){
local tool="${1}"
local url="${2}"
echo >&2 "${tool} is required. Please follow ${url}"
exit 1
}
function need_gcloud(){
need_tool "gcloud" "https://cloud.google.com/sdk/downloads"
}
function need_kubectl(){
need_tool "kubectl" "https://kubernetes.io/docs/tasks/tools/install-kubectl"
}
function need_helm(){
need_tool "helm" "https://github.com/kubernetes/helm/blob/master/docs/install.md"
}
function need_eksctl(){
need_tool "eksctl" "https://exkctl.io"
}
function validate_required_tools(){
if [ -z "$PROJECT" ]; then
......@@ -9,9 +32,10 @@ function validate_required_tools(){
exit 1;
fi
command -v gcloud >/dev/null 2>&1 || { echo >&2 "gcloud is required please follow: https://cloud.google.com/sdk/downloads"; exit 1; }
command -v kubectl >/dev/null 2>&1 || { echo >&2 "kubectl is required please follow: https://kubernetes.io/docs/tasks/tools/install-kubectl"; exit 1; }
command -v helm >/dev/null 2>&1 || { echo >&2 "helm is required please follow: https://github.com/kubernetes/helm/blob/master/docs/install.md"; exit 1; }
for comm in gcloud kubectl helm
do
command -v "${comm}" > /dev/null 2>&1 || "need_${comm}"
done
gcloud container clusters list >/dev/null 2>&1 || { echo >&2 "Gcloud seems to be configured incorrectly or authentication is unsuccessfull"; exit 1; }
......@@ -20,3 +44,10 @@ function validate_required_tools(){
function cluster_admin_password_gke(){
gcloud container clusters describe $CLUSTER_NAME --zone $ZONE --project $PROJECT --format='value(masterAuth.password)';
}
function validate_eks_required_tools(){
for comm in eksctl kubectl helm
do
command -v "${comm}" > /dev/null 2>&1 || "need_${comm}"
done
}
#!/bin/sh
# This script will
# 1. create an EKS cluster
# 2. create an external IP
# 3. add a context to $HOME/.kube/config
# 5. Install tiller with a dedicated service account
set -e
# MacOS does not support readlink, but it does have perl
KERNEL_NAME=$(uname -s)
if [ "${KERNEL_NAME}" = "Darwin" ]; then
SCRIPT_PATH=$(perl -e 'use Cwd "abs_path";use File::Basename;print dirname(abs_path(shift))' "$0")
else
SCRIPT_PATH=$(dirname "$(readlink -f "$0")")
fi
source "${SCRIPT_PATH}/common.sh"
# Set default values
cluster_name=${CLUSTER_NAME-gitlab-cluster}
nodes=${NUM_NODES-2}
kubernetes_version=${CLUSTER_VERSION-1.10}
region="${REGION-us-east-2}"
node_type="${MACHINE_TYPE-m5.xlarge}"
service_account="${SERVICE_ACCOUNT-tiller}"
function print_help(){
cat <<EOF
Usage: ${0} ARGS (up|down)
-c NAME - Name of the cluster to use. Defaults to gitlab-cluster
-n NODES - number of nodes to use. Defaults to 2
-k VERSION - Kubernetes version to use. Defaults to 1.10
-r REGION - Region to install the cluster in. Defaults to us-east-2
-m TYPE - Type of nodes to use. Default m5.xlarge
-s SA - Service account to use for helm/tiller. Default tiller
up - create a cluster
down - delete a cluster
list - display information about running clusters
EOF
}
function do_up(){
local cluster_name="${1}"
local nodes="${2}"
local kubernetes_version="${3}"
local region="${4}"
local node_type="${5}"
local sa="${6}"
eksctl create cluster --name="${cluster_name}" --nodes="${nodes}" --version="${kubernetes_version}" --region="${region}" --node-type="${node_type}"
kubectl create serviceaccount "${sa}" --namespace kube-system
kubectl create clusterrolebinding "${sa}" --clusterrole=cluster-admin --serviceaccount="kube-system:${sa}"
helm init --service-account "${sa}"
}
function do_down(){
local cluster_name="${1}"
local region="${2}"
eksctl delete cluster --wait --region "${region}" --name ${cluster_name}
}
function do_list(){
local cluster_name="${1}"
local region="${2}"
eksctl get cluster -r "${region}" "${cluster_name}"
}
while getopts c:n:kr:m:s: opt
do
case "${opt}" in
c)
cluster_name="${OPTARG}"
;;
n)
nodes="${OPTARG}"
;;
k)
kubernetes_version="${OPTARG}"
;;
m)
node_type="${OPTARG}"
;;
r)
region="${OPTARG}"
;;
s)
service_account="${OPTARG}"
;;
[?])
print_help
;;
esac
done
shift $((OPTIND -1))
validate_eks_required_tools
# Ensure we can connect to aws
if ! eksctl get cluster -v 0 > /dev/null
then
>&2 echo "Cannot connect to AWS. Ensure credentials are configured"
exit 1
fi
case ${1} in
up)
do_up "${cluster_name}" "${nodes}" "${kubernetes_version}" "${region}" "${node_type}" "${service_account}"
;;
down)
do_down "${cluster_name}" "${region}"
;;
list)
do_list "${2}" "${region}"
;;
*)
print_help
exit 1
esac
......@@ -4,40 +4,44 @@ require 'open-uri'
require 'uri'
class VersionFetcher
class << self
def initialize(version, repo)
@version = Version.new(version)
@repo = repo
end
# GitLab Shell Version
def gitlab_shell(version)
return version if version == 'master'
# GitLab Shell Version
def gitlab_shell
return @version if @version == 'master'
new_version = URI.parse("https://gitlab.com/gitlab-org/gitlab-ee/raw/#{ref(version)}/GITLAB_SHELL_VERSION").read.strip
$stdout.puts "# Shell appVersion: #{new_version}"
new_version
end
url = "#{@repo}/raw/#{ref(@version)}/GITLAB_SHELL_VERSION"
new_version = URI.parse(url).read.strip
$stdout.puts "# Shell appVersion: #{new_version}"
new_version
end
# Gitaly Version
def gitaly(version)
return version if version == 'master'
# Gitaly Version
def gitaly
return @version if @version == 'master'
new_version = URI.parse("https://gitlab.com/gitlab-org/gitlab-ee/raw/#{ref(version)}/GITALY_SERVER_VERSION").read.strip
$stdout.puts "# Gitaly appVersion: #{new_version}"
new_version
end
url = "#{@repo}/raw/#{ref(@version)}/GITALY_SERVER_VERSION"
new_version = URI.parse(url).read.strip
$stdout.puts "# Gitaly appVersion: #{new_version}"
new_version
end
def fetch(chart_name, ref)
chart_name = chart_name.tr('-', '_').to_sym
return ref unless respond_to?(chart_name)
Version.new(send(chart_name, ref)) if ref
end
def fetch(chart_name)
chart_name = chart_name.tr('-', '_').to_sym
return @version unless respond_to?(chart_name)
Version.new(send(chart_name)) if @version
end
private
private
def ref(version)
if version.valid?
version.tag(ee: true)
else
version.to_s
end
def ref(version)
if version.valid?
version.tag(ee: true)
else
version.to_s
end
end
end
require_relative 'version'
class VersionMapping
class Document
TABLE_HEADER = '| Chart version | GitLab version |'.freeze
TABLE_DIVIDE = '|---------------|----------------|'.freeze
def initialize(filepath)