diff options
author | 2020-08-27 22:30:57 +0300 | |
---|---|---|
committer | 2020-09-04 16:48:27 +0200 | |
commit | 45cdd16500965528548c2b2e0ecd2044cc20aa31 (patch) | |
tree | fe72ace79f1cd74c4132842e034f155caa0e8348 | |
parent | Add CI builds for all supported stage3 architectures (diff) | |
download | docker-images-45cdd16500965528548c2b2e0ecd2044cc20aa31.tar.gz docker-images-45cdd16500965528548c2b2e0ecd2044cc20aa31.tar.bz2 docker-images-45cdd16500965528548c2b2e0ecd2044cc20aa31.zip |
Push all stage3 images to the same Docker repo
Closes: #86
Signed-off-by: Konstantinos Smanis <konstantinos.smanis@gmail.com>
Closes: https://github.com/gentoo/gentoo-docker-images/pull/94
Signed-off-by: Alexys Jacob <ultrabug@gentoo.org>
-rw-r--r-- | .travis.yml | 9 | ||||
-rw-r--r-- | README.md | 16 | ||||
-rwxr-xr-x | build.sh | 10 |
3 files changed, 21 insertions, 14 deletions
diff --git a/.travis.yml b/.travis.yml index 50ba3f4..7661939 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,7 @@ env: - ORG=gentoo jobs: - TARGET=portage - - TARGET=stage3-amd64 + - TARGET=stage3-amd64 LATEST=true - TARGET=stage3-amd64-hardened - TARGET=stage3-amd64-hardened-nomultilib - TARGET=stage3-amd64-musl-hardened @@ -44,7 +44,7 @@ script: - ./build.sh after_success: # Inspect built image - - docker image inspect "${ORG}/${TARGET}:latest" + - docker image inspect "${ORG}/${TARGET/-/:}" # Run `emerge --info` for stage builds - | if [[ "${TARGET}" == stage* ]]; then @@ -53,11 +53,12 @@ after_success: # Enable execution of foreign binary formats (i.e., non-amd64/x86) docker run --rm --privileged multiarch/qemu-user-static --reset -p yes fi - docker run --rm "${ORG}/${TARGET}:latest" emerge --info + docker run --rm "${ORG}/${TARGET/-/:}" emerge --info fi # Push all built images to Docker Hub (cron daily task) - | if [[ "${TRAVIS_PULL_REQUEST_BRANCH:-${TRAVIS_BRANCH}}" == "master" && "${TRAVIS_EVENT_TYPE}" == "cron" ]]; then echo "${DOCKER_PASSWORD}" | docker login -u "${DOCKER_USERNAME}" --password-stdin - docker push "${ORG}/${TARGET}" + REPO="$(cut -d '-' -f 1 <<< ${TARGET})" + docker push "${ORG}/${REPO}" fi @@ -14,16 +14,16 @@ https://hub.docker.com/u/gentoo/ ## Inventory -The following targets are built by Travis (bold targets are also pushed to Docker Hub): - * **`portage`** +The following targets are built by Travis and pushed to Docker Hub: + * `portage` * `stage3` * `amd64` - * **`stage3-amd64`** - * **`stage3-amd64-hardened`** - * **`stage3-amd64-hardened-nomultilib`** + * `stage3-amd64` + * `stage3-amd64-hardened` + * `stage3-amd64-hardened-nomultilib` * `stage3-amd64-musl-hardened` * `stage3-amd64-musl-vanilla` - * **`stage3-amd64-nomultilib`** + * `stage3-amd64-nomultilib` * `stage3-amd64-systemd` * `stage3-amd64-uclibc-hardened` * `stage3-amd64-uclibc-vanilla` @@ -39,8 +39,8 @@ The following targets are built by Travis (bold targets are also pushed to Docke * `s390` * `stage3-s390x` * `x86` - * **`stage3-x86`** - * **`stage3-x86-hardened`** + * `stage3-x86` + * `stage3-x86-hardened` * `stage3-x86-musl-vanilla` * `stage3-x86-systemd` * `stage3-x86-uclibc-hardened` @@ -13,6 +13,11 @@ fi IFS=- read -r NAME ARCH SUFFIX <<< "${TARGET}" VERSION=${VERSION:-$(date -u +%Y%m%d)} +if [[ "${NAME}" == "portage" ]]; then + VERSION_SUFFIX=":${VERSION}" +else + VERSION_SUFFIX="-${VERSION}" +fi ORG=${ORG:-gentoo} @@ -62,8 +67,9 @@ docker buildx build \ --build-arg ARCH="${ARCH}" \ --build-arg MICROARCH="${MICROARCH}" \ --build-arg SUFFIX="${SUFFIX}" \ - --tag "${ORG}/${TARGET}:latest" \ - --tag "${ORG}/${TARGET}:${VERSION}" \ + --tag "${ORG}/${TARGET/-/:}" \ + --tag "${ORG}/${TARGET/-/:}${VERSION_SUFFIX}" \ + ${LATEST:+--tag "${ORG}/${NAME}:latest"} \ --platform "linux/${DOCKER_ARCH}" \ --progress plain \ --load \ |