Skip to content
Merged
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "weekly"
2 changes: 2 additions & 0 deletions .github/workflows/build-test-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ jobs:
SNAPSHOT: ${{ github.event.inputs.snapshot || '' }}
IMAGE_REPO_OPERATON: ${{ vars.IMAGE_REPO_OPERATON }}
IMAGE_REPO_TOMCAT: ${{ vars.IMAGE_REPO_TOMCAT }}
IMAGE_REPO_WILDFLY: ${{ vars.IMAGE_REPO_WILDFLY }}
Comment thread
kthoms marked this conversation as resolved.
- name: Test
run: ./test.sh
working-directory: test
Expand All @@ -80,6 +81,7 @@ jobs:
SNAPSHOT: ${{ github.event.inputs.snapshot || '' }}
IMAGE_REPO_OPERATON: ${{ vars.IMAGE_REPO_OPERATON }}
IMAGE_REPO_TOMCAT: ${{ vars.IMAGE_REPO_TOMCAT }}
IMAGE_REPO_WILDFLY: ${{ vars.IMAGE_REPO_WILDFLY }}
publish:
runs-on: ubuntu-24.04
needs: build-and-test
Comment thread
kthoms marked this conversation as resolved.
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/pull-request-build-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Build and Test
on:
pull_request:
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

since dependabot creates new pull requests, maybe it makes sense to test the containers with changes applied by dependabot. therefore this new pipeline is created - currently it only tests the operaton on amd64, since I noticed in the other pipelines that this particular image is always tested. Is it OK like this, or we need to test all three dirstros on both amd64 and arm64 platforms?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We need to be sure that all distros are working on upstream dependency changes, especially when the distro is changing itself. IMO the regular build does this already.
This workflow tests when PRs are created on the operaton-docker repo itself. This is for example when dependencies like the base image is changing. I assume that we do not test all platforms, amd64 is enough. But the different distros could make sense.
I do not expect frequent PRs on this repo, then running 2 more build are not a problem. And we gain some safety.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I'm including the 3 ditros for testing only on amd64 - about that env variables issue, it seems that it's a security fature from Github, the secrets and environment variables are not exposed when the pipeline is triggered by a fork-repo, it makes sense because so a 3rd uknown fork can read the env vars and secrets by having a new workflow. I used hard-coded values for the repo-urls for testing, because: a) they're anyways fixed b) for container tests which are not pushed, we don't need real repo urls

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

a follow up update: here I could enable testing for operaton and tomcat distros on amd64 - the container for wildfly seems to have problems which needs to be addressed separately. I have created the issue #22 to fix that issue

branches:
- main
jobs:
build-and-test:
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
DISTRO: ["run", "tomcat"]
PLATFORM: ["amd64"]
env:
DISTRO: ${{ matrix.DISTRO }}
PLATFORM: ${{ matrix.PLATFORM }}
VERSION: 1.0.0-beta-4
SNAPSHOT: false
IMAGE_REPO_OPERATON: operaton/operaton
IMAGE_REPO_TOMCAT: operaton/tomcat
IMAGE_REPO_WILDFLY: operaton/wildfly
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
if: ${{ matrix.PLATFORM != 'amd64' }}
with:
platforms: ${{ matrix.PLATFORM }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Expose GitHub Runtime
uses: actions/github-script@v7
with:
script: |
Object.keys(process.env).forEach(function (key) {
if (key.startsWith('ACTIONS_')) {
core.info(`${key}=${process.env[key]}`);
core.exportVariable(key, process.env[key]);
}
});
- name: Build
run: ./pipeline.sh
- name: Test
run: ./test.sh
working-directory: test
2 changes: 2 additions & 0 deletions test/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ if [ "$DISTRO" == "run" ]; then
IMAGE_NAME=${IMAGE_REPO_OPERATON}:${PLATFORM}
elif [ "$DISTRO" == "tomcat" ]; then
IMAGE_NAME=${IMAGE_REPO_TOMCAT}:${PLATFORM}
elif [ "$DISTRO" == "wildfly" ]; then
IMAGE_NAME=${IMAGE_REPO_WILDFLY}:${PLATFORM}
fi

export IMAGE_NAME
Expand Down