Skip to content

Commit 064633b

Browse files
authored
Merge pull request #214 from awslabs/bugfix-error-git-branch
Fix CodeBuild environment variable name in app.py
2 parents f49c09e + bcc8224 commit 064633b

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

deploy/app.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,15 @@
2323
'CDK_DEFAULT_ACCOUNT'
2424
)
2525

26-
if not os.environ.get("CODEBUILD_SOURCE_VERSION", None):
26+
if not os.environ.get("DATAALL_REPO_BRANCH", None):
27+
# Configuration of the branch in first deployment
2728
git_branch = (
2829
subprocess.Popen(['git', 'branch', '--show-current'], stdout=subprocess.PIPE)
2930
.stdout.read().decode('utf-8').rstrip('\n')
3031
)
3132
else:
32-
codebuild_source = os.environ.get("CODEBUILD_SOURCE_VERSION")
33-
git_branch = codebuild_source.replace("arn:aws:s3:::dataall-","").split("-cicd")[0]
33+
# Configuration of the branch in subsequent deployments
34+
git_branch = os.environ.get("DATAALL_REPO_BRANCH")
3435

3536
git_branch = git_branch if git_branch != "" else "main"
3637

@@ -50,7 +51,7 @@
5051
logger.error(err)
5152

5253
app = App()
53-
logger.info("Loaded context from file")
54+
logger.info("Loaded context from cdk.json file in repository")
5455

5556
cdk_pipeline_region = app.node.try_get_context('tooling_region') or os.getenv('CDK_DEFAULT_REGION')
5657

0 commit comments

Comments
 (0)