diff --git a/.github/workflows/cinc.yml b/.github/workflows/cinc.yml new file mode 100644 index 0000000..fc2ed6a --- /dev/null +++ b/.github/workflows/cinc.yml @@ -0,0 +1,70 @@ +name: hadolint + +on: + push: + branches: [ main ] + paths: + - 'cinc/cinc/**' + pull_request: + branches: [ main ] + paths: + - 'cinc/cinc/**' + workflow_dispatch: +jobs: + build: + runs-on: ubuntu-latest + defaults: + run: + working-directory: cinc/cinc + steps: + - uses: actions/checkout@v4 + + - name: Check the Containerfile with hadolint + run: | + $(git rev-parse --show-toplevel)/bin/lint.sh + + - name: Install QEMU static binaries + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build locally for testing + uses: docker/bake-action@v4 + with: + workdir: ${{ matrix.image }} + targets: local + load: true + + - name: Run tests on the image with cinc-auditor + run: | + $(git rev-parse --show-toplevel)/bin/test.sh "docker.io/boxcutter/cinc:current" "/bin/sh" + + - name: Login to DockerHub + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + username: ${{ secrets.CONTAINER_REGISTRY_USERNAME }} + password: ${{ secrets.CONTAINER_REGISTRY_PASSWORD }} + + - name: Build and push + uses: docker/bake-action@v4 + with: + workdir: hadolint + push: ${{ github.event_name != 'pull_request' }} + + - name: Get the image description + if: github.event_name != 'pull_request' + id: image_description + run: | + echo "image_description=$(docker buildx bake --print 2> /dev/null | jq -r '.target.release.labels."org.opencontainers.image.description"')" >> $GITHUB_ENV + + - name: Update Docker Hub Description + if: github.event_name != 'pull_request' + uses: peter-evans/dockerhub-description@v3 + with: + username: ${{ secrets.CONTAINER_REGISTRY_USERNAME }} + password: ${{ secrets.CONTAINER_DESCRIPTION_PASSWORD }} + repository: boxcutter/cinc + short-description: ${{ env.image_description }} + readme-filepath: cinc/cinc/README.md diff --git a/cinc/cinc/.dockerignore b/cinc/cinc/.dockerignore index d90619b..3388ca5 100644 --- a/cinc/cinc/.dockerignore +++ b/cinc/cinc/.dockerignore @@ -1,4 +1,3 @@ README.md -Polly.toml test/ rpm.metadata.json diff --git a/cinc/cinc/Containerfile b/cinc/cinc/Containerfile index 84c3aa7..7f1f65e 100644 --- a/cinc/cinc/Containerfile +++ b/cinc/cinc/Containerfile @@ -1,15 +1,11 @@ # syntax=docker/dockerfile:1 ARG CONTAINER_REGISTRY=docker.io -FROM $CONTAINER_REGISTRY/busybox:1.36.0 +FROM $CONTAINER_REGISTRY/busybox:1.36.1 -LABEL \ - org.opencontainers.image.source="https://github.com/boxcutter/oci" \ - org.opencontainers.image.licenses="Apache-2.0" \ - org.opencontainers.image.description="Cinc Client is an automation platform built from Chef Infra" - -ARG VERSION=18.2.7 -ARG SHA256_AMD64=0b6424931f8ace5fc1010f4c22d63e464f155f5227c6c30d8994b5e0341f6ac3 -ARG SHA256_AARCH64=4701f352f0571c4386d2978f81b2cda68de124e8dbc553b364c80e710ca94592 +ARG CINC_URL_AMD64="http://ftp-osl.osuosl.org/pub/cinc/files/stable/cinc/${VERSION}/el/7/cinc-18.2.7-1.el7.x86_64.rpm" +ARG CINC_SHA256_AMD64="0b6424931f8ace5fc1010f4c22d63e464f155f5227c6c30d8994b5e0341f6ac3" +ARG CINC_URL_ARM64="http://ftp-osl.osuosl.org/pub/cinc/files/stable/cinc/${VERSION}/el/7/cinc-18.2.7-1.el7.aarch64.rpm" +ARG CINC_SHA256_ARM64="4701f352f0571c4386d2978f81b2cda68de124e8dbc553b364c80e710ca94592" # This argument is automatically populated by BuildKit ARG TARGETARCH @@ -18,12 +14,12 @@ ARG TARGETARCH RUN <