Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit c1d41c0
Author: Chris Pates <[email protected]>
Date:   Wed Oct 25 18:24:20 2023 +0100

    Update Makefile

commit 09acff4
Author: Chris Pates <[email protected]>
Date:   Wed Oct 25 16:21:56 2023 +0100

    Update buildspec.yml

commit 95c1fec
Author: Chris Pates <[email protected]>
Date:   Wed Oct 25 16:05:18 2023 +0100

    Switching to bootstrap

commit 038c4d8
Author: Chris Pates <[email protected]>
Date:   Wed Oct 25 15:26:48 2023 +0100

    Adjust for testing

commit fce63c4
Author: Chris Pates <[email protected]>
Date:   Wed Oct 25 14:25:32 2023 +0100

    updates for the developer pipeline

commit 0542ed4
Author: Chris Pates <[email protected]>
Date:   Wed Oct 25 12:30:09 2023 +0100

    Update buildspec.yml

commit 627c24c
Author: Chris Pates <[email protected]>
Date:   Wed Oct 25 11:49:56 2023 +0100

    Updates to CICD for arm64

commit b3a4c8c
Author: Chris Pates <[email protected]>
Date:   Wed Oct 25 11:09:20 2023 +0100

    Update buildspec.yml

commit 323eaf6
Author: Chris Pates <[email protected]>
Date:   Wed Oct 25 10:55:37 2023 +0100

    Update buildspec.yml

commit da30515
Author: Chris Pates <[email protected]>
Date:   Wed Oct 25 10:46:16 2023 +0100

    Update buildspec.yml

commit 64a25b2
Author: Chris Pates <[email protected]>
Date:   Wed Oct 25 09:47:32 2023 +0100

    Switching back to amd64 images for codebuild

commit 7b87d0f
Author: Chris Pates <[email protected]>
Date:   Tue Oct 24 20:29:53 2023 +0100

    update codebuild image and fix golang version.

commit 338b61f
Author: Chris Pates <[email protected]>
Date:   Tue Oct 24 17:45:14 2023 +0100

    Update buildspec.yml

commit 21c941d
Author: Chris Pates <[email protected]>
Date:   Tue Oct 24 17:41:01 2023 +0100

    Update buildspec.yml

commit cb9d94b
Author: Chris Pates <[email protected]>
Date:   Tue Oct 24 17:39:09 2023 +0100

    Update buildspec.yml

commit 0dc4087
Author: Chris Pates <[email protected]>
Date:   Tue Oct 24 17:31:21 2023 +0100

    Update buildspec.yml

commit dd0f19c
Author: Chris Pates <[email protected]>
Date:   Tue Oct 24 17:27:17 2023 +0100

    Update buildspec.yml

commit 71ba543
Author: Chris Pates <[email protected]>
Date:   Tue Oct 24 17:20:44 2023 +0100

    Update buildspec.yml

commit 43af171
Author: Chris Pates <[email protected]>
Date:   Tue Oct 24 17:13:25 2023 +0100

    updating cicd to arm64
  • Loading branch information
ChrisPates committed Oct 25, 2023
1 parent 410be6f commit 315e85d
Show file tree
Hide file tree
Showing 10 changed files with 90 additions and 42 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,4 @@ ssosync
# Noise from os/editors
.DS_Store
*.swp
*/.DS_Store
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ test:
go-build:
go build -o $(APP_NAME) main.go

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

.PHONY: clean
clean:
rm -f $(OUTPUT) $(PACKAGED_TEMPLATE)

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

.PHONY: install
install:
go get ./...
Expand Down
5 changes: 3 additions & 2 deletions cicd/build/build/buildspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,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 All @@ -74,3 +74,4 @@ artifacts:
files:
- ${APP_NAME}
- dist/**/*

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
4 changes: 3 additions & 1 deletion cicd/build/package/buildspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ phases:
# 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 Down
37 changes: 27 additions & 10 deletions cicd/build/package/release.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--- template.yaml 2022-11-29 16:56:21.000000000 +0000
+++ release.yaml 2022-11-29 17:11:58.000000000 +0000
--- template.yaml 2023-10-25 09:44:33
+++ release.yaml 2023-10-25 16:02:21
@@ -27,7 +27,7 @@
- IncludeGroups

Expand All @@ -9,29 +9,37 @@
Description: Helping you populate AWS SSO directly with your Google Apps users.
Author: Sebastian Doell
SpdxLicenseId: Apache-2.0
@@ -107,7 +107,7 @@
Ignore these Google Workspace users
@@ -111,7 +111,7 @@
Default: 'none'
IncludeGroups:
Type: String
- Description: |
+ Description: |
Include only these Google Workspace groups. (Only applicable for SyncMethod user_groups)
Default: '*'
SyncMethod:
Type: String
@@ -116,9 +116,9 @@
@@ -121,16 +121,16 @@
AllowedValues:
- groups
- users_groups
-
-
-
+
+
+

