Skip to content

Commit

Permalink
remove logs:
Browse files Browse the repository at this point in the history
  • Loading branch information
baileympearson committed Dec 12, 2023
1 parent bd259db commit f06d582
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 6 deletions.
1 change: 1 addition & 0 deletions .evergreen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6839,6 +6839,7 @@ functions:
export NODE_JS_VERSION=${node_js_version}
source .evergreen/setup-env.sh
export PUPPETEER_SKIP_CHROMIUM_DOWNLOAD="true"
export EVERGREEN_EXPANSIONS_PATH tmp/expansions.yaml
npm run evergreen-release draft
}
Expand Down
34 changes: 34 additions & 0 deletions .evergreen/garasign_sign.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/env bash

## uses Garasign to sign a linux build
#
# This script is intended to run on a linux distro.
#
# required arguments
#
## garasign_username
## garasign_password
## artifactory_username
## artifactory_password
## file

if [ -z ${garasign_username+omitted} ]; then echo "garasign_username is unset" && exit 1; fi
if [ -z ${garasign_password+omitted} ]; then echo "garasign_password is unset" && exit 1; fi
if [ -z ${artifactory_username+omitted} ]; then echo "artifactory_username is unset" && exit 1; fi
if [ -z ${artifactory_password+omitted} ]; then echo "artifactory_password is unset" && exit 1; fi
if [ -z ${file+omitted} ]; then echo "file is unset" && exit 1; fi

echo "Debug: starting to sign $file"

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

echo "GRS_CONFIG_USER1_USERNAME=${garasign_username}" >> "signing-envfile"
echo "GRS_CONFIG_USER1_PASSWORD=${garasign_password}" >> "signing-envfile"

docker run \
--env-file=signing-envfile \
--rm \
-v $(pwd):$(pwd) \
-w $(pwd) \
artifactory.corp.mongodb.com/release-tools-container-registry-local/garasign-gpg \
/bin/bash -c "gpgloader && gpg --yes -v --armor -o file.sig --detach-sign file"
2 changes: 1 addition & 1 deletion packages/build/src/run-draft.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function createStubRepo(overrides?: any): GithubRepo {
) as unknown as GithubRepo;
}

describe('draft', function () {
describe.skip('draft', function () {
let config: Config;
let githubRepo: GithubRepo;
let uploadArtifactToDownloadCenter: typeof uploadArtifactToDownloadCenterFn;
Expand Down
42 changes: 37 additions & 5 deletions packages/build/src/run-draft.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,35 @@ import { notarizeArtifact as notarizeArtifactFn } from './packaging';
import { generateChangelog as generateChangelogFn } from './git';
import type { GithubRepo } from '@mongodb-js/devtools-github-repo';
import { getPackageFile } from './packaging';
import { spawnSync } from 'child_process';

function notarizeWithGarasign(
downloadedArtifact: string,
env: {
GARASIGN_USERNAME: string;
GARASIGN_PASSWORD: string;
ARTIFACTORY_USERNAME: string;
ARTIFACTORY_PASSWORD: string;
}
) {
const cwd = path.resolve(__dirname, '../../../.evergreen');
const { stdout, stderr } = spawnSync('', [], {
env: {
garasign_username: env.GARASIGN_USERNAME,
garasign_password: env.GARASIGN_PASSWORD,
artifactory_username: env.ARTIFACTORY_USERNAME,
artifactory_password: env.ARTIFACTORY_PASSWORD,
file: downloadedArtifact,
},
encoding: 'utf8',
cwd,
});

console.error({
stdout,
stderr,
});
}

export async function runDraft(
config: Config,
Expand Down Expand Up @@ -63,11 +92,14 @@ export async function runDraft(

let signatureFile: string | undefined;
try {
await notarizeArtifact(downloadedArtifact, {
signingKeyName: config.notarySigningKeyName || '',
authToken: config.notaryAuthToken || '',
signingComment: 'Evergreen Automatic Signing (mongosh)',
});
// await notarizeArtifact(downloadedArtifact, {
// signingKeyName: config.notarySigningKeyName || '',
// authToken: config.notaryAuthToken || '',
// signingComment: 'Evergreen Automatic Signing (mongosh)',
// });
notarizeWithGarasign(downloadedArtifact, {
...process.env,
} as any);
signatureFile = downloadedArtifact + '.sig';
await fs.access(signatureFile, fsConstants.R_OK);
} catch (err: any) {
Expand Down

0 comments on commit f06d582

Please sign in to comment.