-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from voxpupuli/updates
feat: add ci and container build
- Loading branch information
Showing
6 changed files
with
211 additions
and
6 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 |
---|---|---|
@@ -0,0 +1,64 @@ | ||
--- | ||
name: Build and publish a 🛢️ container | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
tags: | ||
- '*' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
setup-matrix: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
matrix: ${{ steps.set-matrix.outputs.matrix }} | ||
steps: | ||
- name: Source checkout | ||
uses: actions/checkout@v4 | ||
|
||
- id: set-matrix | ||
run: echo "matrix=$(cat build_versions.json | jq -c)" >> $GITHUB_OUTPUT | ||
|
||
build-and-push-container: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
needs: setup-matrix | ||
strategy: | ||
matrix: ${{ fromJson(needs.setup-matrix.outputs.matrix) }} | ||
steps: | ||
- name: Build R10K ${{ matrix.rubygem_r10k }} container | ||
uses: voxpupuli/gha-build-and-publish-a-container@v2 | ||
with: | ||
registry_password: ${{ secrets.GITHUB_TOKEN }} | ||
build_args: | | ||
RUBYGEM_R10K=${{ matrix.rubygem_r10k }} | ||
APK_GIT=${{ matrix.apk_git }} | ||
build_arch: linux/amd64,linux/arm64 | ||
docker_username: voxpupulibot | ||
docker_password: ${{ secrets.DOCKERHUB_BOT_PASSWORD }} | ||
build_context: . | ||
buildfile: Dockerfile | ||
tags: | | ||
ghcr.io/voxpupuli/r10k:${{ matrix.rubygem_r10k }}-${{ github.ref_name }} | ||
ghcr.io/voxpupuli/r10k:${{ matrix.rubygem_r10k }}-latest | ||
ghcr.io/voxpupuli/r10k:latest | ||
docker.io/voxpupuli/r10k:${{ matrix.rubygem_r10k }}-${{ github.ref_name }} | ||
docker.io/voxpupuli/r10k:${{ matrix.rubygem_r10k }}-latest | ||
docker.io/voxpupuli/r10k:latest | ||
- name: Update Docker Hub Description | ||
uses: peter-evans/dockerhub-description@v4 | ||
with: | ||
username: voxpupulibot | ||
password: ${{ secrets.DOCKERHUB_BOT_PASSWORD }} | ||
|
||
- name: Update Docker Hub Description for shortname | ||
uses: peter-evans/dockerhub-description@v4 | ||
with: | ||
username: voxpupulibot | ||
password: ${{ secrets.DOCKERHUB_BOT_PASSWORD }} | ||
repository: voxpupuli/r10k |
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,80 @@ | ||
--- | ||
name: CI🚦 | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
|
||
jobs: | ||
setup-matrix: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
matrix: ${{ steps.set-matrix.outputs.matrix }} | ||
steps: | ||
- name: Source checkout | ||
uses: actions/checkout@v4 | ||
|
||
- id: set-matrix | ||
run: echo "matrix=$(jq -c . build_versions.json)" >> $GITHUB_OUTPUT | ||
|
||
# general_ci: | ||
# uses: voxpupuli/crafty/.github/workflows/general_ci.yaml@main | ||
# with: | ||
# shellcheck_scan_dir: '.' | ||
|
||
build_test_container: | ||
name: 'Build test container' | ||
runs-on: ubuntu-latest | ||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
pull-requests: write | ||
needs: setup-matrix | ||
strategy: | ||
matrix: ${{ fromJson(needs.setup-matrix.outputs.matrix) }} | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Build image | ||
uses: docker/build-push-action@v6 | ||
with: | ||
tags: 'ci/r10k:${{ matrix.rubygem_r10k }}' | ||
context: . | ||
push: false | ||
build-args: | | ||
RUBYGEM_R10K=${{ matrix.rubygem_r10k }} | ||
APK_GIT=${{ matrix.apk_git }} | ||
tests: | ||
needs: | ||
# - general_ci | ||
- build_test_container | ||
runs-on: ubuntu-latest | ||
name: Test suite | ||
steps: | ||
- run: echo Test suite completed | ||
|
||
dependabot: | ||
permissions: | ||
contents: write | ||
name: 'Dependabot auto-merge' | ||
needs: | ||
- tests | ||
runs-on: ubuntu-latest | ||
if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}} | ||
steps: | ||
- name: Dependabot metadata | ||
id: metadata | ||
uses: dependabot/[email protected] | ||
with: | ||
github-token: '${{ secrets.GITHUB_TOKEN }}' | ||
|
||
- name: Enable auto-merge for Dependabot PRs | ||
run: gh pr merge --auto --merge "$PR_URL" | ||
env: | ||
PR_URL: ${{github.event.pull_request.html_url}} | ||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} |
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,17 @@ | ||
# How to contribute | ||
|
||
PRs are very welcome! | ||
|
||
## Adding code | ||
|
||
- Create a fork | ||
- Create a branch | ||
- Do your thing | ||
- [Please sign all your commits](https://docs.github.com/de/authentication/managing-commit-signature-verification) | ||
- Create a PR | ||
- Reference issues if applicable | ||
|
||
## Found a bug? | ||
|
||
- Please open an issue | ||
- If you are able to fix it you also can open a PR (see above) |
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,6 +1,7 @@ | ||
FROM alpine:3.20 | ||
|
||
ARG VERSION="4.1.0" | ||
ARG APK_GIT=2.45.2-r0 | ||
ARG RUBYGEM_R10K=5.0.0 | ||
|
||
LABEL org.label-schema.maintainer="Voxpupuli Team <[email protected]>" \ | ||
org.label-schema.vendor="Voxpupuli" \ | ||
|
@@ -10,7 +11,7 @@ LABEL org.label-schema.maintainer="Voxpupuli Team <[email protected]>" \ | |
org.label-schema.vcs-url="https://github.com/voxpupuli/container-r10k" \ | ||
org.label-schema.schema-version="1.0" \ | ||
org.label-schema.dockerfile="/Dockerfile" \ | ||
org.label-schema.version="$VERSION" | ||
org.label-schema.version="$RUBYGEM_R10K" | ||
|
||
# in alpine 3.20 "ping" is the group of id 999 | ||
RUN adduser -G ping -D -u 999 puppet | ||
|
@@ -19,16 +20,16 @@ RUN apk update \ | |
&& apk upgrade \ | ||
&& apk add --no-cache \ | ||
gcc \ | ||
git \ | ||
git=${APK_GIT} \ | ||
libssh2 \ | ||
make \ | ||
musl-dev \ | ||
openssh-client \ | ||
ruby \ | ||
ruby-dev \ | ||
ruby-rugged \ | ||
libssh2-1 | ||
ruby-rugged | ||
|
||
RUN gem install --no-doc r10k:"$VERSION" | ||
RUN gem install --no-doc r10k:"$RUBYGEM_R10K" | ||
|
||
USER puppet | ||
WORKDIR /home/puppet | ||
|
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,8 @@ | ||
{ | ||
"include": [ | ||
{ | ||
"rubygem_r10k": "5.0.0", | ||
"apk_git": "2.45.2-r0" | ||
} | ||
] | ||
} |