Skip to content

Commit

Permalink
Adding version number as part of the artifact names
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasm-ttd committed Mar 19, 2024
1 parent a66d5d9 commit 7514878
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 37 deletions.
37 changes: 14 additions & 23 deletions .github/workflows/publish-all-operators.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,44 +111,35 @@ jobs:
runs-on: ubuntu-latest
needs: [start, buildPublic, buildGCP, buildAzure, buildAWS]
steps:
- name: Download public artifacts
- name: Download public manifest
uses: actions/download-artifact@v4
with:
name: image-details
path: ./artifacts/public_operator
pattern: image-*
path: ./manifests/public_operator

- name: Download GCP artifacts
- name: Download GCP manifest
uses: actions/download-artifact@v4
with:
name: gcp-oidc-deployment-files
path: ./artifacts/gcp_oidc_operator
pattern: enclave_id*
path: ./manifests/gcp_oidc_operator

- name: Download Azure artifacts
- name: Download Azure manifest
uses: actions/download-artifact@v4
with:
name: azure-cc-deployment-files
path: ./artifacts/azure_cc_operator
pattern: azure-cc-operator-digest*
path: ./manifests/azure_cc_operator

- name: Download AWS artifacts
- name: Download AWS manifest
uses: actions/download-artifact@v4
with:
name: aws-nitro-deployment-files
path: ./artifacts/aws_nitro_operator

- name: Delete staging artifacts
uses: geekyeggo/delete-artifact@v4
with:
name: |
image-details
gcp-oidc-deployment-files
azure-cc-deployment-files
aws-nitro-deployment-files
pattern: '*-enclave-id*'
path: ./manifests/aws_nitro_operator

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: uid2-operator-release-${{ needs.start.outputs.new_version }}
path: ./artifacts/
name: uid2-operator-release-${{ needs.start.outputs.new_version }}-manifests
path: ./manifests/

release:
name: Create Release
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/publish-aws-nitro-enclave-docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,9 @@ jobs:
run: |
mkdir -p ${{ env.ARTIFACTS_BASE_OUTPUT_DIR }}/manifests
touch ${{ env.ARTIFACTS_BASE_OUTPUT_DIR }}/manifests/uid2-enclave-id.txt
echo ${{ steps.build_uid2_eif.outputs.enclave_id }} >> ${{ env.ARTIFACTS_BASE_OUTPUT_DIR }}/manifests/uid2-enclave-id.txt
echo ${{ steps.build_uid2_eif.outputs.enclave_id }} >> ${{ env.ARTIFACTS_BASE_OUTPUT_DIR }}/manifests/uid2-enclave-id-${{ steps.version.outputs.new_version }}.txt
touch ${{ env.ARTIFACTS_BASE_OUTPUT_DIR }}/manifests/euid-enclave-id.txt
echo ${{ steps.build_euid_eif.outputs.enclave_id }} >> ${{ env.ARTIFACTS_BASE_OUTPUT_DIR }}/manifests/euid-enclave-id.txt
echo ${{ steps.build_euid_eif.outputs.enclave_id }} >> ${{ env.ARTIFACTS_BASE_OUTPUT_DIR }}/manifests/euid-enclave-id-${{ steps.version.outputs.new_version }}.txt
- name: Save Manifests as build artifacts
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -178,6 +178,6 @@ jobs:
files: |
${{ env.ARTIFACTS_BASE_OUTPUT_DIR }}/uid2-nitro-deployment-artifacts-${{ steps.version.outputs.new_version }}.zip
${{ env.ARTIFACTS_BASE_OUTPUT_DIR }}/euid-nitro-deployment-artifacts-${{ steps.version.outputs.new_version }}.zip
${{ env.ARTIFACTS_BASE_OUTPUT_DIR }}/manifests/uid2-enclave-id.txt
${{ env.ARTIFACTS_BASE_OUTPUT_DIR }}/manifests/euid-enclave-id.txt
${{ env.ARTIFACTS_BASE_OUTPUT_DIR }}/manifests/uid2-enclave-id-${{ steps.version.outputs.new_version }}.txt
${{ env.ARTIFACTS_BASE_OUTPUT_DIR }}/manifests/euid-enclave-id-${{ steps.version.outputs.new_version }}.txt
3 changes: 2 additions & 1 deletion .github/workflows/publish-azure-cc-enclave-docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ jobs:
IMAGE: ${{ steps.meta.outputs.tags }}
OUTPUT_DIR: ${{ env.ARTIFACTS_OUTPUT_DIR }}
MANIFEST_DIR: ${{ env.MANIFEST_OUTPUT_DIR }}
VERSION_NUMBER: ${{ steps.version.outputs.new_version }}
run: |
bash ./scripts/azure-cc/deployment/generate-deployment-artifacts.sh
Expand Down Expand Up @@ -256,7 +257,7 @@ jobs:
draft: true
files: |
${{ env.ARTIFACTS_OUTPUT_DIR }}/uid2-operator-deployment-artifacts-${{ steps.meta.outputs.version }}.zip
${{ env.MANIFEST_OUTPUT_DIR }}/azure-cc-operator-digest.txt
${{ env.MANIFEST_OUTPUT_DIR }}/azure-cc-operator-digest-${{ steps.meta.outputs.version }}.txt
e2e:
name: E2E
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/publish-gcp-oidc-enclave-docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -248,20 +248,21 @@ jobs:
IMAGE_DIGEST: ${{ steps.push-to-docker.outputs.digest }}
OUTPUT_DIR: ${{ env.ARTIFACTS_OUTPUT_DIR }}
MANIFEST_DIR: ${{ env.MANIFEST_OUTPUT_DIR}}
VERSION_NUMBER: ${{ steps.version.outputs.new_version }}
run: |
bash ./scripts/gcp-oidc/generate-deployment-artifacts.sh
- name: Upload deployment artifacts
uses: actions/upload-artifact@v4
with:
name: gcp-oidc-deployment-files
name: gcp-oidc-deployment-files-${{ steps.meta.outputs.version }}
path: ${{ env.ARTIFACTS_OUTPUT_DIR }}
if-no-files-found: error

- name: Upload manifest artifacts
uses: actions/upload-artifact@v4
with:
name: gcp-oidc-enclave-ids
name: gcp-oidc-enclave-ids-${{ steps.meta.outputs.version }}
path: ${{ env.MANIFEST_OUTPUT_DIR }}
if-no-files-found: error

Expand Down Expand Up @@ -292,8 +293,8 @@ jobs:
draft: true
files: |
${{ env.ARTIFACTS_OUTPUT_DIR }}/uid2-operator-deployment-artifacts-${{ steps.meta.outputs.version }}.zip
${{ env.MANIFEST_OUTPUT_DIR }}/enclave_id.txt
${{ env.MANIFEST_OUTPUT_DIR }}/enclave_id_debug.txt
${{ env.MANIFEST_OUTPUT_DIR }}/enclave_id_${{ steps.meta.outputs.version }}.txt
${{ env.MANIFEST_OUTPUT_DIR }}/enclave_id_debug_${{ steps.meta.outputs.version }}.txt
e2e:
name: E2E
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-public-operator-docker-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ jobs:
mkdir -p image-details
IMAGE_TAG=${{ needs.image.outputs.image_tag }}
IMAGE=$(jq -n --arg img "$IMAGE_TAG" '{image_tag: $img}')
echo $IMAGE > image-details/image.json
echo $IMAGE > image-details/image_$IMAGE_TAG.json
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: image-details
name: image_${{ needs.image.outputs.image_tag }}
path: image-details/
3 changes: 2 additions & 1 deletion scripts/azure-cc/deployment/generate-deployment-artifacts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ set -x
# - IMAGE: uid2-operator image
# - OUTPUT_DIR: output directory to store the artifacts
# - MANIFEST_DIR: output directory to store the manifest for the enclave Id
# - VERSION_NUMBER: the version number of the build

SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
INPUT_DIR=${SCRIPT_DIR}
Expand Down Expand Up @@ -75,7 +76,7 @@ if [[ $? -ne 0 ]]; then
exit 1
fi

POLICY_DIGEST_FILE=azure-cc-operator-digest.txt
POLICY_DIGEST_FILE=azure-cc-operator-digest-$VERSION_NUMBER.txt
az confcom acipolicygen --approve-wildcards --template-file ${OUTPUT_DIR}/operator.json > ${MANIFEST_DIR}/${POLICY_DIGEST_FILE}
if [[ $? -ne 0 ]]; then
echo "Failed to generate operator template file"
Expand Down
5 changes: 3 additions & 2 deletions scripts/gcp-oidc/generate-deployment-artifacts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ set -x
# - IMAGE_DIGEST: uid2-operator image digest
# - OUTPUT_DIR: output directory to store the artifacts
# - MANIFEST_DIR: output directory to store the manifest for the enclave Id
# - VERSION_NUMBER: the version number of the build

SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
INPUT_DIR=${SCRIPT_DIR}/terraform
Expand Down Expand Up @@ -59,14 +60,14 @@ if [[ $? -ne 0 ]]; then
fi

# Enclave ID file
echo -n "V1,false,$IMAGE_DIGEST" | openssl dgst -sha256 -binary | openssl base64 > ${MANIFEST_DIR}/enclave_id.txt
echo -n "V1,false,$IMAGE_DIGEST" | openssl dgst -sha256 -binary | openssl base64 > ${MANIFEST_DIR}/enclave_id_$VERSION_NUMBER.txt
if [[ $? -ne 0 ]]; then
echo "Failed to generate non-debug enclave ID file"
exit 1
fi

# Enclave ID file for debug
echo -n "V1,true,$IMAGE_DIGEST" | openssl dgst -sha256 -binary | openssl base64 > ${MANIFEST_DIR}/enclave_id_debug.txt
echo -n "V1,true,$IMAGE_DIGEST" | openssl dgst -sha256 -binary | openssl base64 > ${MANIFEST_DIR}/enclave_id_debug_$VERSION_NUMBER.txt
if [[ $? -ne 0 ]]; then
echo "Failed to generate debug enclave ID file"
exit 1
Expand Down

0 comments on commit 7514878

Please sign in to comment.