-
-
-
Resources:
SSOSyncFunction:
@@ -156,8 +156,6 @@
Type: AWS::Serverless::Function
Properties:
Runtime: provided.al2
- Handler: dist/ssosync_linux_arm64/ssosync
+ Handler: bootstrap
Architectures:
- arm64
Timeout: 300
@@ -163,8 +163,6 @@
- !Ref AWSSCIMAccessTokenSecret
- !Ref AWSRegionSecret
- !Ref AWSIdentityStoreIDSecret
Expand All @@ -40,3 +48,12 @@
- Sid: IdentityStoreAccesPolicy
Effect: Allow
Action:
@@ -187,8 +185,6 @@
Properties:
Enabled: true
Schedule: !Ref ScheduleExpression
- Metadata:
- BuildMethod: makefile

AWSGoogleCredentialsSecret:
Type: "AWS::SecretsManager::Secret"
40 changes: 23 additions & 17 deletions cicd/build/package/staging.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--- template.yaml 2022-11-29 16:56:21.000000000 +0000
+++ staging.yaml 2022-11-29 17:10:47.000000000 +0000
--- template.yaml 2023-10-25 09:44:33
+++ staging.yaml 2023-10-25 16:02:07
@@ -27,7 +27,7 @@
- IncludeGroups

Expand All @@ -9,35 +9,38 @@
Description: Helping you populate AWS SSO directly with your Google Apps users.
Author: Sebastian Doell
SpdxLicenseId: Apache-2.0
@@ -107,7 +107,7 @@
Ignore these Google Workspace users
@@ -111,7 +111,7 @@
Default: 'none'
IncludeGroups:
Type: String
- Description: |
+ Description: |
Include only these Google Workspace groups. (Only applicable for SyncMethod user_groups)
Default: '*'
SyncMethod:
Type: String
@@ -116,14 +116,15 @@
@@ -121,16 +121,17 @@
AllowedValues:
- groups
- users_groups
-
-
-
+
+
+

-
-
-
Resources:
SSOSyncFunction:
Type: AWS::Serverless::Function
Properties:
+ FunctionName: SSOSyncFunction
Runtime: go1.x
Handler: dist/ssosync_linux_amd64_v1/ssosync
Runtime: provided.al2
- Handler: dist/ssosync_linux_arm64/ssosync
+ Handler: bootstrap
Architectures:
- arm64
Timeout: 300
@@ -156,8 +157,6 @@
@@ -163,8 +164,6 @@
- !Ref AWSSCIMAccessTokenSecret
- !Ref AWSRegionSecret
- !Ref AWSIdentityStoreIDSecret
Expand All @@ -46,8 +49,8 @@
- Sid: IdentityStoreAccesPolicy
Effect: Allow
Action:
@@ -172,13 +171,13 @@
- "identitystore:DeleteGroupMembership"
@@ -180,16 +179,14 @@
- "identitystore:DeleteGroup"
Resource:
- "*"
- Events:
Expand All @@ -57,17 +60,20 @@
- Properties:
- Enabled: true
- Schedule: !Ref ScheduleExpression
+
- Metadata:
- BuildMethod: makefile

+ - Sid: CodePipelinePolicy
+ Effect: Allow
+ Action:
+ - codepipeline:PutJobSuccessResult
+ - codepipeline:PutJobFailureResult
+ Resource: "*"
+
AWSGoogleCredentialsSecret:
Type: "AWS::SecretsManager::Secret"
@@ -215,3 +214,10 @@
Properties:
@@ -225,3 +222,10 @@
Properties:
Name: SSOSyncIdentityStoreID
SecretString: !Ref IdentityStoreID
Expand Down
2 changes: 1 addition & 1 deletion cicd/cloudformation/developer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ Resources:
Capabilities: CAPABILITY_IAM,CAPABILITY_AUTO_EXPAND
StackName: SmokeTest
RoleArn: !GetAtt [CloudFormationDeployerRole, Arn]
TemplateConfiguration: !Sub 'Tests::deploy/params.json'
TemplateConfiguration: !Sub 'Tests::deploy/developer.json'
TemplatePath: !Sub 'Tests::deploy/stack.yml'
InputArtifacts:
- Name: Tests
Expand Down
10 changes: 9 additions & 1 deletion cicd/staging/build/buildspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,15 @@ phases:
- mkdir deploy
- cp cicd/staging/build/stack.yml ./deploy/

# Update params with the values for this run for the management
# Update params with the values for this run for a developer account
- |
jq -n \
--argjson Parameters "{\"AppArn\": \"$AppArn\", \"AppVersion\": \"$AppVersion\", \"GroupMatch\": \"name:AWS*\"}" \
--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\", \"GroupMatch\": \"name:Man*\"}" \
Expand Down
2 changes: 1 addition & 1 deletion template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ Resources:
Type: AWS::Serverless::Function
Properties:
Runtime: provided.al2
Handler: bootstrap
Handler: dist/ssosync_linux_arm64/ssosync
Architectures:
- arm64
Timeout: 300
Expand Down

0 comments on commit 315e85d

Please sign in to comment.