Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
343e8343
Commit
343e8343
authored
Apr 01, 2019
by
Tiger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add required variables to Jobs/Build.gitlab-ci.yml
parent
04d91f94
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
11 deletions
+20
-11
lib/gitlab/ci/templates/Jobs/Build.gitlab-ci.yml
lib/gitlab/ci/templates/Jobs/Build.gitlab-ci.yml
+8
-0
lib/gitlab/ci/templates/Jobs/Deploy.gitlab-ci.yml
lib/gitlab/ci/templates/Jobs/Deploy.gitlab-ci.yml
+12
-11
No files found.
lib/gitlab/ci/templates/Jobs/Build.gitlab-ci.yml
View file @
343e8343
...
@@ -4,6 +4,14 @@ build:
...
@@ -4,6 +4,14 @@ build:
services
:
services
:
-
docker:stable-dind
-
docker:stable-dind
script
:
script
:
-
|
if [[ -z "$CI_COMMIT_TAG" ]]; then
export CI_APPLICATION_REPOSITORY=${CI_APPLICATION_REPOSITORY:-$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG}
export CI_APPLICATION_TAG=${CI_APPLICATION_TAG:-$CI_COMMIT_SHA}
else
export CI_APPLICATION_REPOSITORY=${CI_APPLICATION_REPOSITORY:-$CI_REGISTRY_IMAGE}
export CI_APPLICATION_TAG=${CI_APPLICATION_TAG:-$CI_COMMIT_TAG}
fi
-
/build/build.sh
-
/build/build.sh
only
:
only
:
-
branches
-
branches
...
...
lib/gitlab/ci/templates/Jobs/Deploy.gitlab-ci.yml
View file @
343e8343
...
@@ -245,13 +245,6 @@ rollout 100%:
...
@@ -245,13 +245,6 @@ rollout 100%:
[[ "$TRACE" ]] && set -x
[[ "$TRACE" ]] && set -x
auto_database_url=postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${CI_ENVIRONMENT_SLUG}-postgres:5432/${POSTGRES_DB}
auto_database_url=postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${CI_ENVIRONMENT_SLUG}-postgres:5432/${POSTGRES_DB}
export DATABASE_URL=${DATABASE_URL-$auto_database_url}
export DATABASE_URL=${DATABASE_URL-$auto_database_url}
if [[ -z "$CI_COMMIT_TAG" ]]; then
export CI_APPLICATION_REPOSITORY=$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG
export CI_APPLICATION_TAG=$CI_COMMIT_SHA
else
export CI_APPLICATION_REPOSITORY=$CI_REGISTRY_IMAGE
export CI_APPLICATION_TAG=$CI_COMMIT_TAG
fi
export TILLER_NAMESPACE=$KUBE_NAMESPACE
export TILLER_NAMESPACE=$KUBE_NAMESPACE
# Extract "MAJOR.MINOR" from CI_SERVER_VERSION and generate "MAJOR-MINOR-stable" for Security Products
# Extract "MAJOR.MINOR" from CI_SERVER_VERSION and generate "MAJOR-MINOR-stable" for Security Products
...
@@ -337,6 +330,14 @@ rollout 100%:
...
@@ -337,6 +330,14 @@ rollout 100%:
percentage="${2:-100}"
percentage="${2:-100}"
name=$(deploy_name "$track")
name=$(deploy_name "$track")
if [[ -z "$CI_COMMIT_TAG" ]]; then
image_repository=${CI_APPLICATION_REPOSITORY:-$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG}
image_tag=${CI_APPLICATION_TAG:-$CI_COMMIT_SHA}
else
image_repository=${CI_APPLICATION_REPOSITORY:-$CI_REGISTRY_IMAGE}
image_tag=${CI_APPLICATION_TAG:-$CI_COMMIT_TAG}
fi
replicas="1"
replicas="1"
service_enabled="true"
service_enabled="true"
postgres_enabled="$POSTGRES_ENABLED"
postgres_enabled="$POSTGRES_ENABLED"
...
@@ -374,8 +375,8 @@ rollout 100%:
...
@@ -374,8 +375,8 @@ rollout 100%:
--set gitlab.app="$CI_PROJECT_PATH_SLUG" \
--set gitlab.app="$CI_PROJECT_PATH_SLUG" \
--set gitlab.env="$CI_ENVIRONMENT_SLUG" \
--set gitlab.env="$CI_ENVIRONMENT_SLUG" \
--set releaseOverride="$CI_ENVIRONMENT_SLUG" \
--set releaseOverride="$CI_ENVIRONMENT_SLUG" \
--set image.repository="$
CI_APPLICATION_REPOSITORY
" \
--set image.repository="$
image_repository
" \
--set image.tag="$
CI_APPLICATION_TAG
" \
--set image.tag="$
image_tag
" \
--set image.pullPolicy=IfNotPresent \
--set image.pullPolicy=IfNotPresent \
--set image.secrets[0].name="$secret_name" \
--set image.secrets[0].name="$secret_name" \
--set application.track="$track" \
--set application.track="$track" \
...
@@ -413,8 +414,8 @@ rollout 100%:
...
@@ -413,8 +414,8 @@ rollout 100%:
--set gitlab.app="$CI_PROJECT_PATH_SLUG" \
--set gitlab.app="$CI_PROJECT_PATH_SLUG" \
--set gitlab.env="$CI_ENVIRONMENT_SLUG" \
--set gitlab.env="$CI_ENVIRONMENT_SLUG" \
--set releaseOverride="$CI_ENVIRONMENT_SLUG" \
--set releaseOverride="$CI_ENVIRONMENT_SLUG" \
--set image.repository="$
CI_APPLICATION_REPOSITORY
" \
--set image.repository="$
image_repository
" \
--set image.tag="$
CI_APPLICATION_TAG
" \
--set image.tag="$
image_tag
" \
--set image.pullPolicy=IfNotPresent \
--set image.pullPolicy=IfNotPresent \
--set image.secrets[0].name="$secret_name" \
--set image.secrets[0].name="$secret_name" \
--set application.track="$track" \
--set application.track="$track" \
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment