Skip to content

Commit

Permalink
ci: better app tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fredleger committed Oct 26, 2024
1 parent 68e89f5 commit ed0ae52
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 14 deletions.
16 changes: 15 additions & 1 deletion .github/workflows/__shared-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,15 @@ jobs:
echo "OS_VOLUMES length: ${#OS_VOLUMES}"
docker run --rm -i \
-e DRY_RUN=true \
-e CLEANUP=true \
-e OS_PASSWORD \
-e OS_PROJECT_ID \
-e OS_REGION_NAME \
-e OS_TENANT_ID \
-e OS_TENANT_NAME \
-e OS_USERNAME \
-e OS_VOLUMES \
${IMAGE}
${IMAGE} > output
env:
OS_PASSWORD: ${{ secrets.OS_PASSWORD }}
OS_PROJECT_ID: ${{ secrets.OS_PROJECT_ID }}
Expand All @@ -162,3 +163,16 @@ jobs:
OS_USERNAME: ${{ secrets.OS_USERNAME }}
OS_VOLUMES: ${{ secrets.OS_VOLUMES }}
IMAGE: ghcr.io/${{ github.repository }}/app:${{ fromJson(needs.docker-build-images.outputs.built-images).app.tags[0] }}
- name: show output
run: |
cat output
- name: check if snapshot was created
run: |
echo -n "check if snapshot was created: "
grep -q "would create snapshot $(date +%Y%m%d)" output && echo 'ok'
- name: check if old snapshot will be deleted
run: |
echo -n "check if old snapshot will be deleted: "
grep -q "would remove snapshot with id=" output && echo ok
- name: delete output file
run: rm output
28 changes: 15 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,21 @@ RUN --mount=type=cache,target=~/.cache/pip \

FROM python:3.12-slim-bullseye

ENV PYTHONUNBUFFERED="1"
ENV OS_AUTH_URL=https://auth.cloud.ovh.net/v3/
ENV OS_IDENTITY_API_VERSION="3"
ENV OS_PASSWORD=""
ENV OS_PROJECT_DOMAIN_NAME=Default
ENV OS_PROJECT_ID=""
ENV OS_REGION_NAME=GRA5
ENV OS_TENANT_ID=""
ENV OS_TENANT_NAME=""
ENV OS_USER_DOMAIN_NAME=Default
ENV OS_USERNAME=""
ENV OS_VOLUMES=""
ENV PATH=/root/.local/bin:$PATH
ENV PYTHONUNBUFFERED="1" \
DRY_RUN="false" \
CLEANUP="false" \
OS_AUTH_URL=https://auth.cloud.ovh.net/v3/ \
OS_IDENTITY_API_VERSION="3" \
OS_PASSWORD="" \
OS_PROJECT_DOMAIN_NAME=Default \
OS_PROJECT_ID="" \
OS_REGION_NAME=GRA5 \
OS_TENANT_ID="" \
OS_TENANT_NAME="" \
OS_USER_DOMAIN_NAME=Default \
OS_USERNAME="" \
OS_VOLUMES="" \
PATH=/root/.local/bin:$PATH

COPY --from=builder /root/.local /root/.local
COPY entrypoint.sh /entrypoint.sh
Expand Down

0 comments on commit ed0ae52

Please sign in to comment.