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: 7 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.git
.vscode
**/.idea
**/*.iml
**/target
**/hs_err_pid*
**/replay_pid*
25 changes: 20 additions & 5 deletions .github/workflows/cd-auditservice.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,47 @@ on:
- main
paths:
- '.github/workflows/cd-auditservice.yml'
- '.dockerignore'
- 'pom.xml'
- 'auditlog/**'
- 'shiftcontrol-lib/**'

env:
IMAGE_NAME: shiftcontrol/auditservice
DOCKERFILE_PATH: ./auditlog/Dockerfile
NATIVE_DOCKERFILE_PATH: ./auditlog/Dockerfile.native

jobs:
build-and-publish:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Login to GitHub Container Registry
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v2
- name: Build and push JVM Docker image
uses: docker/build-push-action@v6
with:
context: ./
file: ${{ env.DOCKERFILE_PATH }}
push: true
tags: ghcr.io/pilotwhale-os/${{ env.IMAGE_NAME }}:latest
tags: ghcr.io/pilotwhale-os/${{ env.IMAGE_NAME }}:latest
cache-from: type=gha,scope=auditservice-jvm
cache-to: type=gha,mode=max,scope=auditservice-jvm

- name: Build and push native Docker image
uses: docker/build-push-action@v6
with:
context: ./
file: ${{ env.NATIVE_DOCKERFILE_PATH }}
push: true
tags: ghcr.io/pilotwhale-os/${{ env.IMAGE_NAME }}:latest-native
cache-from: type=gha,scope=auditservice-native
cache-to: type=gha,mode=max,scope=auditservice-native
26 changes: 21 additions & 5 deletions .github/workflows/cd-shiftservice.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,48 @@ on:
- main
paths:
- '.github/workflows/cd-shiftservice.yml'
- '.dockerignore'
- 'pom.xml'
- 'pretalx-client/**'
- 'shiftservice/**'
- 'shiftcontrol-lib/**'

env:
IMAGE_NAME: shiftcontrol/shiftservice
DOCKERFILE_PATH: ./shiftservice/Dockerfile
NATIVE_DOCKERFILE_PATH: ./shiftservice/Dockerfile.native

jobs:
build-and-publish:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Login to GitHub Container Registry
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v2
- name: Build and push JVM Docker image
uses: docker/build-push-action@v6
with:
context: ./
file: ${{ env.DOCKERFILE_PATH }}
push: true
tags: ghcr.io/pilotwhale-os/${{ env.IMAGE_NAME }}:latest
tags: ghcr.io/pilotwhale-os/${{ env.IMAGE_NAME }}:latest
cache-from: type=gha,scope=shiftservice-jvm
cache-to: type=gha,mode=max,scope=shiftservice-jvm

- name: Build and push native Docker image
uses: docker/build-push-action@v6
with:
context: ./
file: ${{ env.NATIVE_DOCKERFILE_PATH }}
push: true
tags: ghcr.io/pilotwhale-os/${{ env.IMAGE_NAME }}:latest-native
cache-from: type=gha,scope=shiftservice-native
cache-to: type=gha,mode=max,scope=shiftservice-native
25 changes: 20 additions & 5 deletions .github/workflows/cd-trustservice.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,47 @@ on:
- main
paths:
- '.github/workflows/cd-trustservice.yml'
- '.dockerignore'
- 'pom.xml'
- 'trustservice/**'
- 'shiftcontrol-lib/**'

env:
IMAGE_NAME: shiftcontrol/trustservice
DOCKERFILE_PATH: ./trustservice/Dockerfile
NATIVE_DOCKERFILE_PATH: ./trustservice/Dockerfile.native

jobs:
build-and-publish:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Login to GitHub Container Registry
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v2
- name: Build and push JVM Docker image
uses: docker/build-push-action@v6
with:
context: ./
file: ${{ env.DOCKERFILE_PATH }}
push: true
tags: ghcr.io/pilotwhale-os/${{ env.IMAGE_NAME }}:latest
tags: ghcr.io/pilotwhale-os/${{ env.IMAGE_NAME }}:latest
cache-from: type=gha,scope=trustservice-jvm
cache-to: type=gha,mode=max,scope=trustservice-jvm

- name: Build and push native Docker image
uses: docker/build-push-action@v6
with:
context: ./
file: ${{ env.NATIVE_DOCKERFILE_PATH }}
push: true
tags: ghcr.io/pilotwhale-os/${{ env.IMAGE_NAME }}:latest-native
cache-from: type=gha,scope=trustservice-native
cache-to: type=gha,mode=max,scope=trustservice-native
92 changes: 92 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,95 @@ jobs:
path: |
**/target/surefire-reports/*.xml
**/target/failsafe-reports/*.xml

shiftservice-native:
name: Shiftservice Native Image
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Build native shiftservice image
run: docker build -f shiftservice/Dockerfile.native -t shiftservice-native:ci .

- name: Smoke test native shiftservice image
run: |
set -euo pipefail
success=0
container_id=$(docker run -d -p 18080:8080 -e SPRING_PROFILES_ACTIVE=openapi shiftservice-native:ci)
cleanup() {
if [ "$success" -ne 1 ]; then
docker logs "$container_id" || true
fi
docker rm -f "$container_id" >/dev/null 2>&1 || true
}
trap cleanup EXIT

for i in {1..90}; do
if curl --silent --fail http://127.0.0.1:18080/v3/api-docs >/dev/null; then
success=1
exit 0
fi
sleep 1
done

echo "Native shiftservice did not become ready in time."
exit 1

trustservice-native:
name: Trustservice Native Image
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Build native trustservice image
run: docker build -f trustservice/Dockerfile.native -t trustservice-native:ci .

- name: Smoke test native trustservice image
run: |
set -euo pipefail
log_file=$(mktemp)
timeout 120s docker run --rm \
-e SPRING_RABBITMQ_LISTENER_SIMPLE_AUTO_STARTUP=false \
-v "$PWD/trustservice/config/application.yml:/app/application.yml:ro" \
trustservice-native:ci 2>&1 | tee "$log_file"

grep -q "Started TrustServiceApplication" "$log_file"

auditservice-native:
name: Auditservice Native Image
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Build native auditservice image
run: docker build -f auditlog/Dockerfile.native -t auditservice-native:ci .

- name: Smoke test native auditservice image
run: |
set -euo pipefail
success=0
container_id=$(docker run -d -p 18089:8080 -e SPRING_PROFILES_ACTIVE=openapi auditservice-native:ci)
cleanup() {
if [ "$success" -ne 1 ]; then
docker logs "$container_id" || true
fi
docker rm -f "$container_id" >/dev/null 2>&1 || true
}
trap cleanup EXIT

for i in {1..90}; do
if curl --silent --fail http://127.0.0.1:18089/v3/api-docs >/dev/null; then
success=1
exit 0
fi
sleep 1
done

echo "Native auditservice did not become ready in time."
exit 1
Loading
Loading