-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
317 additions
and
37 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,3 +1,4 @@ | ||
build | ||
.kvm-images | ||
.installed-requirements | ||
namibase/nami-linux-x64.tar.gz |
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,22 +1,70 @@ | ||
language: bash | ||
sudo: required | ||
script: bash shellcheck && sudo bash buildall | ||
dist: xenial | ||
dist: focal | ||
virt: vm | ||
group: edge | ||
os: linux | ||
services: | ||
- docker | ||
before_install: | ||
- docker version | ||
# Fix for Ubuntu Xenial apt-daily.service triggering | ||
# https://unix.stackexchange.com/questions/315502/how-to-disable-apt-daily-service-on-ubuntu-cloud-vm-image | ||
- | | ||
while sudo fuser /var/{lib/{dpkg,apt/lists},cache/apt/archives}/lock >/dev/null 2>&1; do | ||
sleep 1 | ||
done | ||
- sudo apt-get -qq update | ||
- sudo apt-get install -y debian-archive-keyring debootstrap shellcheck | ||
deploy: | ||
provider: script | ||
script: bash pushall | ||
skip_cleanup: true | ||
on: | ||
branch: master | ||
|
||
.build_job: &build_job | ||
stage: build | ||
before_install: | ||
- docker version | ||
# Fix for Ubuntu Xenial apt-daily.service triggering | ||
# https://unix.stackexchange.com/questions/315502/how-to-disable-apt-daily-service-on-ubuntu-cloud-vm-image | ||
- | | ||
while sudo fuser /var/{lib/{dpkg,apt/lists},cache/apt/archives}/lock >/dev/null 2>&1; do | ||
sleep 1 | ||
done | ||
- sudo rm /usr/local/bin/jq | ||
install: | ||
- sudo make .installed-requirements | ||
script: sudo bash buildone $DIST $PLATFORM | ||
after_success: | ||
- 'if [[ "$TRAVIS_BRANCH" == "master" && "$DIST" == "buster" ]] ; then sudo docker tag "bitnami/minideb:$DIST-$PLATFORM" "$BASENAME:latest-$PLATFORM" ; fi' | ||
- 'if [[ "$TRAVIS_BRANCH" == "master" ]] ; then sudo bash pushone $DIST $PLATFORM ; fi' | ||
- 'if [[ "$TRAVIS_BRANCH" == "master" && "$DIST" == "buster" ]] ; then sudo bash pushone latest $PLATFORM ; fi' | ||
|
||
jobs: | ||
include: | ||
- stage: shellcheck | ||
install: | ||
- sudo apt-get -qq update | ||
- sudo apt-get install -y shellcheck | ||
script: bash shellcheck | ||
- <<: *build_job | ||
arch: amd64 | ||
env: | ||
- DIST=jessie PLATFORM=amd64 | ||
- <<: *build_job | ||
arch: amd64 | ||
env: | ||
- DIST=stretch PLATFORM=amd64 | ||
- <<: *build_job | ||
arch: amd64 | ||
env: | ||
- DIST=buster PLATFORM=amd64 | ||
- <<: *build_job | ||
arch: arm64-graviton2 | ||
env: | ||
- DIST=stretch PLATFORM=arm64 | ||
- <<: *build_job | ||
arch: arm64-graviton2 | ||
env: | ||
- DIST=buster PLATFORM=arm64 | ||
- stage: deploy | ||
if: branch = master AND type = push | ||
env: | ||
- DISTS="stretch buster latest" | ||
before_install: mkdir $HOME/.docker | ||
install: 'echo "{ \"experimental\": \"enabled\" }" > $HOME/.docker/config.json' | ||
script: | ||
- | | ||
if [ -n "${DOCKER_PASSWORD:-}" ]; then | ||
docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD" | ||
fi | ||
for DIST in $DISTS; do | ||
sudo docker manifest create bitnami/minideb:$DIST bitnami/minideb:$DIST-amd64 bitnami/minideb:$DIST-arm64 | ||
sudo docker manifest push bitnami/minideb:$DIST | ||
done |
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,54 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
set -u | ||
set -o pipefail | ||
|
||
DIST=${1:?Specify the distrubution name} | ||
PLATFORM=${2:-amd64} | ||
|
||
BASENAME=bitnami/minideb | ||
GCR_BASENAME=gcr.io/bitnami-containers/minideb | ||
QUAY_BASENAME=quay.io/bitnami/minideb | ||
|
||
if [ -n "${DOCKER_PASSWORD:-}" ]; then | ||
docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD" | ||
fi | ||
|
||
if [ -n "${QUAY_PASSWORD:-}" ]; then | ||
docker login -u "$QUAY_USERNAME" -p "$QUAY_PASSWORD" quay.io | ||
fi | ||
|
||
if [ -n "${GCR_KEY:-}" ]; then | ||
gcloud auth activate-service-account "$GCR_EMAIL" --key-file <(echo "$GCR_KEY") | ||
fi | ||
|
||
ENABLE_DOCKER_CONTENT_TRUST=0 | ||
if [ -n "${DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE:-}" ] && [ -n "${DOCKER_CONTENT_TRUST_REPOSITORY_KEY:-}" ]; then | ||
tmpdir=$(mktemp -d) | ||
(cd "${tmpdir}" && bash -c 'echo -n "${DOCKER_CONTENT_TRUST_REPOSITORY_KEY}" | base64 -d > key') | ||
chmod 400 "${tmpdir}/key" | ||
docker trust key load "${tmpdir}/key" | ||
rm -rf "${tmpdir}" | ||
export ENABLE_DOCKER_CONTENT_TRUST=1 | ||
fi | ||
|
||
push() { | ||
local dist="$1" | ||
DOCKER_CONTENT_TRUST=${ENABLE_DOCKER_CONTENT_TRUST} docker push "${BASENAME}:${dist}" | ||
docker push "${QUAY_BASENAME}:${dist}" | ||
gcloud docker -- push "${GCR_BASENAME}:${dist}" | ||
} | ||
|
||
docker tag "${BASENAME}:${DIST}" "${QUAY_BASENAME}:${DIST}-${PLATFORM}" | ||
docker tag "${BASENAME}:${DIST}" "${GCR_BASENAME}:${DIST}-${PLATFORM}" | ||
push "$DIST-${PLATFORM}" | ||
|
||
# Create and merge a PR to update minideb-extras | ||
CIRCLE_CI_FUNCTIONS_URL=${CIRCLE_CI_FUNCTIONS_URL:-https://raw.githubusercontent.com/bitnami/test-infra/master/circle/functions} | ||
# sc can't follow source as it is a remote file | ||
# shellcheck disable=SC1090 | ||
source <(curl -sSL "$CIRCLE_CI_FUNCTIONS_URL") | ||
# Use '.RepoDigests 0' for getting Dockerhub repo digest as it was the first pushed | ||
DIST_REPO_DIGEST=$(docker image inspect --format '{{index .RepoDigests 0}}' "${BASENAME}:${DIST}-${PLATFORM}") | ||
update_minideb_derived "https://github.com/bitnami/minideb-runtimes" "$DIST-${PLATFORM}" "$DIST_REPO_DIGEST" |
Oops, something went wrong.