Skip to content

Commit

Permalink
build spec artifact
Browse files Browse the repository at this point in the history
Signed-off-by: Francis <[email protected]>
  • Loading branch information
colifran committed Oct 6, 2023
1 parent 8e86ff3 commit 3cb5858
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/__tests__/signing.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ describe('with standard pipeline', () => {
],
},
Source: {
BuildSpec: '{\n \"version\": \"0.2\",\n \"phases\": {\n \"install\": {\n \"commands\": [\n \"command -v yarn > /dev/null || npm install --global yarn\"\n ]\n },\n \"pre_build\": {\n \"commands\": [\n \"echo \\\"Downloading scripts from s3://${SCRIPT_S3_BUCKET}/${SCRIPT_S3_KEY}\\\"\",\n \"aws s3 cp s3://${SCRIPT_S3_BUCKET}/${SCRIPT_S3_KEY} /tmp\",\n \"mkdir -p /tmp/scriptdir\",\n \"unzip /tmp/$(basename $SCRIPT_S3_KEY) -d /tmp/scriptdir\"\n ]\n },\n \"build\": {\n \"commands\": [\n \"export SCRIPT_DIR=/tmp/scriptdir\",\n \"echo \\\"Running sign.sh\\\"\",\n \"/bin/bash /tmp/scriptdir/sign.sh\"\n ]\n }\n }\n}',
BuildSpec: '{\n \"version\": \"0.2\",\n \"phases\": {\n \"install\": {\n \"commands\": [\n \"command -v yarn > /dev/null || npm install --global yarn\"\n ]\n },\n \"pre_build\": {\n \"commands\": [\n \"echo \\\"Downloading scripts from s3://${SCRIPT_S3_BUCKET}/${SCRIPT_S3_KEY}\\\"\",\n \"aws s3 cp s3://${SCRIPT_S3_BUCKET}/${SCRIPT_S3_KEY} /tmp\",\n \"mkdir -p /tmp/scriptdir\",\n \"unzip /tmp/$(basename $SCRIPT_S3_KEY) -d /tmp/scriptdir\"\n ]\n },\n \"build\": {\n \"commands\": [\n \"export SCRIPT_DIR=/tmp/scriptdir\",\n \"echo \\\"Running sign.sh\\\"\",\n \"/bin/bash /tmp/scriptdir/sign.sh\"\n ]\n }\n },\n \"artifacts\": {\n \"files\": [\n \"**/*\"\n ],\n \"base-directory\": \"dist\"\n }\n}',
Type: 'NO_SOURCE',
},
Cache: {
Expand Down
8 changes: 8 additions & 0 deletions lib/signing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { IRole } from 'aws-cdk-lib/aws-iam';
import { IFunction } from 'aws-cdk-lib/aws-lambda';
import { IBucket } from 'aws-cdk-lib/aws-s3';
import { Construct, IConstruct } from 'constructs';
import { BuildSpec } from './build-spec';
import { AddToPipelineOptions } from './pipeline';
import { LinuxPlatform, Shellable } from './shellable';

Expand Down Expand Up @@ -72,6 +73,13 @@ export class SignNuGetWithSigner extends Construct implements ISigner {
platform: new LinuxPlatform(props.buildImage ?? LinuxBuildImage.fromDockerRegistry('public.ecr.aws/jsii/superchain:1-buster-slim-node18')),
scriptDirectory: path.join(__dirname, 'signing', 'nuget'),
entrypoint: 'sign.sh',
buildSpec: BuildSpec.literal({
version: '0.2',
artifacts: {
files: ['**/*'],
['base-directory']: 'dist',
},
}),
environment,
});

Expand Down

0 comments on commit 3cb5858

Please sign in to comment.