diff --git a/.github/workflows/image-push.yaml b/.github/workflows/image-push.yaml new file mode 100644 index 00000000..22be67a7 --- /dev/null +++ b/.github/workflows/image-push.yaml @@ -0,0 +1,44 @@ +name: Image Push +on: + release: + types: [published] + push: + branches: [main] + workflow_dispatch: {} + +jobs: + image-push: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Determine tags + id: tags + run: | + TAGS="$(git rev-parse --short HEAD)" + if [[ "${{ github.event_name }}" == "push" ]]; then + TAGS="latest ${TAGS}" + fi + if [[ "${{ github.event_name }}" == "release" ]]; then + TAGS="stable ${TAGS} ${{ github.event.release.tag_name }}" + fi + echo "tags=${TAGS}" >> "$GITHUB_OUTPUT" + + - name: Build Forge Image + id: build + uses: redhat-actions/buildah-build@v2 + with: + image: forge + context: . + tags: ${{ steps.tags.outputs.tags }} + containerfiles: | + ./projects/core/image/Containerfile + + - name: Push Forge Image + uses: redhat-actions/push-to-registry@v2 + with: + image: ${{ steps.build.outputs.image }} + tags: ${{ steps.build.outputs.tags }} + registry: quay.io/rh_perfscale + username: ${{ secrets.QUAY_USER }} + password: ${{ secrets.QUAY_TOKEN }} diff --git a/projects/core/ci_entrypoint/fournos_resolve.py b/projects/core/ci_entrypoint/fournos_resolve.py index b115a7b1..01cee093 100644 --- a/projects/core/ci_entrypoint/fournos_resolve.py +++ b/projects/core/ci_entrypoint/fournos_resolve.py @@ -31,12 +31,12 @@ def fetch_fournos_job() -> tuple[str, str, dict]: """ # Get environment variables job_name = os.environ.get("FJOB_NAME") - namespace = os.environ.get("FOURNOS_NAMESPACE") + namespace = os.environ.get("FOURNOS_WORKLOAD_NAMESPACE") if not job_name: raise ValueError("FJOB_NAME environment variable is required") if not namespace: - raise ValueError("FOURNOS_NAMESPACE environment variable is required") + raise ValueError("FOURNOS_WORKLOAD_NAMESPACE environment variable is required") logger.info(f"Fetching FournosJob: {job_name} in namespace: {namespace}") @@ -202,8 +202,8 @@ def create_fournos_resolve_command( ) @click.option( "--namespace", - help="Namespace for the FournosJob (sets FOURNOS_NAMESPACE if provided)", - envvar="FOURNOS_NAMESPACE", + help="Namespace for the FournosJob (sets FOURNOS_WORKLOAD_NAMESPACE if provided)", + envvar="FOURNOS_WORKLOAD_NAMESPACE", ) @click.option( "--dry-run", @@ -218,7 +218,7 @@ def fournos_resolve_command(ctx, fjob_name, namespace, dry_run): if fjob_name: os.environ["FJOB_NAME"] = fjob_name if namespace: - os.environ["FOURNOS_NAMESPACE"] = namespace + os.environ["FOURNOS_WORKLOAD_NAMESPACE"] = namespace # Get vault list from the provided function try: diff --git a/projects/core/library/export.py b/projects/core/library/export.py index 52d2944a..4dcbcaf1 100644 --- a/projects/core/library/export.py +++ b/projects/core/library/export.py @@ -35,7 +35,7 @@ def _update_fjob_export_status(status: dict): import json fjob_name = os.environ["FJOB_NAME"] - namespace = os.environ["FOURNOS_NAMESPACE"] + namespace = os.environ["FOURNOS_WORKLOAD_NAMESPACE"] # Get current fjob status get_cmd = f"oc get fjob/{fjob_name} -n {namespace} -ojson"