Skip to content

Commit 2d6e043

Browse files
committed
PYTHON-5432 Use ECR instead of artifactory
1 parent 58501b8 commit 2d6e043

File tree

12 files changed

+62
-49
lines changed

12 files changed

+62
-49
lines changed

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ used with the `gh` cli.
2626

2727
There is a common setup action that is meant to be run before all
2828
other actions. It handles fetching secrets from AWS Secrets Manager,
29-
signing into Artifactory, setting up Garasign credentials, and
29+
signing into ECR, setting up Garasign credentials, and
3030
setting up environment variables used in other actions.
3131
The action requires `id-token: write` permissions.
3232

@@ -45,9 +45,8 @@ The action requires `id-token: write` permissions.
4545
> `actions/checkout action`
4646
>
4747
> The following keys MUST be defined in the ``AWS_SECRET_ID`` vault:
48-
> `artifactory-username`, `artifactory-password`, `garasign-username`
49-
> `garasign-password`, `gpg-key-id`. If uploading to an S3 bucket, also define
50-
> `release-assets-bucket`.
48+
> `garasign-username`, `garasign-password`, `gpg-key-id`.
49+
> If uploading to an S3 bucket, also define `release-assets-bucket`.
5150

5251
## Signing tools
5352

bump-version/action.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,11 @@ inputs:
1616
working_directory:
1717
description: The working directory for the version bump
1818
default: "."
19+
ecr_repository:
20+
description: "The ECR repository to use"
21+
default: release-infrastructure/garasign-git
1922
artifactory_image:
20-
description: "Image to use for artifactory"
23+
description: "(deprecated) Image to use for artifactory"
2124
default: release-tools-container-registry-local/garasign-git
2225

2326
runs:
@@ -36,10 +39,10 @@ runs:
3639
export COMMIT_MESSAGE=$(echo "${{ inputs.commit_template }}" | envsubst)
3740
echo "COMMIT_MESSAGE=$COMMIT_MESSAGE" >> $GITHUB_ENV
3841
- name: Commit the version bump
39-
uses: mongodb-labs/drivers-github-tools/git-sign@v2
42+
uses: blink1073/drivers-github-tools/git-sign@PYTHON-5432
4043
with:
4144
command: git commit -a -m \"${{ env.COMMIT_MESSAGE }}\" -s --gpg-sign=${{ env.GPG_KEY_ID }}
42-
artifactory_image: ${{ inputs.artifactory_image }}
45+
ecr_repository: ${{ inputs.ecr_repository }}
4346
- name: Push the commit to the source branch
4447
shell: bash -eux {0}
4548
run: |

create-branch/action.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,13 @@ inputs:
2323
release_workflow_path:
2424
description: The path to the release workflow file
2525
default: .github/workflows/release.yml
26+
ecr_repository:
27+
description: "The ECR repository to use"
28+
default: release-infrastructure/garasign-git
29+
# Unused inputs, to be removed in V3.
2630
artifactory_image:
2731
description: Image to use for artifactory
2832
default: artifactory.corp.mongodb.com/release-tools-container-registry-public-local
29-
# Unused inputs, to be removed in V3.
3033
sbom_file_path:
3134
description: The path of the sbom-lite file
3235
default: sbom.json
@@ -43,11 +46,11 @@ runs:
4346
SBOM_FILE_PATH: ${{ inputs.sbom_file_path }}
4447
RELEASE_WORKFLOW_PATH: ${{ inputs.release_workflow_path }}
4548
EVERGREEN_PROJECT: ${{ inputs.evergreen_project }}
46-
ARTIFACTORY_IMAGE: ${{ inputs.artifactory_image }}
4749
run: ${{ github.action_path }}/create-branch.sh
4850
- uses: mongodb-labs/drivers-github-tools/bump-version@v2
4951
with:
5052
version: ${{ inputs.version }}
5153
version_bump_script: ${{ inputs.version_bump_script }}
5254
commit_template: "Prep branch ${{ inputs.branch_name }}"
53-
push_commit: ${{ inputs.push_changes }}
55+
push_commit: ${{ inputs.push_changes }}
56+
ecr_repository: ${{ inputs.ecr_repository }}

