-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: run terraform apply for tag named for test or prod
- Loading branch information
1 parent
7e11c3b
commit 525722c
Showing
2 changed files
with
42 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import os | ||
import re | ||
|
||
REASON = os.environ["REASON"] | ||
# use variable corresponding to tag triggers | ||
SOURCE = os.environ["INDIVIDUAL_SOURCE"] | ||
IS_TAG = os.environ["IS_TAG"].lower() == "true" | ||
|
||
if REASON == "IndividualCI" and IS_TAG: | ||
if re.fullmatch(r"20\d\d.\d\d.\d+-rc\d+", SOURCE): | ||
tag_type = "test" | ||
elif re.fullmatch(r"20\d\d.\d\d.\d+", SOURCE): | ||
tag_type = "prod" | ||
else: | ||
tag_type = None | ||
else: | ||
tag_type = None | ||
|
||
print(tag_type) |