Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Ceph Webapp Poc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
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
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Jacopo Gasparetto
Ceph Webapp Poc
Commits
5c208a4e
Commit
5c208a4e
authored
1 year ago
by
Jacopo Gasparetto
Browse files
Options
Downloads
Patches
Plain Diff
fix(ci-cd): sync image tags and add latest tag
parent
c85ccb85
No related branches found
Branches containing commit
No related tags found
2 merge requests
!15
feat(api): expose /api/v1 directly in backend
,
!12
fix(ci-cd): sync image tags and add latest tag
Pipeline
#100198
passed
1 year ago
Stage: fetch-version
Stage: build
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+60
-26
60 additions, 26 deletions
.gitlab-ci.yml
with
60 additions
and
26 deletions
.gitlab-ci.yml
+
60
−
26
View file @
5c208a4e
...
...
@@ -3,10 +3,18 @@ stages:
-
build
-
test
-
release
-
u
plo
ad
-
de
plo
y
variables
:
PACKAGENAME
:
frontend-s3
BE_BASE_IMAGE
:
"
${CI_REGISTRY_IMAGE}/backend"
BE_TEST_IMAGE
:
"
${BE_BASE_IMAGE}:${CI_COMMIT_SHORT_SHA}"
FE_BASE_IMAGE
:
"
${CI_REGISTRY_IMAGE}/frontend"
FE_TEST_IMAGE
:
"
${FE_BASE_IMAGE}:${CI_COMMIT_SHORT_SHA}"
IS_DEV_VERSION
:
'
"^v(([0-9]+)\.)?([0-9]+)\.?([0-9]+)?(-dev)\.?([0-9]+)$'
DEV_LATEST_IMAGE_TAG
:
"
latest-dev"
PROD_LATEST_IMAGE_TAG
:
"
latest"
IS_PROD_VERSION
:
'
"^v(([0-9]+)\.)?([0-9]+)\.?([0-9]+)$"'
fetch-next-version
:
stage
:
fetch-version
...
...
@@ -47,12 +55,8 @@ build-backend:
-
docker login -u gitlab-ci-token -p ${CI_JOB_TOKEN} ${CI_REGISTRY}
-
VERSION="$(cat version.txt)"
script
:
-
docker build --pull -t "${CI_REGISTRY_IMAGE}/backend:v${VERSION}" backend
-
docker push "${CI_REGISTRY_IMAGE}/backend:v${VERSION}"
only
:
changes
:
-
.gitlab-ci.yml
-
backend/**/*
-
docker build --pull -t "${BE_TEST_IMAGE}" backend
-
docker push "${BE_TEST_IMAGE}"
build-frontend
:
stage
:
build
...
...
@@ -72,10 +76,6 @@ build-frontend:
paths
:
-
packagename.txt
-
frontend/*.tar.gz
# Known issue w/ variable expansion https://gitlab.com/gitlab-org/gitlab-runner/-/issues/29141
only
:
changes
:
-
.gitlab-ci.yml
-
frontend/**/*
release
:
image
:
node:19
...
...
@@ -92,11 +92,10 @@ release:
test
:
stage
:
test
script
:
echo "Hello, Test!"
script
:
echo "Hello, Test!"
u
plo
ad
-frontend-package
:
stage
:
u
plo
ad
de
plo
y
-frontend-package
:
stage
:
de
plo
y
before_script
:
-
PACKAGENAME="$(cat packagename.txt)"
-
VERSION="$(cat version.txt)"
...
...
@@ -105,17 +104,14 @@ upload-frontend-package:
-
'
curl
--header
"JOB-TOKEN:
$CI_JOB_TOKEN"
--upload-file
"frontend/${PACKAGE_FULLNAME}"
"${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/${PACKAGENAME}/$VERSION/${PACKAGE_FULLNAME}"'
only
:
changes
:
-
.gitlab-ci.yml
-
frontend/**/*
refs
:
-
main
-
dev
-
/^(([0-9]+)\.)?([0-9]+)\.x/
# Maintenance branches
-
/^([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+)?$/
# Prerelease branches
u
plo
ad
-frontend-docker
:
stage
:
u
plo
ad
de
plo
y
-frontend-docker
:
stage
:
de
plo
y
image
:
docker:latest
services
:
-
docker:dind
...
...
@@ -125,13 +121,51 @@ upload-frontend-docker:
-
PACKAGE_FULLNAME="${PACKAGENAME}_v${VERSION}.tar.gz"
-
docker login -u gitlab-ci-token -p ${CI_JOB_TOKEN} ${CI_REGISTRY}
script
:
-
tar -xvf frontend/${PACKAGE_FULLNAME} -C frontend
-
docker build --pull -t "${CI_REGISTRY_IMAGE}/frontend:v${VERSION}" frontend -f frontend/Dockerfile.prod
-
docker push "${CI_REGISTRY_IMAGE}/frontend:v${VERSION}"
-
tar -xvf frontend/${PACKAGE_FULLNAME} -C frontend
-
docker build --pull -t "${FE_TEST_IMAGE}" frontend -f frontend/Dockerfile.prod
-
docker tag "${FE_TEST_IMAGE}" ${FE_BASE_IMAGE}:${VERSION}
-
docker push "${FE_BASE_IMAGE}:v${VERSION}"
-
|
if [[ ${CI_COMMIT_REF_NAME} =~ ${IS_PROD_VERSION} ]]; then
docker tag "${FE_BASE_IMAGE}" "${FE_BASE_IMAGE}:${PROD_LATEST_IMAGE_TAG}"
docker push "${FE_BASE_IMAGE}:${PROD_LATEST_IMAGE_TAG}"
fi
-
|
if [[ ${CI_COMMIT_REF_NAME} =~ ${IS_DEV_VERSION} ]]; then
docker tag "${FE_BASE_IMAGE}" "${FE_BASE_IMAGE}:${DEV_LATEST_IMAGE_TAG}"
docker push "${FE_BASE_IMAGE}:${DEV_LATEST_IMAGE_TAG}""
fi
only
:
refs
:
-
main
-
dev
-
/^(([0-9]+)\.)?([0-9]+)\.x/
# Maintenance branches
-
/^([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+)?$/
# Prerelease branches
deploy-backend-docker
:
stage
:
deploy
image
:
docker:latest
services
:
-
docker:dind
before_script
:
-
VERSION="$(cat version.txt)"
-
docker login -u gitlab-ci-token -p ${CI_JOB_TOKEN} ${CI_REGISTRY}
script
:
-
docker pull ${BE_TEST_IMAGE}"
-
docker tag "${BE_TEST_IMAGE}" "${BE_BASE_IMAGE}:v${VERSION}"
-
docker push "${BE_BASE_IMAGE}:v${VERSION}"
-
|
if [[ ${CI_COMMIT_REF_NAME} =~ ${IS_PROD_VERSION} ]]; then
docker tag "${BE_TEST_IMAGE}" "${BE_BASE_IMAGE}:${PROD_LATEST_IMAGE_TAG}"
docker push "${BE_BASE_IMAGE}:${PROD_LATEST_IMAGE_TAG}"
fi
-
|
if [[ ${CI_COMMIT_REF_NAME} =~ ${IS_DEV_VERSION} ]]; then
docker tag "${BE_TEST_IMAGE}" "${BE_BASE_IMAGE}:${DEV_LATEST_IMAGE_TAG}"
docker push "${BE_BASE_IMAGE}:${DEV_LATEST_IMAGE_TAG}""
fi
only
:
changes
:
-
.gitlab-ci.yml
-
frontend/**/*
refs
:
-
main
-
dev
...
...
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