From 2a343f371ea05e53629dc5c62ccb48709c5114a2 Mon Sep 17 00:00:00 2001 From: Chris Pates Date: Fri, 23 Sep 2022 17:25:01 +0100 Subject: [PATCH] RUNNING_IN_CODEPIPELINE --- cmd/root.go | 2 ++ internal/config/config.go | 2 ++ 2 files changed, 4 insertions(+) diff --git a/cmd/root.go b/cmd/root.go index 38d25af3..4cf285f4 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -23,6 +23,7 @@ import ( "github.com/awslabs/ssosync/internal" "github.com/awslabs/ssosync/internal/config" + "github.com/aws/aws-sdk-go/service/codepipeline" "github.com/aws/aws-lambda-go/lambda" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/secretsmanager" @@ -77,6 +78,7 @@ func init() { // init config cfg = config.New() cfg.IsLambda = len(os.Getenv("_LAMBDA_SERVER_PORT")) > 0 + cfg.IsLambdaRunningInCodePipeline = os.Getenv("RUNNING_IN_CODEPIPELINE") == "True" // initialize cobra cobra.OnInitialize(initConfig) diff --git a/internal/config/config.go b/internal/config/config.go index adaf5978..8fd3803d 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -23,6 +23,8 @@ type Config struct { SCIMAccessToken string `mapstructure:"scim_access_token"` // IsLambda ... IsLambda bool + // IsLambdaRunningInCodePipeline ... + IsLambdaRunningInCodePipeline bool // Ignore users ... IgnoreUsers []string `mapstructure:"ignore_users"` // Ignore groups ...