Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,10 @@ test: build
else
export RUN_ARGS=
fi
docker run $RUN_ARGS --rm -v {{justfile_directory()}}:/tests -w /tests $ACTION_IMAGE_NAME:20.04 ./tests.sh
docker run $RUN_ARGS --rm -v {{justfile_directory()}}:/tests -w /tests $ACTION_IMAGE_NAME:22.04 ./tests.sh
docker run $RUN_ARGS --rm -v {{justfile_directory()}}:/tests -w /tests $ACTION_IMAGE_NAME:24.04 ./tests.sh

docker compose run $RUN_ARGS --rm -v {{justfile_directory()}}:/tests -w /tests "$ACTION_IMAGE_NAME-20.04" ./tests.sh
docker compose run $RUN_ARGS --rm -v {{justfile_directory()}}:/tests -w /tests "$ACTION_IMAGE_NAME-22.04" ./tests.sh
docker compose run $RUN_ARGS --rm -v {{justfile_directory()}}:/tests -w /tests "$ACTION_IMAGE_NAME-24.04" ./tests.sh
./check.sh

# Update the files tracking the SHAs of ubuntu docker image
Expand Down
10 changes: 8 additions & 2 deletions docker-apt-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@
# Useful utility to install system packages from a file
# It does so in the lowest footprint way possible, in a single RUN command.
set -euo pipefail
set -x
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean to leave this in?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, but it should have been a separate commit.

It's useful in CI if something goes wrong with this new bit of complexity/failure case I've added.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yeah, makes sense. Was just hard to tell from the context.


pro_attached=0
pro_token_file=/run/secrets/ubuntu_pro_token

# ensure apt lists are populated
apt-get update

if grep -q 'VERSION_ID="20.04"' /etc/os-release; then
# enable ubuntu pro, based on the example in the Canonical docs:
Expand All @@ -22,6 +21,7 @@ if grep -q 'VERSION_ID="20.04"' /etc/os-release; then
# - esm-infra: core infra packages
# - esm-apps: applications and server packages
if test -s "$pro_token_file"; then
apt-get update
apt-get install --no-install-recommends -y ubuntu-pro-client ca-certificates
cat > /tmp/pro-attach-config.yaml <<EOF
token: $(cat "$pro_token_file")
Expand All @@ -32,9 +32,15 @@ EOF
pro attach --attach-config /tmp/pro-attach-config.yaml
rm -f /tmp/pro-attach-config.yaml
pro_attached=1
else
echo "ubuntu_pro_token secret is required for 20.04 build"
exit 1
fi
fi

# ensure apt lists are populated
apt-get update

# do we want to upgrade too?
test "${UPGRADE:-}" = "yes" && apt-get upgrade --yes

Expand Down
3 changes: 3 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ services:
# env vars supplied by make/just
- BASE_CREATED
- BASE_GITREF
# we also need to pass the secret at runtime for tests.sh to use.
secrets:
- ubuntu_pro_token
init: true

base-docker-20.04:
Expand Down