Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
renovate
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
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
GitHub Mirror
Renovate Bot
renovate
Commits
db4f44bd
Unverified
Commit
db4f44bd
authored
5 years ago
by
Michael Kriese
Committed by
GitHub
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
chore(ci): fix docker release (#5462)
parent
0f47f1ac
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.github/workflows/release-docker.sh
+34
-0
34 additions, 0 deletions
.github/workflows/release-docker.sh
.github/workflows/release.yml
+8
-42
8 additions, 42 deletions
.github/workflows/release.yml
with
42 additions
and
42 deletions
.github/workflows/release-docker.sh
0 → 100755
+
34
−
0
View file @
db4f44bd
#!/bin/bash
set
-e
PLATFORM
=
${
PLATFORM
-linux/amd64
}
DOCKER_REPO
=
${
DOCKER_REPO
-renovate/cache-test
}
DOCKER_TAG
=
${
DOCKER_TAG
-slim
}
# Strip git ref prefix from version
VERSION
=
${
REF
#refs/tags/
}
SEMVER_REGEX
=
"^(0|[1-9][0-9]*)
\.
(0|[1-9][0-9]*)
\.
(0|[1-9][0-9]*)?$"
if
!
[[
"
$VERSION
"
=
~
$SEMVER_REGEX
]]
;
then
echo
Not a semver tag - skipping:
${
REF
#refs/tags/
}
exit
1
fi
major
=
${
BASH_REMATCH
[1]
}
minor
=
${
BASH_REMATCH
[2]
}
patch
=
${
BASH_REMATCH
[3]
}
slim
=
${
DOCKER_TAG
#latest
}
slim
=
${
slim
:+-
}${
slim
}
ARGS
=(
--platform
=
${
PLATFORM
}
--cache-from
=
${
DOCKER_REPO
}
:cache-
${
DOCKER_TAG
}
--push
--tag
=
${
DOCKER_REPO
}
:
${
DOCKER_TAG
}
)
# Tag for versions additional
for
tag
in
{
"
${
major
}${
slim
}
"
,
"
${
major
}
.
${
minor
}${
slim
}
"
,
"
${
major
}
.
${
minor
}
.
${
patch
}${
slim
}
"
}
;
do
ARGS+
=(
--tag
${
DOCKER_REPO
}
:
${
tag
}
)
done
ARGS+
=(
--file
=
./
${
DOCKER_FILE
}
.
)
set
-x
docker buildx build
"
${
ARGS
[@]
}
"
This diff is collapsed.
Click to expand it.
.github/workflows/release.yml
+
8
−
42
View file @
db4f44bd
...
@@ -41,8 +41,8 @@ jobs:
...
@@ -41,8 +41,8 @@ jobs:
-
name
:
Build the Docker image
-
name
:
Build the Docker image
run
:
|
run
:
|
docker buildx build \
docker buildx build \
--platform
${PLATFORM} \
--platform
=
${PLATFORM} \
--
output=type=docker
\
--
load
\
--cache-from=${DOCKER_REPO}:cache-${DOCKER_TAG} \
--cache-from=${DOCKER_REPO}:cache-${DOCKER_TAG} \
--tag=renovate \
--tag=renovate \
--file=./${DOCKER_FILE} .
--file=./${DOCKER_FILE} .
...
@@ -56,44 +56,10 @@ jobs:
...
@@ -56,44 +56,10 @@ jobs:
-
name
:
Image size
-
name
:
Image size
run
:
docker image ls | grep renovate
run
:
docker image ls | grep renovate
-
name
:
Generate tags
-
name
:
Docker registry login
run
:
|
run
:
echo "${{ secrets.DOCKER_RENOVATERELEASE_TOKEN }}" | docker login -u renovaterelease --password-stdin
# Strip git ref prefix from version
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# Tag base
tags="${DOCKER_REPO}:${DOCKER_TAG}"
echo "Tagging ${DOCKER_REPO}:${DOCKER_TAG}"
SEMVER_REGEX="^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)?$"
if ! [[ "$VERSION" =~ $SEMVER_REGEX ]]; then
echo Not a semver tag - skipping
exit 1
fi
major=${BASH_REMATCH[1]}
minor=${BASH_REMATCH[2]}
patch=${BASH_REMATCH[3]}
slim=${DOCKER_TAG#latest}
slim=${slim:+-}${slim}
# Tag for versions additional
-
name
:
Generate tags
for tag in {"${major}${slim}","${major}.${minor}${slim}","${major}.${minor}.${patch}${slim}"}; do
env
:
echo "Tagging ${DOCKER_REPO}:${tag}"
REF
:
${{ github.ref }}
tags+=",${DOCKER_REPO}:${tag}"
run
:
./.github/workflows/docker-release.sh
done
echo "::set-env name=TAGS::${tags}"
-
name
:
Push the Docker image
run
:
|
echo "${{ secrets.DOCKER_RENOVATERELEASE_TOKEN }}" | docker login -u renovaterelease --password-stdin
docker buildx build \
--platform ${PLATFORM} \
--output=type=registry \
--cache-from=${DOCKER_REPO}:cache-${DOCKER_TAG} \
--tag=${TAGS} \
--file=./${DOCKER_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