Skip to content

Commit

Permalink
ci(e2e): set exact commit sha to use for e2e images
Browse files Browse the repository at this point in the history
Resolves #1146
  • Loading branch information
corneliusroemer committed Feb 26, 2024
1 parent cdc964a commit b308821
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/e2e-k3d.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ jobs:
- name: Deploy with helm
uses: WyriHaximus/github-action-helm3@v3
with:
exec: ./deploy.py helm --branch ${{ github.ref_name }} --dockerconfigjson ${{ secrets.GHCR_DOCKER_CONFIG }}
exec: ./deploy.py helm --branch ${{ github.ref_name }} --sha ${{ github.sha }} --dockerconfigjson ${{ secrets.GHCR_DOCKER_CONFIG }}

- name: Wait for the pods to be ready
run: ./.github/scripts/wait_for_pods_to_be_ready.py
Expand Down
7 changes: 6 additions & 1 deletion deploy.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#!/usr/bin/env python3

import argparse
import os
import subprocess
import time
from pathlib import Path
import os

import yaml

script_path = Path(__file__).resolve()
Expand Down Expand Up @@ -38,6 +39,7 @@
helm_parser.add_argument('--dev', action='store_true',
help='Set up a development environment for running the website and the backend locally')
helm_parser.add_argument('--branch', help='Set the branch to deploy with the Helm chart')
helm_parser.add_argument('--sha', help='Set the commit sha to deploy with the Helm chart')
helm_parser.add_argument('--dockerconfigjson',
help='Set the base64 encoded dockerconfigjson secret for pulling the images')
helm_parser.add_argument('--uninstall', action='store_true', help='Uninstall installation')
Expand Down Expand Up @@ -141,6 +143,9 @@ def handle_helm():
'--set', f"dockerconfigjson={docker_config_json}",
]

if args.sha:
parameters += ['--set', f"sha={args.sha[:7]}"]

if args.dev:
parameters += ['--set', "disableBackend=true"]
parameters += ['--set', "disableWebsite=true"]
Expand Down

0 comments on commit b308821

Please sign in to comment.