-
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from binbashar/BBL-140-tf-0.12-support
// BBL-140 - Terraform 0.12 support //
- Loading branch information
Showing
58 changed files
with
1,721 additions
and
309 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,161 @@ | ||
version: 2.1 | ||
|
||
jobs: | ||
# | ||
# Test 1 & Test 2 | ||
# | ||
test-static-code-and-linting: | ||
machine: | ||
image: ubuntu-1604:201903-01 | ||
# This job has been blocked because Docker Layer Caching is not available on your plan. | ||
# Please upgrade to continue building. | ||
# Note: you will need to push a new commit or call the API to rerun the pipeline. | ||
docker_layer_caching: false | ||
|
||
steps: | ||
- checkout | ||
|
||
- run: pwd | ||
- run: ls -ltra | ||
- run: git branch | ||
|
||
- run: | ||
name: test1-terraform-format | ||
command: | | ||
if [[ $(make format| tail -n +2) ]]; then | ||
echo "===================================================================================================" | ||
echo " NOT PASSED - There are Terraform conf files that needs a canonical format and styleto be formated " | ||
echo "===================================================================================================" | ||
exit 1 | ||
else | ||
echo "===================================================================================================" | ||
echo " PASSED - All Terraform conf files already have canonical format and are correcyly styled " | ||
echo "===================================================================================================" | ||
fi | ||
- run: | ||
name: test2-terraform-linting | ||
command: | | ||
if make lint | grep 'Awesome! Your code is following the best practices'; then | ||
echo "===============================================================================================" | ||
echo " PASSED - Awesome! Your code is following the best practices " | ||
echo "===============================================================================================" | ||
else | ||
echo "===============================================================================================" | ||
echo " NOT PASSED - Terraform lint needed " | ||
echo "===============================================================================================" | ||
fi | ||
# | ||
# Test 3 | ||
# | ||
test-e2e-terratests: | ||
machine: | ||
image: ubuntu-1604:201903-01 | ||
docker_layer_caching: false | ||
|
||
steps: | ||
- checkout | ||
|
||
- run: pwd | ||
- run: ls -ltra | ||
- run: git branch | ||
|
||
- run: | ||
name: Install awscli | ||
command: sudo pip install awscli | ||
|
||
- run: | ||
name: Configure awscli | ||
command: | | ||
echo "AWS_ACCESS_KEY_ID - $AWS_ACCESS_KEY_ID" | ||
echo "AWS_PROFILE_NAME - $AWS_PROFILE_NAME" | ||
# AWS defautl awscli profile | ||
aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID | ||
aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY | ||
aws configure set region us-east-1 | ||
aws configure set output json | ||
# AWS dev awscli profile | ||
aws configure set role_arn arn:aws:iam::$AWS_ACCOUNT_ID_DEV:role/DeployMaster --profile $AWS_PROFILE_NAME | ||
aws configure set source_profile default --profile $AWS_PROFILE_NAME | ||
# - run: cat ~/.aws/credentials | ||
# - run: cat ~/.aws/config | ||
|
||
- run: | ||
name: Test AWS permissions | ||
command: aws budgets describe-budgets --account-id $AWS_ACCOUNT_ID_DEV --profile $AWS_PROFILE_NAME | ||
|
||
- run: | ||
name: test3-terratests-dep-init | ||
command: cd modules/waf-global && make terratest-dep-init | ||
|
||
- run: | ||
name: test3-terratests-go-test | ||
command: cd modules/waf-global && make terratest-go-test | ||
|
||
- run: | ||
name: test4-terratests-dep-init | ||
command: cd modules/waf-regional && make terratest-dep-init | ||
|
||
- run: | ||
name: test4-terratests-go-test | ||
command: cd modules/waf-regional && make terratest-go-test | ||
# | ||
# Release | ||
# | ||
release-patch-with-changelog: | ||
machine: | ||
image: ubuntu-1604:201903-01 | ||
docker_layer_caching: false | ||
|
||
steps: | ||
- checkout | ||
|
||
- run: pwd | ||
- run: ls -ltra | ||
- run: git branch | ||
|
||
- run: | ||
name: release-patch-with-changelog-circleci | ||
command: | | ||
if git status | grep 'nothing to commit, working tree clean'; then | ||
echo "===============================================================================================" | ||
echo "release-patch-with-changelog-circleci" | ||
echo "===============================================================================================" | ||
git config --global user.email "$GIT_USER_EMAIL" | ||
git config --global user.name "$GIT_USER_NAME" | ||
make release-patch-with-changelog-circleci | ||
else | ||
echo "===============================================================================================" | ||
echo "Changes in working directory pending to be pushed - please check 'git status' cmd output below " | ||
echo "===============================================================================================" | ||
echo "$(git status)" | ||
echo "===============================================================================================" | ||
fi | ||
# | ||
# Jobs workflow | ||
# | ||
workflows: | ||
version: 2 | ||
changelog_and_release: | ||
jobs: | ||
- test-static-code-and-linting: | ||
context: binbashar-org-global-context | ||
filters: | ||
branches: | ||
ignore: # only branches matching the below regex filters will run | ||
- master | ||
- test-e2e-terratests: | ||
context: binbashar-org-global-context | ||
filters: | ||
branches: | ||
ignore: # only branches matching the below regex filters will run | ||
- master | ||
- release-patch-with-changelog: | ||
context: binbashar-org-global-context | ||
filters: | ||
branches: | ||
only: # only branches matching the below regex filters will run | ||
- master |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.