Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
funkwhale
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
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
Service Desk
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
Show more breadcrumbs
poeppe
funkwhale
Commits
21164552
Verified
Commit
21164552
authored
3 years ago
by
Georg Krause
Browse files
Options
Downloads
Patches
Plain Diff
Distinguish different docker builds on CI level
parent
4b52f8d8
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+33
-6
33 additions, 6 deletions
.gitlab-ci.yml
with
33 additions
and
6 deletions
.gitlab-ci.yml
+
33
−
6
View file @
21164552
...
...
@@ -262,7 +262,7 @@ pages:
tags
:
-
docker
docker_
release
:
.
docker_
publish
:
stage
:
deploy
image
:
egon0/docker-with-buildx-and-git:bash
services
:
...
...
@@ -271,17 +271,44 @@ docker_release:
-
docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
-
docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD
-
cp -r front/dist api/frontend
-
(if [ "$CI_COMMIT_REF_NAME" == "develop" ] || [ "$CI_COMMIT_REF_NAME" == "stable" ]; then ./scripts/set-api-build-metadata.sh $(echo $CI_COMMIT_SHA | cut -c 1-8); fi);
script
:
-
if [[ ! -z "$CI_COMMIT_TAG" ]]; then (./docs/get-releases-json.py | scripts/is-docker-latest.py $CI_COMMIT_TAG -) && export DOCKER_LATEST_TAG="-t $IMAGE_LATEST" || export DOCKER_LATEST_TAG=; fi
-
if [[ "$CI_COMMIT_REF_NAME" =~ ^[0-9]+(.[0-9]+){1,2}$ ]]; then export stable=1 && export major="$(echo $CI_COMMIT_REF_NAME | cut -d '.' -f 1)" && export minor="$(echo $CI_COMMIT_REF_NAME | cut -d '.' -f 1,2)"; fi
docker_publish_stable_release
:
# Publish a docker image for releases
extends
:
.docker_publish
rules
:
-
if
:
$CI_COMMIT_TAG && '$CI_COMMIT_REF_NAME =~ ^[0-9]+(.[0-9]+){1,2}$'
script
:
# Check if this is the latest release
-
./docs/get-releases-json.py | scripts/is-docker-latest.py $CI_COMMIT_TAG - && export DOCKER_LATEST_TAG="-t $IMAGE_LATEST" || export DOCKER_LATEST_TAG=;
-
export major="$(echo $CI_COMMIT_REF_NAME | cut -d '.' -f 1)"
-
export minor="$(echo $CI_COMMIT_REF_NAME | cut -d '.' -f 1,2)"; fi
-
cd api
-
docker buildx create --use --name A$CI_COMMIT_SHORT_SHA
-
docker buildx build --platform $BUILD_PLATFORMS --push -t $IMAGE -t $DOCKER_LATEST_TAG -t $major -t $minor .
docker_publish_unstable_release
:
# Publish a docker image for releases
extends
:
.docker_publish
rules
:
-
if
:
$CI_COMMIT_TAG && '$CI_COMMIT_REF_NAME !~ ^[0-9]+(.[0-9]+){1,2}$'
script
:
# Check if this is the latest release
-
cd api
-
docker buildx create --use --name A$CI_COMMIT_SHORT_SHA
-
docker buildx build --platform $BUILD_PLATFORMS --push -t $IMAGE -t $CI_REGISTRY_IMAGE:latest -t $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME-$(date +%Y-%m-%d) -t $IMAGE_LATEST .
-
docker buildx build --platform $BUILD_PLATFORMS --push -t $IMAGE .
docker_published_non-release
:
# Publish a docker image for each commit on develop
extends
:
.docker_publish
only
:
-
develop@funkwhale/funkwhale
-
stable@funkwhale/funkwhale
-
tags@funkwhale/funkwhale
script
:
-
./scripts/set-api-build-metadata.sh $CI_COMMIT_SHA
-
cd api
-
docker buildx create --use --name A$CI_COMMIT_SHORT_SHA
-
docker buildx build --platform $BUILD_PLATFORMS --push -t $IMAGE .
docker_all_in_one_release
:
stage
:
deploy
...
...
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