Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
dashboard
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
Container Registry
Model registry
Operate
Environments
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
Show more breadcrumbs
AURA
dashboard
Commits
1e74803f
Verified
Commit
1e74803f
authored
2 years ago
by
David (Jointech)
Browse files
Options
Downloads
Patches
Plain Diff
Revert "feat(ci): switch building to buildkit"
This reverts commit
03470ca4
.
parent
03470ca4
No related branches found
No related tags found
No related merge requests found
Pipeline
#2238
passed
2 years ago
Stage: test
Stage: release
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+21
-43
21 additions, 43 deletions
.gitlab-ci.yml
with
21 additions
and
43 deletions
.gitlab-ci.yml
+
21
−
43
View file @
1e74803f
...
@@ -5,8 +5,6 @@
...
@@ -5,8 +5,6 @@
-
if
:
$CI_COMMIT_TAG =~ /^\d+[.]\d+[.]\d+$/ || $CI_COMMIT_TAG =~ /^\d+[.]\d+[.]\d+[-]\S+$/
-
if
:
$CI_COMMIT_TAG =~ /^\d+[.]\d+[.]\d+$/ || $CI_COMMIT_TAG =~ /^\d+[.]\d+[.]\d+[-]\S+$/
exists
:
exists
:
-
Dockerfile
-
Dockerfile
variables
:
IMAGE
:
$IMAGE_LATEST
stages
:
stages
:
-
test
-
test
...
@@ -21,54 +19,34 @@ lint:
...
@@ -21,54 +19,34 @@ lint:
-
npm run lint -- --no-fix
-
npm run lint -- --no-fix
docker-push
:
docker-push
:
# Use the official docker image.
image
:
docker:latest
stage
:
release
stage
:
release
image
:
name
:
moby/buildkit:v0.10.3-rootless
entrypoint
:
[
"
sh"
,
"
-c"
]
variables
:
variables
:
DOCKER_CONTEXT
:
.
DOCKERFILE_DIR
:
.
DOCKERFILE_NAME
:
"
Dockerfile"
BUILDKIT_ARGS
:
"
"
# the name of the image without version
# the name of the image without version
AURA_IMAGE_NAME
:
"
autoradio/dashboard"
AURA_IMAGE_NAME
:
"
autoradio/dashboard"
IMAGE
:
"
name=$AURA_IMAGE_NAME:unstable"
services
:
IMAGE_LATEST
:
"
name=$AURA_IMAGE_NAME:$CI_COMMIT_TAG,$AURA_IMAGE_NAME:latest"
-
docker:dind
BUILD_CACHE
:
"
$CI_REGISTRY_IMAGE/buildcache"
before_script
:
# Necessary for buildkit in docker build
# default repo is docker.io (aka docker hub)
BUILDKITD_FLAGS
:
"
--oci-worker-no-process-sandbox"
-
docker login -u "$DOCKER_ID" -p "$DOCKER_HUB_AUTH"
# Also login and push to Docker hub
script
:
DOCKERHUB_USER
:
"
$DOCKER_ID"
# every commit on main branch should build image as unstable
DOCKERHUB_PASSWORD
:
"
$DOCKER_HUB_AUTH"
# else it is from a tag (enforced by gitlab-ci rules)
rules
:
# hint: tags are references independent of branches
# Always tag with unstable, on release branch also tag with latest
-
|
if [ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]
then docker build -t $AURA_IMAGE_NAME:unstable .
else docker build -t $AURA_IMAGE_NAME -t $AURA_IMAGE_NAME:$CI_COMMIT_TAG .
fi
# TODO: maybe isolate docker build and docker push
-
docker push "$AURA_IMAGE_NAME" --all-tags
rules
:
-
*release-rules
-
*release-rules
-
if
:
"
$CI_COMMIT_BRANCH
==
$CI_DEFAULT_BRANCH"
# every commit on master/main branch should trigger a push to docker-hub as unstable without a release
-
if
:
$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
exists
:
exists
:
-
Dockerfile
-
Dockerfile
before_script
:
-
mkdir -p ~/.docker
-
>
echo "{ \"auths\": {
\"https://index.docker.io/v1/\": {
\"auth\": \"$(echo -n \"$DOCKERHUB_USER:$DOCKERHUB_PASSWORD\" | base64)\"
}
}}" >> ~/.docker/config.json
script
:
-
>
echo "Docker context: $DOCKER_CONTEXT"
&& echo "Dockerfile directory: $DOCKERFILE_DIR"
&& echo "Cache image: $BUILD_CACHE"
&& echo "Images:" $(echo $IMAGE | sed "s/name=//")
-
'
[[
-n
"$DOCKERFILE_NAME"
]]
&&
BUILDKIT_ARGS="$BUILDKIT_ARGS
--frontend-opt
filename=$DOCKERFILE_NAME"'
-
echo $BUILDKIT_ARGS
-
>
buildctl-daemonless.sh build --progress=plain
--frontend=dockerfile.v0 --local context=$DOCKER_CONTEXT --local dockerfile=$DOCKERFILE_DIR
--export-cache type=registry,mode=max,ref=$BUILD_CACHE
--import-cache type=registry,ref=$BUILD_CACHE
--output type=image,\"$IMAGE\",push=true
$BUILDKIT_ARGS
release_job
:
release_job
:
stage
:
release
stage
:
release
...
...
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