diff --git a/buildspec.yml b/buildspec.yml index 9486828..f171bc9 100644 --- a/buildspec.yml +++ b/buildspec.yml @@ -1,34 +1,39 @@ version: 0.2 +env: + secrets-manager: + GITHUB_PRIVATE_KEY: "GITHUB_CREDENTIALS:PRIVATE_KEY" + GITHUB_PUBLIC_KEY: "GITHUB_CREDENTIALS:PUBLIC_KEY" + phases: install: runtime-versions: nodejs: 14 commands: + # Copy keys for accessing GitHub (to download a fork of dynamodb-toolbox) + - echo $GITHUB_PRIVATE_KEY | base64 --decode > ~/.ssh/id_ed25519 + - echo $GITHUB_PUBLIC_KEY | base64 --decode > ~/.ssh/id_ed25519.pub + - chmod 600 ~/.ssh/id_ed25519 + - eval "$(ssh-agent -s)" + + # Upgrade npp to the latest version. Default version has a bug ('dist' folder is not downloaded in some cases). + - npm install -g npm # Upgrade AWS CLI to the latest version - pip install --upgrade awscli + # Install DynamoDbLocal image for running unit tests - docker run -p 8000:8000 -d public.ecr.aws/p7c5q3n4/amazon/dynamodb-local:latest - - make install - + # Install all packages + - make install pre_build: commands: - cd $CODEBUILD_SRC_DIR - make test - build: commands: - cd $CODEBUILD_SRC_DIR - make deploy BUCKET_FOR_LAMBDAS=$BUCKET_FOR_LAMBDAS STAGE=$STAGE INTEGRATION_API_KEY=$INTEGRATION_API_KEY - - post_build: - commands: - -artifacts: - files: - - template-export.yaml - - product-catalog/template-export.yaml \ No newline at end of file