5 Commits
Author SHA1 Message Date
morbalint 7474b4303f add e2e to retrigger with privileged 2026-06-21 20:31:05 +02:00
morbalint ba7bacf0e3 confusion 2026-06-21 20:22:52 +02:00
morbalint 9bb7acd567 try non priviledged 2026-06-21 20:15:25 +02:00
morbalint ae8d8d13de add docker build 2026-06-21 19:50:04 +02:00
morbalint beb2b672a9 add simple ci pipeline
ci/woodpecker/pr/woodpecker Pipeline was successful
CI / unit-test-and-lint (pull_request) Has been cancelled
CI / build-fe (pull_request) Has been cancelled
CI / build-e2e (pull_request) Has been cancelled
CI / run-e2e (pull_request) Has been cancelled
2026-06-21 18:07:45 +02:00
3 changed files with 87 additions and 91 deletions
-91
View File
@@ -1,91 +0,0 @@
when:
- event: [push, manual, pull_request]
branch: [main]
services:
docker:
image: docker:28-dind
privileged: true
environment:
DOCKER_TLS_CERTDIR: ""
steps:
prepare-fe-image-tags:
image: alpine:3.21
commands:
- |
COMMIT_SHA="${CI_COMMIT_SHA:-${CI_COMMIT:-${DRONE_COMMIT_SHA:-${DRONE_COMMIT:-}}}}"
if [ -n "$COMMIT_SHA" ]; then
IMAGE_TAG="$(printf '%s' "$COMMIT_SHA" | cut -c1-8)"
else
REF_NAME="${CI_COMMIT_REF:-${CI_COMMIT_BRANCH:-manual}}"
REF_NAME="${REF_NAME#refs/heads/}"
REF_NAME="$(printf '%s' "$REF_NAME" | sed 's#[^A-Za-z0-9_.-]#-#g')"
IMAGE_TAG="$(printf '%s' "${REF_NAME:-manual}-${CI_PIPELINE_NUMBER:-0}" | cut -c1-32)"
fi
echo "Using frontend image tag: $IMAGE_TAG"
printf '%s\n' "$IMAGE_TAG" > .fe-tags
printf '%s\n' "latest" >> .fe-tags
printf '%s\n' "$IMAGE_TAG" > .e2e-tags
printf '%s\n' "latest" >> .e2e-tags
build-and-push-fe-image:
image: docker.io/woodpeckerci/plugin-docker-buildx:latest
privileged: true
depends_on:
- prepare-fe-image-tags
settings:
registry: git.cluster.lab.kemkas.hu
repo: git.cluster.lab.kemkas.hu/${CI_REPO}
context: frontend
dockerfile: frontend/Dockerfile
tags_file: .fe-tags
username:
from_secret: gitea_packages_username
password:
from_secret: gitea_packages_token
build-and-push-e2e-image:
image: docker.io/woodpeckerci/plugin-docker-buildx:latest
privileged: true
depends_on:
- prepare-fe-image-tags
settings:
registry: git.cluster.lab.kemkas.hu
repo: git.cluster.lab.kemkas.hu/${CI_REPO}-e2e
context: e2e
dockerfile: e2e/Dockerfile
tags_file: .e2e-tags
username:
from_secret: gitea_packages_username
password:
from_secret: gitea_packages_token
run-e2e:
image: docker:28-cli
privileged: true
depends_on:
- build-and-push-fe-image
- build-and-push-e2e-image
environment:
DOCKER_HOST: tcp://docker:2375
DOCKER_TLS_CERTDIR: ""
GITEA_PACKAGES_USERNAME:
from_secret: gitea_packages_username
GITEA_PACKAGES_TOKEN:
from_secret: gitea_packages_token
GHCR_IO_REGISTRY_USERNAME:
from_secret: ghcr_io_registry_username
GHCR_IO_REGISTRY_TOKEN:
from_secret: ghcr_io_registry_token
commands:
- |
IMAGE_TAG="$(head -n1 .fe-tags)"
export FRONTEND_IMAGE="git.cluster.lab.kemkas.hu/${CI_REPO}:$${IMAGE_TAG}"
export E2E_IMAGE="git.cluster.lab.kemkas.hu/${CI_REPO}-e2e:$${IMAGE_TAG}"
echo "Using image tag: $${IMAGE_TAG}"
printf '%s' "$${GITEA_PACKAGES_TOKEN}" | docker login git.cluster.lab.kemkas.hu -u "$${GITEA_PACKAGES_USERNAME}" --password-stdin
printf '%s' "$${GHCR_IO_REGISTRY_TOKEN}" | docker login ghcr.io -u "$${GHCR_IO_REGISTRY_USERNAME}" --password-stdin
trap 'docker compose -f e2e.docker-compose.yaml down -v --remove-orphans' EXIT
docker compose -f e2e.docker-compose.yaml pull
docker compose -f e2e.docker-compose.yaml up --no-build --abort-on-container-exit --exit-code-from e2e e2e
+27
View File
@@ -0,0 +1,27 @@
when:
- event: [push, manual]
branch: [main]
steps:
prepare-fe-image-tags:
image: alpine:3.21
commands:
- SHORT_SHA="$(echo "$CI_COMMIT_SHA" | cut -c1-8)"
- printf '%s\n' "$SHORT_SHA" > .fe-tags
- printf '%s\n' "latest" >> .fe-tags
build-and-push-fe-image:
image: docker.io/woodpeckerci/plugin-docker-buildx:latest
privileged: true
depends_on:
- prepare-fe-image-tags
settings:
registry: git.cluster.lab.kemkas.hu
repo: git.cluster.lab.kemkas.hu/${CI_REPO}
context: frontend
dockerfile: frontend/Dockerfile
tags_file: .fe-tags
username:
from_secret: gitea_packages_username
password:
from_secret: gitea_packages_token
+60
View File
@@ -0,0 +1,60 @@
when:
- event: [push, manual]
branch: [main]
steps:
prepare-e2e-image-tags:
image: alpine:3.21
commands:
- SHORT_SHA="$(echo "$CI_COMMIT_SHA" | cut -c1-8)"
- printf '%s\n' "$SHORT_SHA" > .e2e-tags
- printf '%s\n' "latest" >> .e2e-tags
build-and-push-e2e-image:
image: docker.io/woodpeckerci/plugin-docker-buildx:latest
privileged: true
depends_on:
- prepare-e2e-image-tags
settings:
registry: git.cluster.lab.kemkas.hu
repo: git.cluster.lab.kemkas.hu/${CI_REPO}-e2e
context: e2e
dockerfile: e2e/Dockerfile
tags_file: .e2e-tags
username:
from_secret: gitea_packages_username
password:
from_secret: gitea_packages_token
run-e2e:
image: docker:28-cli
privileged: true
depends_on:
- build-and-push-e2e-image
environment:
GITEA_PACKAGES_USERNAME:
from_secret: gitea_packages_username
GITEA_PACKAGES_TOKEN:
from_secret: gitea_packages_token
commands:
- SHORT_SHA="$(echo "$CI_COMMIT_SHA" | cut -c1-8)"
- export FRONTEND_IMAGE="git.cluster.lab.kemkas.hu/${CI_REPO}:${SHORT_SHA}"
- export E2E_IMAGE="git.cluster.lab.kemkas.hu/${CI_REPO}-e2e:${SHORT_SHA}"
- docker login git.cluster.lab.kemkas.hu -u "$GITEA_PACKAGES_USERNAME" -p "$GITEA_PACKAGES_TOKEN"
- |
for i in $(seq 1 30); do
if docker manifest inspect "$FRONTEND_IMAGE" >/dev/null 2>&1; then
break
fi
if [ "$i" -eq 30 ]; then
echo "Frontend image not available: $FRONTEND_IMAGE"
exit 1
fi
echo "Waiting for frontend image: $FRONTEND_IMAGE"
sleep 10
done
- trap 'docker compose -f e2e.docker-compose.yaml down -v --remove-orphans' EXIT
- docker compose -f e2e.docker-compose.yaml pull
- docker compose -f e2e.docker-compose.yaml up --no-build --abort-on-container-exit --exit-code-from e2e e2e