Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
oetzit
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
commul
oetzit
Commits
011327e5
Commit
011327e5
authored
2 years ago
by
Paolo Brasolin
Browse files
Options
Downloads
Patches
Plain Diff
ci: clean up image tagging schema
parent
ef1914be
No related branches found
No related tags found
No related merge requests found
Pipeline
#25316
failed
2 years ago
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+33
-20
33 additions, 20 deletions
.gitlab-ci.yml
backend/k8s/overlays/stg/kustomization.yaml
+1
-1
1 addition, 1 deletion
backend/k8s/overlays/stg/kustomization.yaml
with
34 additions
and
21 deletions
.gitlab-ci.yml
+
33
−
20
View file @
011327e5
...
...
@@ -68,10 +68,6 @@ app-tagger-job:
GIT_STRATEGY
:
clone
GIT_DEPTH
:
0
script
:
-
APP_BRANCH=${CI_COMMIT_TAG:+main}
-
APP_BRANCH=${APP_BRANCH:-${CI_COMMIT_REF_NAME}}
-
echo Detected app branch ${APP_BRANCH}
-
echo "APP_VERSION=$APP_BRANCH" >> build.env
-
APP_VERSION=$(git describe --tags)
-
echo Detected app version ${APP_VERSION}
-
echo "APP_VERSION=$APP_VERSION" >> build.env
...
...
@@ -168,32 +164,49 @@ stg-fe-build-job:
#--[ Backend ]------------------------------------------------------------------
be-build-job
:
.
be-build-job
:
stage
:
build
image
:
name
:
gcr.io/kaniko-project/executor:debug
entrypoint
:
[
"
"
]
# tags:
# - shared
# - commul # NOTE: we used to need commul (not shared) because of credentials in environment
variables
:
IMAGE_NAME
:
$CI_REGISTRY_IMAGE/backend
script
:
before_
script
:
-
mkdir -p /kaniko/.docker
-
echo "{\"auths\":{\"${CI_REGISTRY}\":{\"auth\":\"$(printf "%s:%s" "${CI_REGISTRY_USER}" "${CI_REGISTRY_PASSWORD}" | base64 | tr -d '\n')\"}}}" > /kaniko/.docker/config.json
-
>-
/kaniko/executor
--context "${CI_PROJECT_DIR}/backend"
--dockerfile "${CI_PROJECT_DIR}/backend/Dockerfile"
--target production
--destination ${CI_REGISTRY_IMAGE}/backend:latest
--destination ${CI_REGISTRY_IMAGE}/backend:${CI_COMMIT_SHA}
--destination ${CI_REGISTRY_IMAGE}/backend:${APP_BRANCH}
--destination ${CI_REGISTRY_IMAGE}/backend:${APP_VERSION}
--build-arg APP_VERSION=$APP_VERSION
--build-arg ROLLBAR_ACCESS_TOKEN=$POST_SERVER_ITEM_ROLLBAR_ACCESS_TOKEN
prd-be-build-job
:
extends
:
.be-build-job
stage
:
build
script
:
>-
/kaniko/executor
--context "${CI_PROJECT_DIR}/backend"
--dockerfile "${CI_PROJECT_DIR}/backend/Dockerfile"
--target production
--destination ${CI_REGISTRY_IMAGE}/backend:latest
--destination ${CI_REGISTRY_IMAGE}/backend:${APP_VERSION}
--destination ${CI_REGISTRY_IMAGE}/backend:${APP_VERSION%.*}
--destination ${CI_REGISTRY_IMAGE}/backend:${APP_VERSION%%.*}
--destination ${CI_REGISTRY_IMAGE}/backend:${CI_COMMIT_SHA}
--build-arg APP_VERSION=$APP_VERSION
--build-arg ROLLBAR_ACCESS_TOKEN=$POST_SERVER_ITEM_ROLLBAR_ACCESS_TOKEN
only
:
-
tags
stg-be-build-job
:
extends
:
.be-build-job
stage
:
build
script
:
>-
/kaniko/executor
--context "${CI_PROJECT_DIR}/backend"
--dockerfile "${CI_PROJECT_DIR}/backend/Dockerfile"
--target production
--destination ${CI_REGISTRY_IMAGE}/backend:${CI_COMMIT_REF_NAME}
--destination ${CI_REGISTRY_IMAGE}/backend:${APP_VERSION}
--destination ${CI_REGISTRY_IMAGE}/backend:${CI_COMMIT_SHA}
--build-arg APP_VERSION=$APP_VERSION
--build-arg ROLLBAR_ACCESS_TOKEN=$POST_SERVER_ITEM_ROLLBAR_ACCESS_TOKEN
only
:
-
development
#==[ DEPLOY STAGE ]=============================================================
...
...
This diff is collapsed.
Click to expand it.
backend/k8s/overlays/stg/kustomization.yaml
+
1
−
1
View file @
011327e5
...
...
@@ -14,7 +14,7 @@ patchesStrategicMerge:
images
:
-
name
:
oetzit-webserver-image
newName
:
gitlab.inf.unibz.it:4567/commul/oetzit/backend
newTag
:
lates
t
newTag
:
developmen
t
secretGenerator
:
-
envs
:
-
database.secrets.env
...
...
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