Skip to content

Commit

Permalink
Add cinc to ci
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorific committed Nov 19, 2024
1 parent da9a90d commit 652fcad
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
dokken/amazonlinux-2: 'dokken/amazonlinux-2/**'
dokken/amazonlinux-2023: 'dokken/amazonlinux-2023/**'
dokken/centos-stream-9: 'dokken/centos-stream-9/**'
dokken/cinc: 'dokken/cinc/**'
dokken/debian-11: 'dokken/debian-11/**'
dokken/debian-12: 'dokken/debian-12/**'
dokken/eurolinux-9: 'dokken/eurolinux-9/**'
Expand Down
12 changes: 12 additions & 0 deletions bin/test-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

set -eu -o pipefail

json_data="$(docker buildx bake --print 2>/dev/null)"
first_build_target=$(echo "$json_data" | jq -r '.target | to_entries[0].value')
if echo "$first_build_target" | jq -e '.labels."dev.polymathrobotics.container-build-publish-action.test-entrypoint"' > /dev/null; then
test_entrypoint=$(echo "$first_build_target" | jq -r '.labels."dev.polymathrobotics.container-build-publish-action.test-entrypoint"')
echo "$test_entrypoint"
else
echo "/bin/bash"
fi
3 changes: 2 additions & 1 deletion dokken/cinc/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ ARG BASE_IMAGE=docker.io/busybox:1.36.1
# the --volumes-from parameter, the operating system type doesn't matter.
# So we use busybox, a really small distro, with just enough support to
# be able to download and install the binaries for cinc.
# hadolint ignore=DL3006
FROM $BASE_IMAGE AS base

ARG CINC_URL_AMD64
Expand All @@ -30,7 +31,7 @@ RUN <<EOF
max_attempts=5
attempt=0
while [ $attempt -lt $max_attempts ]; do
wget --no-check-certificate -O /tmp/cinc-client.rpm ${CINC_URL} && break
wget --progress=dot:giga --no-check-certificate -O /tmp/cinc-client.rpm ${CINC_URL} && break
attempt=$((attempt + 1))
echo "Attempt $attempt failed. Retrying..."
sleep 5
Expand Down
1 change: 1 addition & 0 deletions dokken/cinc/docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ target "_common" {
"org.opencontainers.image.description" = "Cinc Client is an automation platform built from Chef Infra"
"org.opencontainers.image.title" = "${TAG_PREFIX}"
"org.opencontainers.image.created" = "${timestamp()}"
"dev.polymathrobotics.container-build-publish-action.test-entrypoint" = "/bin/sh"
}
}

Expand Down

0 comments on commit 652fcad

Please sign in to comment.