Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: better app tests #109

Merged
merged 1 commit into from
Oct 26, 2024
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
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
Loading