Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cern-drupal-distribution
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
drupal
paas
cern-drupal-distribution
Commits
2d5eb11a
Commit
2d5eb11a
authored
3 months ago
by
Lorenzo Del Pianta
Browse files
Options
Downloads
Patches
Plain Diff
Changing builder image in ci pipeline
parent
4835fb3e
No related branches found
No related tags found
1 merge request
!273
Changing builder image in ci pipeline
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+10
-7
10 additions, 7 deletions
.gitlab-ci.yml
with
10 additions
and
7 deletions
.gitlab-ci.yml
+
10
−
7
View file @
2d5eb11a
...
...
@@ -7,15 +7,18 @@ stages:
.build_image
:
&build_image
image
:
#
We recommend using the CERN version of the Kaniko image: gitlab-registry.cern.ch/ci-tools/docker-image-builder
name
:
g
itlab-registry.cern.ch/ci-tools/docker-image-builder
#
The kaniko debug image is recommended because it has a shell, and a shell is required for an image to be used with GitLab CI/CD.
name
:
g
cr.io/kaniko-project/executor:debug
entrypoint
:
[
"
"
]
script
:
# This is not the common Authentication config, unknown reason why common config fails
-
echo "{\"auths\":{\"$CI_REGISTRY\":{\"auth\":\"$(echo -n ${CI_REGISTRY_USER}:${CI_REGISTRY_PASSWORD} | base64)\"}}}" > /kaniko/.docker/config.json
-
/kaniko/executor --context "$CI_PROJECT_DIR/$CONTEXT_DIR" --dockerfile "$CI_PROJECT_DIR/$CONTEXT_DIR/$DOCKERFILE"
--destination "${CI_REGISTRY_IMAGE}/${IMAGE_NAME}:${TAG}" $BUILD_ARGS
-
echo "Image pushed to ${CI_REGISTRY_IMAGE}/${IMAGE_NAME}:${TAG}"
# define script variables, they are passed in build time
-
IMAGE_DESTINATION=${CI_REGISTRY_IMAGE}/${IMAGE_NAME}:${TAG}
# Prepare Kaniko configuration file
-
echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
# Build and push the image from the Dockerfile at the root of the project.
-
/kaniko/executor --context "$CI_PROJECT_DIR/$CONTEXT_DIR" --dockerfile "$CI_PROJECT_DIR/$CONTEXT_DIR/$DOCKERFILE" --destination "${IMAGE_DESTINATION}" $BUILD_ARGS
# Print the full registry path of the pushed image
-
echo "Image pushed to ${IMAGE_DESTINATION}"
environment
:
stage
:
environment
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment