Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upstream sync #5

Closed
wants to merge 108 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
108 commits
Select commit Hold shift + click to select a range
1a731bd
Make the lambda timeout setting user configurable
Dermah Dec 23, 2022
517faf9
Updating to GoVersion 1.20.1
ChrisPates Aug 21, 2023
26d1f5e
updates for building with GoLang 1.20.x, enhanced testing
ChrisPates Aug 22, 2023
7657f4c
improve template defaults, various fixes
ChrisPates Aug 22, 2023
98435c9
Add Deletion/Update Policies to ArtifactBucketKey
ChrisPates Sep 6, 2023
63140f5
Update main.yml
chris-bateman Sep 5, 2023
802058d
Update release.yml
chris-bateman Sep 5, 2023
10eff9f
Add missing environment variable to README
waigel Mar 4, 2023
014accf
Update README with lambda SLA warning
joshloke Jul 13, 2023
410be6f
feat: migrate from deprecated go1.x to provided.al2 and use arm64
midu-git Oct 11, 2023
315e85d
Squashed commit of the following:
ChrisPates Oct 25, 2023
4e8aae7
Merge branch 'master' into patch-1
ChrisPates Oct 27, 2023
b1f4499
Merge pull request #113 from Dermah/patch-1
ChrisPates Oct 27, 2023
29b4794
Improving param validation in template
ChrisPates Oct 27, 2023
c531655
Merge branch 'master' into improved-param-validation
ChrisPates Oct 27, 2023
971e99d
Template Fixes
ChrisPates Oct 27, 2023
217e744
Fixes Regexes
ChrisPates Oct 27, 2023
e4e846e
Update template.yaml
ChrisPates Oct 27, 2023
278ce0f
remove region from test template
ChrisPates Oct 27, 2023
c3b8736
Update stack.yml
ChrisPates Oct 27, 2023
69ca6df
Revert "remove region from test template"
ChrisPates Oct 27, 2023
6bce498
Update template.yaml
ChrisPates Oct 27, 2023
7745881
Add Regex validation of schedule
ChrisPates Oct 27, 2023
e673bfe
Update template.yaml
ChrisPates Oct 30, 2023
0533ffa
Update CICD to match template changes
ChrisPates Oct 30, 2023
fc9b6f4
Correct Param inclusion logic
ChrisPates Oct 30, 2023
f6bbaf7
Update template.yaml
ChrisPates Oct 30, 2023
25520c9
Update template.yaml
ChrisPates Oct 30, 2023
31f325c
Merge pull request #153 from awslabs/improved-param-validation
ChrisPates Oct 30, 2023
cd15fd5
Add log retention (#154)
ChrisPates Oct 31, 2023
cf280d4
Update template.yaml
ChrisPates Nov 1, 2023
cba9b34
Update template.yaml
ChrisPates Nov 1, 2023
38f3549
Update template.yaml
ChrisPates Nov 1, 2023
34bee9d
Update template.yaml
ChrisPates Nov 1, 2023
728dfeb
Update template.yaml
ChrisPates Nov 9, 2023
f89e3ff
Update buildspec.yml
ChrisPates Nov 9, 2023
99a1a69
adjusting CICD for new template options
ChrisPates Nov 9, 2023
7fd13bb
Revert "adjusting CICD for new template options"
ChrisPates Nov 9, 2023
0e0e787
Revert "Update buildspec.yml"
ChrisPates Nov 9, 2023
4cd4b7e
Updating README and CICD.
ChrisPates Dec 6, 2023
2f28e12
Update stack.yml
ChrisPates Dec 6, 2023
99d809a
Update template.yaml
ChrisPates Dec 6, 2023
d6a67ce
Update template.yaml
ChrisPates Dec 6, 2023
f5f11c9
Update stack.yml
ChrisPates Dec 6, 2023
2518e2e
Updating guidance.
ChrisPates Dec 12, 2023
e659dff
Update README.md
ChrisPates Dec 12, 2023
eb5f523
Update README.md
ChrisPates Dec 12, 2023
9c62032
Update README.md
ChrisPates Dec 12, 2023
241b43e
Update release.yaml
ChrisPates Dec 12, 2023
5c41ed3
Update release.yaml
ChrisPates Dec 12, 2023
c116b36
Update release.yaml
ChrisPates Dec 12, 2023
59fa49d
Updating to use a single set of secrets in the pipeline account.
ChrisPates Dec 12, 2023
4277064
Updating for Single Secrets set
ChrisPates Dec 12, 2023
5c969fd
Update buildspec.yml
ChrisPates Dec 12, 2023
ce8037f
Debugging the deployment for cross account secrets
ChrisPates Dec 12, 2023
d93f2c1
Update buildspec.yml
ChrisPates Dec 12, 2023
3723f34
Update buildspec.yml
ChrisPates Dec 12, 2023
f68a295
Update buildspec.yml
ChrisPates Dec 12, 2023
cdadba9
Adjusting Test pipeline naming
ChrisPates Dec 13, 2023
dad4aa8
Prep for adding deploy_pattern test scenarios
ChrisPates Dec 13, 2023
66f093d
Moving SAR-Staging item into account_execution stage
ChrisPates Dec 13, 2023
54617e3
Updating paths to reflect new paths
ChrisPates Dec 13, 2023
7a39664
updating for new path structure
ChrisPates Dec 13, 2023
18318e7
Update release.yaml
ChrisPates Dec 13, 2023
fa3082b
Creating Cross-Account Secrets pipelines
ChrisPates Dec 13, 2023
beb3ce7
Update testing.yaml
ChrisPates Dec 13, 2023
2fbfe60
Adding SingleStack Test
ChrisPates Dec 13, 2023
ed6a9ef
Update release.yaml
ChrisPates Dec 13, 2023
2544888
SingleStack test.
ChrisPates Dec 13, 2023
03b8068
Update buildspec.yml
ChrisPates Dec 13, 2023
641d214
Update README.md
ChrisPates Dec 14, 2023
b819bc8
Change NoValue psuedo-parameters to references
troyready Dec 30, 2023
0f551dd
Expanding test Cases
ChrisPates Jan 2, 2024
8ef5768
update singlestack template paths
ChrisPates Jan 2, 2024
6fd228f
improve testing for singleStack - unnamed function
ChrisPates Jan 4, 2024
95b48e2
Update README.md
johnkeates Jan 10, 2024
0edb2bf
Escape hyphens in user/group character classes
tim-hutchinson Jan 5, 2024
6b1b628
Update secrets.yaml
ChrisPates Feb 5, 2024
53b575b
Bugfix ignore regexes (#172)
ChrisPates Mar 1, 2024
7bf47b6
Increase logging level in Account_Execution tests
ChrisPates Mar 1, 2024
27254c2
Bugfix improve connection test (#174)
ChrisPates Mar 4, 2024
4567f3d
Adjusting params for AccountExecution Tests.
ChrisPates Mar 8, 2024
1a712c0
Update buildspec.yml
ChrisPates Mar 8, 2024
1c30312
Update testing.yaml
ChrisPates Mar 8, 2024
a2930a1
Bugfix env vars (#175)
ChrisPates Mar 8, 2024
d9ab40b
Feature multi select (#176)
ChrisPates Mar 18, 2024
3da5c14
Update README.md
ChrisPates Mar 25, 2024
4959792
Fix nested groups (#188)
ChrisPates Mar 26, 2024
087491f
Update .gitignore
ChrisPates Mar 26, 2024
75e947b
Group owners are treated as members (#190)
ChrisPates Apr 2, 2024
1d8f600
Group owners are treated as members (#191)
ChrisPates Apr 2, 2024
6cb78e1
Updating guidance for Match parameters.
ChrisPates Apr 4, 2024
a5bb2ae
199 group flattening can lead to conflicts due to non uniqueness (#201)
ChrisPates Jun 19, 2024
a6b6541
194 sso lambda deletes then recreates users (#203)
ChrisPates Jun 20, 2024
12a2754
200 name handling (#204)
ChrisPates Jun 21, 2024
09998d7
Update release.yml
ChrisPates Jun 21, 2024
1080aca
workflow update
ChrisPates Jun 21, 2024
00d3bb3
Bump github.com/hashicorp/go-retryablehttp from 0.7.0 to 0.7.7 (#205)
dependabot[bot] Jun 25, 2024
3266d73
Restrict Maximum Concurrency for the ssosync lambda to 1 #207
ChrisPates Jun 28, 2024
4b3661b
Addressing workflow issues
ChrisPates Aug 28, 2024
c7a866c
Fixes for workflow automations (#214)
ChrisPates Aug 28, 2024
c6c6956
fix readme document (#195)
DogFortune Aug 28, 2024
72e2724
Updated fix for SCIMEndpointAccessToken (#215)
xelfer Aug 29, 2024
c82d65a
refactor: update to 0north specific installation
gustavclausen Jun 6, 2023
aae86f8
[PLE-1508] feat: optimise fetching users from Google (#1)
vyrwu Sep 7, 2023
f6b02fe
fix: remove deprecated property (#2)
vyrwu Sep 7, 2023
4896360
runtime
Oct 4, 2024
f2a63eb
Merge branch 'awslabs-master' into feat/sync-upstream
Oct 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Setup go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: '1.21'
go-version: '1.23.x'

- name: Install staticcheck
run: go install honnef.co/go/tools/cmd/staticcheck@latest
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup go
uses: actions/setup-go@v2
uses: actions/setup-go@v5
with:
go-version: '1.17.x'
go-version: '1.23.x'

- name: Install staticcheck
run: go install honnef.co/go/tools/cmd/staticcheck@latest
Expand All @@ -32,20 +32,20 @@ jobs:
needs: [ test ]
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Unshallow
run: git fetch --prune --unshallow

- name: Set up Go
uses: actions/setup-go@v2
uses: actions/setup-go@v5
with:
go-version: '1.17.x'
go-version: '1.23.x'

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
uses: goreleaser/goreleaser-action@v4
with:
version: latest
args: release --rm-dist
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,11 @@ ssosync
# Noise from os/editors
.DS_Store
*.swp
*/.DS_Store
cicd/.DS_Store
release.yaml
staging.yaml
*.orig
*.rej
cicd/.DS_Store
*.swo
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ go-build:
clean:
rm -f $(OUTPUT) $(PACKAGED_TEMPLATE)

build-SSOSyncFunction:
GOOS=linux GOARCH=arm64 go build -o bootstrap main.go
cp dist/ssosync_linux_arm64/ssosync $(ARTIFACTS_DIR)/bootstrap

.PHONY: install
install:
go get ./...
Expand All @@ -45,6 +49,7 @@ publish:

.PHONY: package
package: build
cp dist/ssosync_linux_arm64/ssosync ./bootstrap
sam package --s3-bucket $(S3_BUCKET) --output-template-file $(PACKAGED_TEMPLATE) --s3-prefix $(S3_PREFIX)

.PHONY: deploy
Expand Down
Binary file modified cicd/.DS_Store
Binary file not shown.
57 changes: 57 additions & 0 deletions cicd/account_execution/staging/buildspec.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
version: 0.2

phases:

build:
commands:
# Create parameters
- export AppVersion="${GitTag#v}-${GitVersionHash}"

# Copy in the executable
- cp ${CODEBUILD_SRC_DIR_Built}/dist/ssosync_linux_amd64_v1/ssosync ./

# Copy in the tests
- cp -r cicd/tests ./

# Copy in the stack and params templates
- mkdir deploy
- cp cicd/account_execution/staging/stack.yml ./deploy/

# Update params with the values for this run for a developer account
- |
jq -n \
--argjson Parameters "{\"AppArn\": \"$AppArn\", \"AppVersion\": \"$AppVersion\", \"GoogleAdminEmailArn\": \"$SecretGoogleAdminEmail\", \"GoogleCredentialsArn\": \"$SecretGoogleCredentials\", \"SCIMEndpointUrlArn\": \"$SecretSCIMEndpoint\", \"SCIMAccessTokenArn\": \"$SecretSCIMAccessToken\", \"RegionArn\": \"$SecretRegion\", \"IdentityStoreIdArn\": \"$SecretIdentityStoreID\", \"GroupMatch\": \"name:AWS*,name=NestedGroups\"}" \
--argjson StackPolicy "{\"Statement\":[{\"Effect\": \"Allow\", \"NotAction\": \"Update:Delete\", \"Principal\": \"*\", \"Resource\": \"*\"}]}" \
'$ARGS.named' > ./deploy/developer.json
- cat ./deploy/developer.json

# Update params with the values for this run for the management account
- |
jq -n \
--argjson Parameters "{\"AppArn\": \"$AppArn\", \"AppVersion\": \"$AppVersion\", \"GoogleAdminEmailArn\": \"$SecretGoogleAdminEmail\", \"GoogleCredentialsArn\": \"$SecretGoogleCredentials\", \"SCIMEndpointUrlArn\": \"$SecretSCIMEndpoint\", \"SCIMAccessTokenArn\": \"$SecretSCIMAccessToken\", \"RegionArn\": \"$SecretRegion\", \"IdentityStoreIdArn\": \"$SecretIdentityStoreID\", \"GroupMatch\": \"name:Man*\"}" \
--argjson StackPolicy "{\"Statement\":[{\"Effect\": \"Allow\", \"NotAction\": \"Update:Delete\", \"Principal\": \"*\", \"Resource\": \"*\"}]}" \
'$ARGS.named' > ./deploy/cli.json
- cat ./deploy/cli.json

# Update params with the values for this run for the delegated account
- |
jq -n \
--argjson Parameters "{\"AppArn\": \"$AppArn\", \"AppVersion\": \"$AppVersion\", \"GoogleAdminEmailArn\": \"$SecretGoogleAdminEmail\", \"GoogleCredentialsArn\": \"$SecretGoogleCredentials\", \"SCIMEndpointUrlArn\": \"$SecretSCIMEndpoint\", \"SCIMAccessTokenArn\": \"$SecretSCIMAccessToken\", \"RegionArn\": \"$SecretRegion\", \"IdentityStoreIdArn\": \"$SecretIdentityStoreID\", \"GroupMatch\": \"name:Del*\"}" \
--argjson StackPolicy "{\"Statement\":[{\"Effect\": \"Allow\", \"NotAction\": \"Update:Delete\", \"Principal\": \"*\", \"Resource\": \"*\"}]}" \
'$ARGS.named' > ./deploy/lambda.json
- cat ./deploy/lambda.json

# Update params with the values for this run for non-delegated account
- |
jq -n \
--argjson Parameters "{\"AppArn\": \"$AppArn\", \"AppVersion\": \"$AppVersion\", \"GoogleAdminEmailArn\": \"$SecretGoogleAdminEmail\", \"GoogleCredentialsArn\": \"$SecretGoogleCredentials\", \"SCIMEndpointUrlArn\": \"$SecretSCIMEndpoint\", \"SCIMAccessTokenArn\": \"$SecretSCIMAccessToken\", \"RegionArn\": \"$SecretRegion\", \"IdentityStoreIdArn\": \"$SecretIdentityStoreID\", \"GroupMatch\": \"name:Non*\"}" \
--argjson StackPolicy "{\"Statement\":[{\"Effect\": \"Allow\", \"NotAction\": \"Update:Delete\", \"Principal\": \"*\", \"Resource\": \"*\"}]}" \
'$ARGS.named' > ./deploy/codepipeline.json
- cat ./deploy/codepipeline.json


artifacts:
files:
- ssosync
- deploy/**/*
- tests/**/*
77 changes: 77 additions & 0 deletions cicd/account_execution/staging/stack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
AWSTemplateFormatVersion: '2010-09-09'
Transform: 'AWS::Serverless-2016-10-31'

Description:
This CloudFormation template will deploy an instance of the SSOSync-Staging
candidate releases (via privately shared app in the AWS Serverless Application
Repository (SAR) within the Staging Account.

Parameters:
AppArn:
Description: The candidate release in the SAR
Default: 'arn:aws:serverlessrepo:<AWS::Region>:<AccountId>:applications/<ApplicationName>'
Type: String
AppVersion:
Description: The version of this build in SAR
Default: 'v1.0.0-rc.10'
Type: String
GoogleAdminEmailArn:
Type: String
GoogleCredentialsArn:
Type: String
SCIMEndpointUrlArn:
Type: String
SCIMAccessTokenArn:
Type: String
RegionArn:
Type: String
IdentityStoreIdArn:
Type: String
GroupMatch:
Description: The search string to match Groups in Google Workspace
Default: 'name:AWS*'
Type: String

Resources:
SARApp:
Type: AWS::Serverless::Application
Properties:
Location:
ApplicationId: !Ref AppArn
SemanticVersion: !Ref AppVersion
Parameters:
FunctionName: SSOSyncFunction
GoogleAdminEmail: !Join
- ''
- - '{{resolve:secretsmanager:'
- !Ref GoogleAdminEmailArn
- '}}'
GoogleCredentials: !Join
- ''
- - '{{resolve:secretsmanager:'
- !Ref GoogleCredentialsArn
- '}}'
SCIMEndpointUrl: !Join
- ''
- - '{{resolve:secretsmanager:'
- !Ref SCIMEndpointUrlArn
- '}}'
SCIMEndpointAccessToken: !Join
- ''
- - '{{resolve:secretsmanager:'
- !Ref SCIMAccessTokenArn
- '}}'
Region: !Join
- ''
- - '{{resolve:secretsmanager:'
- !Ref RegionArn
- '}}'
IdentityStoreID: !Join
- ''
- - '{{resolve:secretsmanager:'
- !Ref IdentityStoreIdArn
- '}}'
SyncMethod: groups
GoogleGroupMatch: !Ref GroupMatch
LogLevel: info
LogFormat: json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ version: 0.2
env:
variables:
ShareWith: "NOT-SHARED"
pipeline: "SSOSync-Test"
interval: 10
Success: '"Succeeded"'
InProgress: '"InProgress"'
Expand Down
35 changes: 19 additions & 16 deletions cicd/build/build/buildspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,28 @@ env:
phases:
install:
commands:
# Add goreleaser repo
- echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | sudo tee /etc/apt/sources.list.d/goreleaser.list

# Update the repos
- apt -qq --yes update
- apt -qq --yes upgrade

# Install go.lang
- wget -q https://storage.googleapis.com/golang/go${GoVersion}.linux-amd64.tar.gz
- rm -rf /go
- tar -C / -xzf go${GoVersion}.linux-amd64.tar.gz
- export PATH="/go/bin:$PATH" && export GOPATH="/go" && export PATH="$GOPATH/bin:$PATH"
- rm go${GoVersion}.linux-amd64.tar.gz
- go version

# Install golint
- GoVersion=${GOLANG_20_VERSION}

# Install golint - now deprecated
- go install golang.org/x/lint/golint@latest

# Install staticcheck
- go install honnef.co/go/tools/cmd/staticcheck@latest
# Install staticcheck - use static install from tarball
- wget -qO- https://github.com/dominikh/go-tools/releases/download/2023.1.6/staticcheck_linux_386.tar.gz | tar -xvz -C ./

# Install Testify to use common assertions and mocks in tests
- go get -u github.com/stretchr/testify
- go get github.com/stretchr/testify

# Install goreleaser
- go install github.com/goreleaser/goreleaser@latest
# Install goreleaser - go install method broken due to dependancies using apt static binary approach
# - go install github.com/goreleaser/goreleaser@latest
- apt -qq --yes install goreleaser

pre_build:
commands:
Expand All @@ -38,7 +41,7 @@ phases:
- go get ./...

# Run staticcheck
- staticcheck ./...
- staticcheck/staticcheck ./...

# Ensure code passes all lint tests
#- golint -set_exit_status ./...
Expand Down Expand Up @@ -68,8 +71,8 @@ phases:
# Tweak the .goreleaser.yml so it uses the vairables from .Env
- patch .goreleaser.yml cicd/build/build/goreleaser.patch

# Make main but only for the lambda (linux amd64)
- goreleaser build --snapshot --rm-dist --single-target
# Make main
- goreleaser build --snapshot --clean


# Check we've packaged something useful
Expand Down
23 changes: 18 additions & 5 deletions cicd/build/build/goreleaser.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
--- .goreleaser.yml 2022-06-15 08:38:24.000000000 +0100
+++ .goreleaser-codebuild.yml 2022-06-21 12:33:43.000000000 +0100
@@ -22,7 +22,7 @@
- goos: windows
goarch: 386
--- .goreleaser.yml.default 2023-10-25 11:30:58
+++ .goreleaser.yml 2023-10-25 11:32:18
@@ -9,20 +9,11 @@
- CGO_ENABLED=0
goos:
- linux
- - darwin
- - windows
goarch:
- - 386
- amd64
- - arm
- arm64
- ignore:
- - goos: darwin
- goarch: 386
- - goos: windows
- goarch: 386
ldflags:
- - -s -w -X github.com/awslabs/ssosync/cmd.version={{.Version}} -X github.com/awslabs/ssosync/cmd.commit={{.Commit}} -X github.com/awslabs/ssosync/cmd.date={{.Date}} -X github.com/awslabs/ssosync/cmd.builtBy=goreleaser
+ - -s -w -X github.com/awslabs/ssosync/cmd.version={{.Env.GitTag}} -X github.com/awslabs/ssosync/cmd.commit={{.Env.GitCommit}} -X github.com/awslabs/ssosync/cmd.date={{.Date}} -X github.com/awslabs/ssosync/cmd.builtBy=goreleaser -X github.com/awslabs/ssosync/cmd.goversion={{.Env.GoVersion}}
Expand Down
35 changes: 29 additions & 6 deletions cicd/build/package/buildspec.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
version: 0.2

env:
variables:
ShareWith: "NOT-SHARED"

phases:
install:
pre_build:
commands:
# Print all environment variables (handy for AWS CodeBuild logs)
- env

pre_build:
commands:
- cp -r ${CODEBUILD_SRC_DIR_Built}/* ./
- ls -la

# Check that the files need to package exist
- ls README.md
- ls SAR.md
- ls dist/ssosync_linux_amd64_v1/ssosync
- ls dist/ssosync_linux_arm64/ssosync
- ls dist/ssosync_linux_amd64_v1/ssosync

# Check that the executable works
- ./dist/ssosync_linux_amd64_v1/ssosync --version
- mv dist/ssosync_linux_arm64/ssosync bootstrap

build:
commands:
Expand All @@ -30,11 +34,30 @@ phases:
- patch release.yaml cicd/build/package/release.patch
- sam package --no-progressbar --template-file release.yaml --s3-bucket ${S3Bucket} --output-template-file packaged-release.yaml

post_build:
commands:
- ls packaged-staging.yaml
- ls packaged-release.yaml

post_build:
commands:
# Create parameters
- export AppVersion="${GitTag#v}-${GitVersionHash}"
- aws ssm put-parameter --name "/SSOSync/Staging/Version" --value ${AppVersion} --type String --overwrite

# remove the previous builds
#- aws serverlessrepo delete-application --application-id ${AppArn}

# Package our application with AWS SAM
- echo sam publish --template packaged-staging.yaml --semantic-version ${AppVersion}
- sam publish --template packaged-staging.yaml --semantic-version ${AppVersion}

# Share with the StagingAccount
- |
if expr "${ShareWith}" : "NOT-SHARED" >/dev/null; then
echo "Skipping Sharing"
else
aws serverlessrepo put-application-policy --application-id ${AppArn} --statements Principals=${ShareWith},Actions=Deploy
fi

artifacts:
files:
- packaged-staging.yaml
Expand Down
Loading
Loading