Skip to content

Commit

Permalink
Perhaps fix docker issues in containerized build steps.
Browse files Browse the repository at this point in the history
  • Loading branch information
Eddie Peters committed Jun 29, 2022
1 parent 6be9a8e commit b50b1af
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 14 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions .github/workflows/release-release.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions .github/workflows/release.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions .github/workflows/upgrade-main.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions .github/workflows/upgrade-release.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 24 additions & 14 deletions .projenrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,28 @@ const project = new awscdk.AwsCdkConstructLibrary({
});

project.addDevDeps('@types/jest@^27.0.0', 'prettier-eslint');
// Add environment specification that causes the release workflow to run in the context of the "npm" GitHub environment,
// which contains the required NPM_TOKEN
project
.tryFindObjectFile('.github/workflows/release-release.yml')
.addOverride('jobs.release_npm.environment', 'npm');
project
.tryFindObjectFile('.github/workflows/release.yml')
.addOverride('jobs.release_npm.environment', 'npm');
project
.tryFindObjectFile('.github/workflows/release-release.yml')
.addOverride('jobs.release_pypi.environment', 'pypi');
project
.tryFindObjectFile('.github/workflows/release.yml')
.addOverride('jobs.release_pypi.environment', 'pypi');
const releaseWorkflowFiles = [
project.tryFindObjectFile('.github/workflows/release-release.yml'),
project.tryFindObjectFile('.github/workflows/release.yml'),
];
const buildWorkflowFiles = [
project.tryFindObjectFile('.github/workflows/build.yml'),
];
const upgradeWorkflowFiles = [
project.tryFindObjectFile('.github/workflows/upgrade-release.yml'),
project.tryFindObjectFile('.github/workflows/upgrade-main.yml'),
];
const dockerSocketVolumes = ['/var/run/docker.sock:/var/run/docker.sock'];

releaseWorkflowFiles.forEach((f) => {
// Add environment specification that causes the release workflow to run in the context of the "npm" GitHub environment,
// which contains the required NPM_TOKEN, and do the same for PyPI
f.addOverride('jobs.release_npm.environment', 'npm');
f.addOverride('jobs.release_pypi.environment', 'pypi');
// Give access to the docker daemon from inside the container this job runs in
// so that it can build CDK assets
f.addOverride('jobs.release.container.volumes', dockerSocketVolumes);
});
buildWorkflowFiles.forEach((f) => f.addOverride('jobs.build.container.volumes', dockerSocketVolumes));
upgradeWorkflowFiles.forEach((f) => f.addOverride('jobs.upgrade.container.volumes', dockerSocketVolumes));
project.synth();

0 comments on commit b50b1af

Please sign in to comment.