-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #676 from tonistiigi/dockerfile-release
hack: add release script
- Loading branch information
Showing
8 changed files
with
122 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
bin | ||
.tmp | ||
release-out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/usr/bin/env bash | ||
|
||
TAG=$1 | ||
REPO=$2 | ||
PUSH=$3 | ||
|
||
set -eu -o pipefail | ||
|
||
: ${PLATFORMS=linux/amd64} | ||
: ${CONTINUOUS_INTEGRATION=} | ||
|
||
progressFlag="" | ||
if [ "$CONTINUOUS_INTEGRATION" == "true" ]; then progressFlag="--progress=plain"; fi | ||
|
||
|
||
usage() { | ||
echo "usage: ./hack/release <tag> <repo> [push]" | ||
exit 1 | ||
} | ||
|
||
if [ -z "$TAG" ] || [ -z "$REPO" ]; then | ||
usage | ||
fi | ||
|
||
pushFlag="" | ||
if [ "$PUSH" = "push" ]; then | ||
pushFlag="--exporter-opt push=true" | ||
fi | ||
|
||
tagLatest="" | ||
tagLatestRootless="" | ||
if [[ "$(git describe --tags --match "v[0-9]*")" == "$TAG" ]]; then | ||
tagLatest=",$REPO:latest" | ||
tagLatestRootless=",$REPO:rootless" | ||
fi | ||
|
||
set -x | ||
|
||
buildctl build $progressFlag --frontend=dockerfile.v0 \ | ||
--local context=. --local dockerfile=. \ | ||
--frontend-opt filename=./hack/dockerfiles/test.buildkit.Dockerfile \ | ||
--frontend-opt platform=$PLATFORMS \ | ||
--exporter image \ | ||
--exporter-opt name=$REPO:$TAG$tagLatest $pushFlag | ||
|
||
buildctl build $progressFlag --frontend=dockerfile.v0 \ | ||
--local context=. --local dockerfile=. \ | ||
--frontend-opt target=rootless \ | ||
--frontend-opt filename=./hack/dockerfiles/test.buildkit.Dockerfile \ | ||
--frontend-opt platform=$PLATFORMS \ | ||
--exporter image \ | ||
--exporter-opt name=$REPO:$TAG-rootless$tagLatestRootless $pushFlag |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/usr/bin/env bash | ||
|
||
TAG=$1 | ||
OUT=$2 | ||
|
||
set -eu -o pipefail | ||
|
||
: ${PLATFORMS=linux/amd64} | ||
: ${CONTINUOUS_INTEGRATION=} | ||
|
||
progressFlag="" | ||
if [ "$CONTINUOUS_INTEGRATION" == "true" ]; then progressFlag="--progress=plain"; fi | ||
|
||
|
||
usage() { | ||
echo "usage: ./hack/release-tar <tag> <out>" | ||
exit 1 | ||
} | ||
|
||
if [ -z "$TAG" ] || [ -z "$OUT" ]; then | ||
usage | ||
fi | ||
|
||
|
||
set -x | ||
|
||
buildctl build $progressFlag --frontend=dockerfile.v0 \ | ||
--local context=. --local dockerfile=. \ | ||
--frontend-opt filename=./hack/dockerfiles/test.buildkit.Dockerfile \ | ||
--frontend-opt target=release \ | ||
--frontend-opt platform=$PLATFORMS \ | ||
--exporter local \ | ||
--exporter-opt output=$OUT |