full-report/action.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ runs:
3939
using: composite
4040
steps:
4141
- name: Generate Authorized Publication Report
42-
uses: mongodb-labs/drivers-github-tools/authorized-pub@v2
42+
uses: blink1073/drivers-github-tools/authorized-pub@PYTHON-5432
4343
with:
4444
product_name: ${{ inputs.product_name }}
4545
release_version: ${{ inputs.release_version }}
@@ -48,19 +48,19 @@ runs:
4848
- name: Generate SBOM File
4949
# not all packages have third party dependencies, and so not all packages integrate with silk.
5050
if: ${{ inputs.silk_asset_group }} || ${{ inputs.sbom_in_path }}
51-
uses: mongodb-labs/drivers-github-tools/sbom@v2
51+
uses: blink1073/drivers-github-tools/sbom@PYTHON-5432
5252
with:
5353
silk_asset_group: ${{ inputs.silk_asset_group }}
5454
sbom_file_name: ${{ inputs.sbom_file_name }}
5555
kondukto_sub_project: ${{ inputs.kondukto_sub_project }}
5656
sbom_in_path: ${{ inputs.sbom_in_path }}
5757
- name: Generate Sarif File
58-
uses: mongodb-labs/drivers-github-tools/code-scanning-export@v2
58+
uses: blink1073/drivers-github-tools/code-scanning-export@PYTHON-5432
5959
with:
6060
ref: ${{ inputs.sarif_report_target_ref || inputs.release_version }}
6161
output-file: ${{ env.S3_ASSETS }}/code-scanning-alerts.json
6262
- name: Generate Compliance Report
63-
uses: mongodb-labs/drivers-github-tools/compliance-report@v2
63+
uses: blink1073/drivers-github-tools/compliance-report@PYTHON-5432
6464
with:
6565
release_version: ${{ inputs.release_version }}
6666
security_report_location: ${{ inputs.security_report_location }}

git-sign/action.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,23 @@ inputs:
44
command:
55
description: "Command to run inside the container"
66
required: true
7+
ecr_repository:
8+
description: "The ECR repository to use"
9+
default: release-infrastructure/garasign-git
710
artifactory_image:
8-
description: "Image to use for artifactory"
11+
description: "(deprecated) Image to use for artifactory"
912
default: release-tools-container-registry-local/garasign-git
1013

1114
runs:
1215
using: composite
1316
steps:
1417
- name: "Run git command"
1518
run: |
16-
podman run \
19+
docker run \
1720
--env-file=$GARASIGN_ENVFILE \
1821
--rm \
1922
-v $(pwd):$(pwd) \
2023
-w $(pwd) \
21-
${ARTIFACTORY_REGISTRY}/${{ inputs.artifactory_image }} \
24+
${ECR_REGISTRY}/${{ inputs.ecr_repository }} \
2225
/bin/bash -c "gpgloader && ${{ inputs.command }}"
2326
shell: bash

gpg-sign/action.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@ inputs:
44
filenames:
55
description: "File name(s) to sign, can be a glob pattern"
66
required: true
7+
ecr_repository:
8+
description: "The ECR repository to use"
9+
default: release-infrastructure/garasign-git
710
artifactory_image:
8-
description: "Image to use for artifactory"
11+
description: "(deprecated) Image to use for artifactory"
912
default: release-tools-container-registry-local/garasign-gpg
1013

1114
runs:
@@ -24,12 +27,12 @@ runs:
2427
- name: "Create detached signature for file"
2528
shell: bash
2629
run: |
27-
podman run \
30+
docker run \
2831
--env-file=$GARASIGN_ENVFILE \
2932
--rm \
3033
-v $(pwd):$(pwd) \
3134
-w $(pwd) \
32-
${ARTIFACTORY_REGISTRY}/${{ inputs.artifactory_image }} \
35+
${ECR_REGISTRY}/${{ inputs.ecr_repository }} \
3336
/bin/bash -c 'gpgloader && for filename in ${{ inputs.filenames }}; do gpg --detach-sign --armor --output ${filename}.sig ${filename}; done'
3437
3538
- name: "Move the signature files to the release directory"

