Compare commits
14 commits
terraform-
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 3bb1e92d8b | |||
| 298cf5c375 | |||
| 268081b28b | |||
| 9783972537 | |||
| ee976b306e | |||
| a49611f288 | |||
| 9149415575 | |||
| 6a84d5d6f2 | |||
| 0134da8ac7 | |||
| 115300a7e1 | |||
| c57466f628 | |||
| 4e15383d23 | |||
| c2587887a0 | |||
| 5b6f2cfd28 |
6 changed files with 153 additions and 4 deletions
|
|
@ -19,6 +19,7 @@ on:
|
||||||
- cache
|
- cache
|
||||||
- checkout
|
- checkout
|
||||||
- download-artifact
|
- download-artifact
|
||||||
|
- esb-deploy
|
||||||
- helm-deploy
|
- helm-deploy
|
||||||
- i18n-sync
|
- i18n-sync
|
||||||
- inject-content
|
- inject-content
|
||||||
|
|
|
||||||
32
esb-deploy/README.md
Normal file
32
esb-deploy/README.md
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
# esb-deploy
|
||||||
|
|
||||||
|
Deploy a service to an ESB docker host.
|
||||||
|
|
||||||
|
## Inputs
|
||||||
|
|
||||||
|
| Input | Required | Default | Description |
|
||||||
|
|-------|----------|---------|-------------|
|
||||||
|
| `docker-host` | Yes | - | esbdb3.schmalzgroup.net, esbdb4.schmalzgroup.net, esbdb2-stage.schmalzgroup.net|
|
||||||
|
| `java-version` | Yes | 25 | Same as default of the maven-build action |
|
||||||
|
| `maven-profile` | No | `test` | Maven profile to activate during deploy |
|
||||||
|
| `maven-settings` | **Yes** | — | Secret containing the `settings.xml` content used for repository authentication |
|
||||||
|
| `service` | Yes | — | Name of the service to deploy |
|
||||||
|
| `stage` | No | true | If true this is a stage deployment |
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- uses: https://schmalz-git.git.onstackit.cloud/schmalz/shared-actions/esb-deploy@esb-deploy-v1
|
||||||
|
with:
|
||||||
|
service: my-service
|
||||||
|
docker-host: esbdocker2-stage.schmalzgroup.net
|
||||||
|
java-version: 8
|
||||||
|
maven-profile: test
|
||||||
|
maven-settings: ${{ secrets.MAVEN_SETTINGS }}
|
||||||
|
stage: true
|
||||||
|
```
|
||||||
|
|
||||||
|
## Notes
|
||||||
|
|
||||||
|
- The compose files are extracted from variables. They can be provided on the organization or repository level.
|
||||||
|
- The action uses the maven-build action to build the service. The pom.xml has to be in the root directory
|
||||||
64
esb-deploy/action.yml
Normal file
64
esb-deploy/action.yml
Normal file
|
|
@ -0,0 +1,64 @@
|
||||||
|
name: Deploy ESB
|
||||||
|
description: Deploy a service to an ESB docker host.
|
||||||
|
|
||||||
|
inputs:
|
||||||
|
docker-host:
|
||||||
|
description: Docker host to deploy to
|
||||||
|
required: true
|
||||||
|
maven-profile:
|
||||||
|
required: false
|
||||||
|
default: 'test'
|
||||||
|
description: 'Maven profile to use for the build'
|
||||||
|
maven-settings:
|
||||||
|
description: Secret containing the settings.xml content used for repository authentication
|
||||||
|
required: true
|
||||||
|
java-version:
|
||||||
|
description: Java version to use for the build
|
||||||
|
required: true
|
||||||
|
service:
|
||||||
|
description: Name of the service to deploy
|
||||||
|
required: true
|
||||||
|
stage:
|
||||||
|
description: Whether to deploy to stage environment (true) or production environment (false)
|
||||||
|
required: false
|
||||||
|
default: 'true'
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: composite
|
||||||
|
steps:
|
||||||
|
- name: Create compose files
|
||||||
|
shell: bash
|
||||||
|
env:
|
||||||
|
BASE_COMPOSE: ${{ vars.DOCKER_COMPOSE }}
|
||||||
|
SU_COMPOSE: ${{ vars.DOCKER_COMPOSE_SU }}
|
||||||
|
run: |
|
||||||
|
printf '%s\n' "$BASE_COMPOSE" > compose.yml
|
||||||
|
printf '%s\n' "$SU_COMPOSE" > compose-su.yml
|
||||||
|
|
||||||
|
- uses: https://schmalz-git.git.onstackit.cloud/schmalz/shared-actions/maven-build@maven-build-v1
|
||||||
|
with:
|
||||||
|
phase: verify
|
||||||
|
maven-settings: ${{ inputs.maven-settings }}
|
||||||
|
verify-goals: clean package
|
||||||
|
java-version: ${{ inputs.java-version }}
|
||||||
|
maven-profile: ${{ inputs.maven-profile}}
|
||||||
|
|
||||||
|
- name: Compose stage
|
||||||
|
if: ${{ inputs.stage == 'true' }}
|
||||||
|
shell: bash
|
||||||
|
env:
|
||||||
|
SERVICE: ${{ inputs.service }}
|
||||||
|
run: |
|
||||||
|
echo "Deploying $SERVICE to stage environment"
|
||||||
|
export DOCKER_HOST="tcp://${{ inputs.docker-host }}:2375"
|
||||||
|
docker compose -f compose.yml -f compose-su.yml up -d --build --no-deps "$SERVICE"
|
||||||
|
|
||||||
|
- name: Compose prod
|
||||||
|
if: ${{ inputs.stage != 'true' }}
|
||||||
|
shell: bash
|
||||||
|
env:
|
||||||
|
SERVICE: ${{ inputs.service }}
|
||||||
|
run: |
|
||||||
|
echo "Deploying $SERVICE to production environment"
|
||||||
|
export DOCKER_HOST="tcp://${{ inputs.docker-host }}:2375"
|
||||||
|
docker compose -f compose.yml up -d --build --no-deps "$SERVICE"
|
||||||
|
|
@ -94,9 +94,11 @@ runs:
|
||||||
env:
|
env:
|
||||||
VERIFY_GOALS: ${{ inputs.verify-goals }}
|
VERIFY_GOALS: ${{ inputs.verify-goals }}
|
||||||
EXTRA_ARGS: ${{ inputs.extra-args }}
|
EXTRA_ARGS: ${{ inputs.extra-args }}
|
||||||
|
MAVEN_PROFILE: ${{ inputs.maven-profile }}
|
||||||
run: |
|
run: |
|
||||||
mvn --batch-mode $VERIFY_GOALS \
|
mvn --batch-mode $VERIFY_GOALS \
|
||||||
-s /tmp/maven-settings.xml \
|
-s /tmp/maven-settings.xml \
|
||||||
|
-P "$MAVEN_PROFILE" \
|
||||||
$EXTRA_ARGS
|
$EXTRA_ARGS
|
||||||
|
|
||||||
- name: Deploy
|
- name: Deploy
|
||||||
|
|
|
||||||
|
|
@ -12,18 +12,47 @@ Run Playwright E2E tests for one shard and upload the blob report as an artifact
|
||||||
| `jfrog-token` | No | `""` | JFrog npm auth token |
|
| `jfrog-token` | No | `""` | JFrog npm auth token |
|
||||||
| `shard-index` | No | `1` | Current shard index (1-based). Set to `1` when not sharding. |
|
| `shard-index` | No | `1` | Current shard index (1-based). Set to `1` when not sharding. |
|
||||||
| `shard-total` | No | `1` | Total number of shards. Set to `1` to disable sharding. |
|
| `shard-total` | No | `1` | Total number of shards. Set to `1` to disable sharding. |
|
||||||
|
| `no-deps` | No | `false` | Skip dependencies between Playwright projects (e.g. setup/teardown). Passes `--no-deps` to Playwright. |
|
||||||
|
| `projects` | No | `""` | Comma-separated list of Playwright projects to run (e.g. `chromium,firefox,Mobile Chrome`). Leave empty to use the Playwright default. |
|
||||||
| `artifact-retention-days` | No | `3` | Number of days to retain the blob report artifact |
|
| `artifact-retention-days` | No | `3` | Number of days to retain the blob report artifact |
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
|
### Basic
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- uses: https://schmalz-git.git.onstackit.cloud/schmalz/shared-actions/playwright-run@playwright-run-v1
|
- uses: https://schmalz-git.git.onstackit.cloud/schmalz/shared-actions/playwright-run@playwright-run-v1
|
||||||
with:
|
with:
|
||||||
working-directory: frontend
|
working-directory: e2e
|
||||||
node-version: 22
|
node-version: 22
|
||||||
jfrog-token: ${{ secrets.JFROG_TOKEN }}
|
jfrog-token: ${{ secrets.JFROG_TOKEN }}
|
||||||
shard-index: ${{ matrix.shard-index }}
|
```
|
||||||
shard-total: 5
|
|
||||||
|
### Sharded
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
name: "Test Shard ${{ matrix.shard-index }}/${{ matrix.total }}"
|
||||||
|
# Define the matrix strategy on the parent job:
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
total: [5] # The same for all instances
|
||||||
|
shard-index: [1, 2, 3, 4, 5]
|
||||||
|
steps:
|
||||||
|
# ...other steps like checkout repo etc.
|
||||||
|
- name: Run tests
|
||||||
|
uses: https://schmalz-git.git.onstackit.cloud/schmalz/shared-actions/playwright-run@playwright-run-v1
|
||||||
|
with:
|
||||||
|
working-directory: frontend
|
||||||
|
node-version: 22
|
||||||
|
jfrog-token: ${{ secrets.JFROG_TOKEN }}
|
||||||
|
# Matrix data is passed here:
|
||||||
|
shard-index: ${{ matrix.shard-index }}
|
||||||
|
shard-total: ${{ matrix.total }}
|
||||||
|
no-deps: "true"
|
||||||
|
projects: "chromium,firefox,webkit,Mobile Chrome,Mobile Safari"
|
||||||
```
|
```
|
||||||
|
|
||||||
## Notes
|
## Notes
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,14 @@ inputs:
|
||||||
description: Total number of shards. Set to 1 to disable sharding.
|
description: Total number of shards. Set to 1 to disable sharding.
|
||||||
required: false
|
required: false
|
||||||
default: "1"
|
default: "1"
|
||||||
|
no-deps:
|
||||||
|
description: Whether to ignore dependencies between Playwright projects (e.g. setup, teardown)
|
||||||
|
required: false
|
||||||
|
default: false
|
||||||
|
projects:
|
||||||
|
description: Comma-separated list of Playwright projects to include, leave empty to use the Playwright default
|
||||||
|
required: false
|
||||||
|
default: ""
|
||||||
artifact-retention-days:
|
artifact-retention-days:
|
||||||
description: Number of days to retain the blob report artifact
|
description: Number of days to retain the blob report artifact
|
||||||
required: false
|
required: false
|
||||||
|
|
@ -70,12 +78,25 @@ runs:
|
||||||
WORKING_DIR: ${{ inputs.working-directory }}
|
WORKING_DIR: ${{ inputs.working-directory }}
|
||||||
SHARD_INDEX: ${{ inputs.shard-index }}
|
SHARD_INDEX: ${{ inputs.shard-index }}
|
||||||
SHARD_TOTAL: ${{ inputs.shard-total }}
|
SHARD_TOTAL: ${{ inputs.shard-total }}
|
||||||
|
NO_DEPS: ${{ inputs.no-deps }}
|
||||||
|
PROJECTS: ${{ inputs.projects }}
|
||||||
run: |
|
run: |
|
||||||
SHARD_ARG=""
|
SHARD_ARG=""
|
||||||
if [ "${SHARD_TOTAL}" != "1" ]; then
|
if [ "${SHARD_TOTAL}" != "1" ]; then
|
||||||
SHARD_ARG="--shard=${SHARD_INDEX}/${SHARD_TOTAL}"
|
SHARD_ARG="--shard=${SHARD_INDEX}/${SHARD_TOTAL}"
|
||||||
fi
|
fi
|
||||||
pnpm --prefix="${WORKING_DIR}" exec playwright test ${SHARD_ARG} --reporter=blob,dot
|
NO_DEPS_ARG=""
|
||||||
|
if [ "${NO_DEPS}" == "true" ]; then
|
||||||
|
NO_DEPS_ARG="--no-deps"
|
||||||
|
fi
|
||||||
|
PROJECTS_ARG=()
|
||||||
|
if [ -n "${PROJECTS}" ]; then
|
||||||
|
IFS=',' read -ra PROJECT_LIST <<< "${PROJECTS}"
|
||||||
|
for project in "${PROJECT_LIST[@]}"; do
|
||||||
|
PROJECTS_ARG+=("--project=${project}")
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
pnpm --prefix="${WORKING_DIR}" exec playwright test ${SHARD_ARG} ${NO_DEPS_ARG} "${PROJECTS_ARG[@]}" --reporter=blob,dot
|
||||||
|
|
||||||
- name: Upload blob report
|
- name: Upload blob report
|
||||||
if: ${{ !cancelled() }}
|
if: ${{ !cancelled() }}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue