Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
bulk_rnaseq
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
rost
bulk_rnaseq
Commits
2b85530a
Commit
2b85530a
authored
4 months ago
by
rost
Browse files
Options
Downloads
Patches
Plain Diff
Update CI configuration to use CONTAINER_LATEST_IMAGE and streamline push logic
parent
7ddba324
Branches
Branches containing commit
Tags
v0.0.1
Tags containing commit
No related merge requests found
Pipeline
#8486
failed
4 months ago
Stage: build
Stage: push
Changes
1
Pipelines
2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+16
-16
16 additions, 16 deletions
.gitlab-ci.yml
with
16 additions
and
16 deletions
.gitlab-ci.yml
+
16
−
16
View file @
2b85530a
...
...
@@ -13,17 +13,16 @@ stages:
-
push
variables
:
IMAGE_NAME
:
"
$CI_REGISTRY_IMAGE/bulk:latest"
DOCKER_TLS_CERTDIR
:
"
"
DOCKER_HOST
:
tcp://docker:2375
DOCKER_DRIVER
:
overlay2
CONTAINER_TEST_IMAGE
:
$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
CONTAINER_
RELEASE
_IMAGE
:
$CI_REGISTRY_IMAGE:latest
CONTAINER_
LATEST
_IMAGE
:
$CI_REGISTRY_IMAGE:latest
build
:
stage
:
build
script
:
-
docker pull $CONTAINER_
RELEASE
_IMAGE ||
true
-
docker pull $CONTAINER_
LATEST
_IMAGE ||
true
-
docker build
--build-arg CONTAINER_BUILD_DATE="${CI_JOB_STARTED_AT}"
--build-arg CONTAINER_GIT_NAME="${CI_PROJECT_NAME}"
...
...
@@ -31,23 +30,24 @@ build:
--build-arg CONTAINER_GIT_COMMIT_ID="${CI_COMMIT_SHORT_SHA}"
--build-arg CONTAINER_VERSION=${CI_COMMIT_REF_NAME}
--build-arg BUILDKIT_INLINE_CACHE=1
--cache-from $CONTAINER_
RELEASE
_IMAGE
--cache-from $CONTAINER_
LATEST
_IMAGE
--tag $CONTAINER_TEST_IMAGE .
-
docker push $CONTAINER_TEST_IMAGE
push
:
stage
:
push
only
:
-
main
-
tags
script
:
-
docker pull $CONTAINER_TEST_IMAGE
-
docker tag $CONTAINER_TEST_IMAGE $CONTAINER_RELEASE_IMAGE
-
docker push $CONTAINER_RELEASE_IMAGE
rules
:
-
if
:
$CI_COMMIT_BRANCH == "main"
# # 🔹 Build Job: Builds the Docker image
# build:
# stage: build_and_push
# script:
# - docker build -t "$IMAGE_NAME" .
# - docker push "$IMAGE_NAME"
\ No newline at end of file
-
docker tag $CONTAINER_TEST_IMAGE $CONTAINER_LATEST_IMAGE
-
|
if [[ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]]; then
TAG="latest"
echo "Running on default branch '$CI_DEFAULT_BRANCH': TAG = 'latest'"
else
TAG="$CI_COMMIT_REF_NAME"
echo "Running on branch '$CI_COMMIT_BRANCH': TAG = $TAG"
fi
-
docker push $CI_REGISTRY_IMAGE:$TAG
\ No newline at end of file
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