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

CSHARP-5176: Migrate signing to Garasign #1387

Merged
merged 1 commit into from
Jul 24, 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
5 changes: 2 additions & 3 deletions evergreen/evergreen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1020,10 +1020,9 @@ functions:
env:
ARTIFACTORY_PASSWORD: ${ARTIFACTORY_PASSWORD}
ARTIFACTORY_USERNAME: ${ARTIFACTORY_USERNAME}
AZURE_NUGET_SIGN_TENANT_ID: ${AZURE_NUGET_SIGN_TENANT_ID}
AZURE_NUGET_SIGN_CLIENT_ID: ${AZURE_NUGET_SIGN_CLIENT_ID}
AZURE_NUGET_SIGN_CLIENT_SECRET: ${AZURE_NUGET_SIGN_CLIENT_SECRET}
PACKAGE_VERSION: "$PACKAGE_VERSION"
GRS_USERNAME: ${GRS_USERNAME}
GRS_PASSWORD: ${GRS_PASSWORD}
script: |
${PREPARE_SHELL}
. ./evergreen/sign-packages.sh
Expand Down
23 changes: 8 additions & 15 deletions evergreen/sign-packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,15 @@ set -o errexit # Exit the script with error if any of the commands fail
# Environment variables used as input:
# ARTIFACTORY_PASSWORD
# ARTIFACTORY_USERNAME
# AZURE_NUGET_SIGN_TENANT_ID
# AZURE_NUGET_SIGN_CLIENT_ID
# AZURE_NUGET_SIGN_CLIENT_SECRET
# GRS_USERNAME
# GRS_PASSWORD
# PACKAGE_VERSION

echo "${ARTIFACTORY_PASSWORD}" | docker login --password-stdin --username "${ARTIFACTORY_USERNAME}" artifactory.corp.mongodb.com

docker run --platform="linux/amd64" --rm -v $(pwd):/workdir -w /workdir \
artifactory.corp.mongodb.com/release-tools-container-registry-local/azure-keyvault-nuget \
NuGetKeyVaultSignTool sign "artifacts/nuget/*.$PACKAGE_VERSION.nupkg" \
--force \
--file-digest=sha256 \
--timestamp-rfc3161=http://timestamp.digicert.com \
--timestamp-digest=sha256 \
--azure-key-vault-url=https://mdb-authenticode.vault.azure.net \
--azure-key-vault-tenant-id="$AZURE_NUGET_SIGN_TENANT_ID" \
--azure-key-vault-client-secret="$AZURE_NUGET_SIGN_CLIENT_SECRET" \
--azure-key-vault-client-id="$AZURE_NUGET_SIGN_CLIENT_ID" \
--azure-key-vault-certificate=authenticode-2021
echo "GRS_CONFIG_USER1_USERNAME=${GRS_USERNAME}" >> "signing-envfile"
echo "GRS_CONFIG_USER1_PASSWORD=${GRS_PASSWORD}" >> "signing-envfile"

docker run --platform="linux/amd64" --env-file=signing-envfile --rm -v $(pwd):/workdir -w /workdir \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could be simplified a little by using -e option to provide each environment variable instead --env-file

artifactory.corp.mongodb.com/release-tools-container-registry-local/garasign-jsign \
/bin/bash -c "jsign --tsaurl "http://timestamp.digicert.com" -a mongo-authenticode-2021 "./artifacts/nuget/*.$PACKAGE_VERSION.nupkg""