-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore(tform): __custom workspaces, more tests * chore(tform): more terraform 12 * chore(Jenkins): add terraform12 * chore(Jenkins): bump to nodejs 12 * test(terraform): fixes for Jenkins environment * fix(terraform): test suite * docs(README): NOOP to kick Jenkins Co-authored-by: frickjack <reubenonrye@uchicago.edu>
- Loading branch information
Showing
60 changed files
with
616 additions
and
268 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
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
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 |
---|---|---|
@@ -1,40 +1,34 @@ | ||
help() { | ||
cat - <<EOM | ||
gen3 tfapply: | ||
Run 'terraform apply' in the current workspace, and backup config.tfvars, backend.tfvars, and README.md. | ||
A typical command line is: | ||
terraform apply plan.terraform | ||
EOM | ||
return 0 | ||
} | ||
|
||
|
||
source "$GEN3_HOME/gen3/lib/utils.sh" | ||
gen3_load "gen3/lib/terraform" | ||
|
||
cd $GEN3_WORKDIR | ||
cd "$GEN3_WORKDIR" | ||
if [[ ! -f plan.terraform ]]; then | ||
echo "plan.terraform does not exist in workspace - run 'gen3 tfplan'" | ||
gen3_log_err "plan.terraform does not exist in workspace - run 'gen3 tfplan'" | ||
exit 1 | ||
fi | ||
|
||
$GEN3_DRY_RUN && "Running in DRY_RUN mode ..." | ||
$GEN3_DRY_RUN && gen3_log_info "Running in DRY_RUN mode ..." | ||
|
||
echo "Running: terraform apply plan.terraform" | ||
gen3_log_info "Running: terraform apply plan.terraform" | ||
if ! ($GEN3_DRY_RUN || gen3_terraform apply plan.terraform); then | ||
echo "apply failed, bailing out" | ||
gen3_log_err "apply failed, bailing out" | ||
exit 1 | ||
fi | ||
|
||
if [[ -d .git ]] && ! $GEN3_DRY_RUN; then | ||
git add . | ||
git commit -n -m 'pre-apply auto-commit' 1>&2 | ||
fi | ||
|
||
dryRunFlag="" | ||
if $GEN3_DRY_RUN; then | ||
dryRunFlag="--dryrun" | ||
fi | ||
if [[ "$GEN3_FLAVOR" == "AWS" ]]; then | ||
echo "Backing up files to s3" | ||
gen3_log_info "Backing up files to s3" | ||
for fileName in config.tfvars backend.tfvars README.md; do | ||
s3Path="s3://${GEN3_S3_BUCKET}/${GEN3_WORKSPACE}/$fileName" | ||
echo "Backing up $fileName to $s3Path" | ||
gen3_log_info "Backing up $fileName to $s3Path" | ||
gen3_aws_run aws s3 cp $dryRunFlag --sse AES256 "$fileName" "$s3Path" | ||
done | ||
fi |
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
Oops, something went wrong.