python/post-publish/action.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,15 @@ runs:
7070
echo "VERSION=$VERSION" >> $GITHUB_ENV
7171
fi
7272
- name: Create detached signature for dist files
73-
uses: mongodb-labs/drivers-github-tools/gpg-sign@v2
73+
uses: blink1073/drivers-github-tools/gpg-sign@PYTHON-5432
7474
with:
7575
filenames: dist/*
7676
- name: Get the evergreen commit
7777
id: evergreen-commit
7878
shell: bash
7979
run: |
8080
echo "commit=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
81-
- uses: mongodb-labs/drivers-github-tools/full-report@v2
81+
- uses: blink1073/drivers-github-tools/full-report@PYTHON-5432
8282
with:
8383
product_name: ${{ inputs.product_name }}
8484
release_version: ${{ env.VERSION }}
@@ -90,7 +90,7 @@ runs:
9090
evergreen_project: ${{ inputs.evergreen_project }}
9191
evergreen_commit: ${{ steps.evergreen-commit.outputs.commit }}
9292
token: ${{ inputs.token }}
93-
- uses: mongodb-labs/drivers-github-tools/upload-s3-assets@v2
93+
- uses: blink1073/drivers-github-tools/upload-s3-assets@PYTHON-5432
9494
with:
9595
version: ${{ env.VERSION }}
9696
product_name: ${{ inputs.product_name }}
@@ -121,7 +121,7 @@ runs:
121121
git clean -dffx
122122
git pull origin ${GITHUB_REF}
123123
- name: Set following version
124-
uses: mongodb-labs/drivers-github-tools/bump-version@v2
124+
uses: blink1073/drivers-github-tools/bump-version@PYTHON-5432
125125
if: inputs.dry_run == 'false'
126126
with:
127127
version: ${{ steps.publish-script.outputs.following_version }}

python/pre-publish/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,15 @@ runs:
6363
echo "VERSION=$VERSION" >> $GITHUB_ENV
6464
fi
6565
- name: Set version
66-
uses: mongodb-labs/drivers-github-tools/bump-version@v2
66+
uses: blink0173/drivers-github-tools/bump-version@PYTHON-5432
6767
if: ${{ inputs.version }}
6868
with:
6969
version: ${{ env.VERSION }}
7070
version_bump_script: ${{ inputs.version_bump_script }}
7171
working_directory: ${{ inputs.working_directory }}
7272
push_commit: ${{ env.PUSH_CHANGES }}
7373
- name: Tag version
74-
uses: mongodb-labs/drivers-github-tools/tag-version@v2
74+
uses: blink0173/drivers-github-tools/tag-version@PYTHON-5432
7575
with:
7676
version: ${{ env.VERSION }}
7777
tag_template: ${{ inputs.tag_template }}

sbom/action.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,13 @@ inputs:
1010
kondukto_sub_project:
1111
description: The Kondukto sub-project name (appended to the branch name)
1212
required: false
13+
ecr_repository:
14+
description: "The ECR repository to use"
15+
default: release-infrastructure/silkbomb:2.0
16+
# No longer used, to be removed in V3.
1317
artifactory_image:
1418
description: Image to use for artifactory
1519
default: artifactory.corp.mongodb.com/release-tools-container-registry-public-local/silkbomb:2.0
16-
# No longer used, to be removed in V3.
1720
silk_asset_group:
1821
description: The Silk Asset Group for the Project
1922
required: false
@@ -26,7 +29,7 @@ runs:
2629
env:
2730
SBOM_IN_PATH: ${{ inputs.sbom_in_path }}
2831
KONDUKTO_SUB_PROJECT: ${{ inputs.kondukto_sub_project }}
29-
ARTIFACTORY_IMAGE: ${{ inputs.artifactory_image }}
32+
ECR_REPOSITORY: ${{ inputs.ecr_repository }}
3033
SBOM_FILE_NAME: ${{ inputs.sbom_file_name }}
3134
run: |
3235
set -eu
@@ -37,14 +40,14 @@ runs:
3740
fi
3841
echo "Generating SBOM file for ${KONDUKTO_BRANCH}..."
3942
echo "Updating SBOM file..."
40-
podman run --platform="linux/amd64" -it --rm -v ${RELEASE_ASSETS}:/pwd -v $(pwd):/repo \
43+
docker run --platform="linux/amd64" -it --rm -v ${RELEASE_ASSETS}:/pwd -v $(pwd):/repo \
4144
--env-file=${KONDUKTO_ENVFILE} \
42-
${ARTIFACTORY_IMAGE} \
45+
${ECR_REGISTRY}/${ECR_REPOSITORY} \
4346
update --sbom-in /repo/${SBOM_IN_PATH} --sbom-out /pwd/cyclonedx.sbom.json --generate-new-serial-number
4447
echo "Augumenting SBOM file..."
45-
podman run --platform="linux/amd64" -it --rm -v ${RELEASE_ASSETS}:/pwd -v $(pwd):/repo \
48+
docker run --platform="linux/amd64" -it --rm -v ${RELEASE_ASSETS}:/pwd -v $(pwd):/repo \
4649
--env-file=${KONDUKTO_ENVFILE} \
47-
${ARTIFACTORY_IMAGE} \
50+
${ECR_REGISTRY}/${ECR_REPOSITORY} \
4851
augment --sbom-in /pwd/cyclonedx.sbom.json --repo ${GITHUB_REPOSITORY} --branch ${KONDUKTO_BRANCH} --sbom-out /pwd/cyclonedx.sbom.json
4952
cp ${RELEASE_ASSETS}/cyclonedx.sbom.json ${S3_ASSETS}/${SBOM_FILE_NAME}
5053
echo "Generating SBOM file for ${KONDUKTO_BRANCH}... done."

setup/action.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,13 @@ inputs:
1010
aws_secret_id:
1111
description: "The name of the aws secret to use"
1212
required: true
13+
ecr_registry:
14+
description: "The ECR registry to use"
15+
default: "901841024863"
1316
artifactory_username:
14-
description: "The artifactory username to be used"
17+
description: "(deprecated) The artifactory username to be used"
1518
artifactory_registry:
16-
description: "Artifactory registry to be used"
19+
description: "(deprecated) Artifactory registry to be used"
1720
default: artifactory.corp.mongodb.com
1821

1922
runs:
@@ -25,6 +28,10 @@ runs:
2528
role-to-assume: ${{ inputs.aws_role_arn }}
2629
role-session-name: release-session
2730
aws-region: ${{ inputs.aws_region_name }}
31+
- name: Log in to ECR
32+
uses: aws-actions/amazon-ecr-login@062b18b96a7aff071d4dc91bc00c4c1a7945b076 # v2
33+
with:
34+
registries: "${{ inputs.ecr_registry }}"
2835
- name: Read secrets from AWS Secrets Manager into environment variables
2936
uses: aws-actions/aws-secretsmanager-get-secrets@5e19ff380d035695bdd56bbad320ca535c9063f2 # v2
3037
with:
@@ -36,7 +43,5 @@ runs:
3643
id: setup
3744
run: ${{ github.action_path }}/setup.sh
3845
env:
39-
ARTIFACTORY_USERNAME_INPUT: ${{ inputs.artifactory_username }}
40-
ARTIFACTORY_REGISTRY: ${{ inputs.artifactory_registry }}
41-
ARTIFACTORY_IMAGE: ${{ inputs.artifactory_image }}
4246
AWS_SECRET_ID: ${{ inputs.aws_secret_id }}
47+
ECR_REGISTRY: ${{ inputs.ecr_registry }}

0 commit comments

Comments
 (0)