Skip to content

Commit

Permalink
Environment Vars
Browse files Browse the repository at this point in the history
Moving them to code pipeline action definitions.
  • Loading branch information
ChrisPates committed Jun 8, 2022
1 parent 3d7671e commit 02c1b78
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 16 deletions.
14 changes: 13 additions & 1 deletion cicd/cloudformation/pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,12 @@ Resources:
EnvironmentVariables:
- Name: ARTIFACT_S3_BUCKET
Value: !Sub ${CodePipelineArtifactS3Bucket}
- Name: GO_VERSION
Value: "1.18.1"
- Name: OUTPUT
Value: main
- Name: APP_NAME
Value: ssosync
Artifacts:
Name: !Ref ApplicationName
Type: CODEPIPELINE
Expand All @@ -220,6 +226,12 @@ Resources:
Value: !Sub ${CodePipelineArtifactS3Bucket}
- Name: S3Bucket
Value: !Ref StagingS3Bucket
- Name: Template
Value: template.yaml
- Name: Packaged
Value: packaged-staging.yaml
- Name: APP_NAME
Value: ssosync
Artifacts:
Name: !Ref ApplicationName
Type: CODEPIPELINE
Expand Down Expand Up @@ -273,7 +285,7 @@ Resources:
"Action": [
"lambda:InvokeFunction"
],
"Resource": "arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:${SARPublishApp}",
"Resource": "${SARPublishApp.Outputs.ServerlessRepoPublishFunctionArn}",
"Effect": "Allow"
},
{
Expand Down
7 changes: 1 addition & 6 deletions cicd/codebuild/buildgo.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
version: 0.2

env:
variables:
GO_VERSION: "1.18.1"
OUTPUT: main
APP_NAME: ssosync
phases:
install:
commands:
# Install go.lang
- wget https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz
- wget -q https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz
- tar -C / -xzf go${GO_VERSION}.linux-amd64.tar.gz
- export PATH="/go/bin:$PATH" && export GOPATH="/go" && export PATH="$GOPATH/bin:$PATH"
- rm go${GO_VERSION}.linux-amd64.tar.gz
Expand Down
13 changes: 4 additions & 9 deletions cicd/codebuild/buildsam.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,26 @@
version: 0.2

env:
variables:
TEMPLATE: template.yaml
PACKAGED_TEMPLATE: packaged.yaml
APP_NAME: ssosync
phases:
install:
commands:
# Print all environment variables (handy for AWS CodeBuild logs)
- env

# Update sam to latest version
- wget https://github.com/aws/aws-sam-cli/releases/latest/download/aws-sam-cli-linux-x86_64.zip
- unzip aws-sam-cli-linux-x86_64.zip -d sam-installation
- wget -q https://github.com/aws/aws-sam-cli/releases/latest/download/aws-sam-cli-linux-x86_64.zip
- unzip -q aws-sam-cli-linux-x86_64.zip -d sam-installation
- sudo ./sam-installation/install --update
- rm -rf ./sam-installation aws-sam-cli-linux-x86_64.zip

build:
commands:
# Package our application with AWS SAM
- sam package --s3-bucket ${S3BUCKET}
- sam package --s3-bucket ${S3Bucket} --output-template-file ${Packaged}

post_build:
commands:
- ls -la

artifacts:
files:
- packaged.yaml
- ${Packaged}

0 comments on commit 02c1b78

Please sign in to comment.