Skip to content

Commit

Permalink
Merge pull request #29 from binbashar/fix/license-update
Browse files Browse the repository at this point in the history
updating license

@binbashar/leverage-ref-architecture-aws-admin @binbashar/leverage-ref-architecture-aws-dev finally al terratests are passing. Merging now.
  • Loading branch information
exequielrafaela authored Aug 25, 2021
2 parents 851aa90 + b3df2ee commit 2611881
Show file tree
Hide file tree
Showing 7 changed files with 299 additions and 207 deletions.
150 changes: 15 additions & 135 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ jobs:
# Automated Tests
#
test-static-code-and-linting:
machine:
image: ubuntu-1604:202007-01 # Ubuntu 16.04, Docker v19.03.12, Docker Compose v1.26.1
machine: # https://circleci.com/docs/2.0/configuration-reference/#available-machine-images
image: ubuntu-2004:202107-01 # Ubuntu 16.04, Docker v19.03.12, Docker Compose v1.26.1

# This job has been blocked because Docker Layer Caching is not available on your plan.
# Should upgrade if necessary.
Expand All @@ -26,31 +26,33 @@ jobs:
git update-index --assume-unchanged "Makefile"
- run:
name: test-terraform-format-and-docs
name: test-dependencies
command: |
#
# Install pre-commit
pip install pre-commit
sudo -H pip3 install pre-commit
#
# Install terraform
sudo apt-get install unzip
sudo apt-get install unzip curl
curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add -
wget https://releases.hashicorp.com/terraform/${TERRAFORM_VER}/terraform_${TERRAFORM_VER}_linux_amd64.zip
unzip terraform_${TERRAFORM_VER}_linux_amd64.zip
sudo mv terraform /usr/local/bin/
terraform --version
#
# Install terraform-docs
sudo apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main"
curl -Lo ./terraform-docs https://github.com/terraform-docs/terraform-docs/releases/download/v0.10.1/terraform-docs-v0.10.1-$(uname | tr '[:upper:]' '[:lower:]')-amd64
curl -Lo ./terraform-docs https://github.com/terraform-docs/terraform-docs/releases/download/v0.12.1/terraform-docs-v0.12.1-$(uname | tr '[:upper:]' '[:lower:]')-amd64
chmod +x ./terraform-docs
sudo mv ./terraform-docs /usr/local/bin/terraform-docs
#
# Run tests
make pre-commit
- run:
name: test-terraform-format-and-docs
command: make pre-commit

- run:
name: Install awscli
command: sudo -H pip install awscli
command: sudo -H pip3 install awscli

- run:
name: Configure awscli
Expand All @@ -77,122 +79,6 @@ jobs:
name: test-terraform-linting
command: make tflint-deep

- slack/notify:
event: fail
mentions: '@leverage-support'
custom: |
{
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": "Failed Pipeline! :rotating_light::fire::bash-fire::bangbang::video-games-doom-mad::stopp:",
"emoji": true
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": ":negative_squared_cross_mark: *Project*: $CIRCLE_PROJECT_REPONAME \n :negative_squared_cross_mark: *User*: $CIRCLE_USERNAME \n :negative_squared_cross_mark: *Job*: $CIRCLE_JOB in *repo* $CIRCLE_PROJECT_REPONAME \n :negative_squared_cross_mark: *Branch:* $CIRCLE_BRANCH \n :negative_squared_cross_mark: *PR:* $CIRCLE_PULL_REQUEST \n :negative_squared_cross_mark: *Last Commit:* $CIRCLE_SHA1"
},
"accessory": {
"type": "button",
"text": {
"type": "plain_text",
"text": ":arrow_forward: View Job in CircleCi",
"emoji": true
},
"value": "click_me_123",
"url": "$CIRCLE_BUILD_URL",
"action_id": "button-action"
}
}
]
}
channel: 'tools-ci'
- slack/notify:
event: pass
custom: |
{
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": "Successful Pipeline! :checkered_flag: :video-games-star: :video-games-mario-luigi-dance: :tada: :binbash::bb-leverage: :heart: :open-source:",
"emoji": true
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": ":heavy_check_mark: *Project*: $CIRCLE_PROJECT_REPONAME \n :heavy_check_mark: *User*: $CIRCLE_USERNAME \n :heavy_check_mark: *Job*: $CIRCLE_JOB in *repo* $CIRCLE_PROJECT_REPONAME \n :heavy_check_mark: *Branch:* $CIRCLE_BRANCH \n :heavy_check_mark: *PR:* $CIRCLE_PULL_REQUEST \n :heavy_check_mark: *Last Commit:* $CIRCLE_SHA1"
},
"accessory": {
"type": "button",
"text": {
"type": "plain_text",
"text": ":arrow_forward: View Job in CircleCi",
"emoji": true
},
"value": "click_me_123",
"url": "$CIRCLE_BUILD_URL",
"action_id": "button-action"
}
}
]
}
channel: 'tools-ci'

#
# Tests E2E
#
test-e2e-terratests:
machine:
image: ubuntu-1604:202007-01
docker_layer_caching: false

steps:
- checkout

- run:
name: Context Info Cmds
command: pwd && ls -ltra && git branch

- run:
name: Initialize Repo Makefiles
command: |
make init-makefiles
git update-index --assume-unchanged "Makefile"
- run:
name: Install awscli
command: sudo pip install awscli

- run:
name: Configure awscli
command: |
# 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_SHARED:role/DeployMaster --profile $AWS_PROFILE_NAME
aws configure set source_profile default --profile $AWS_PROFILE_NAME
# moving credentials to specific project folder
mkdir --parents /home/circleci/.aws/bb
cp /home/circleci/.aws/credentials /home/circleci/.aws/bb/credentials
cp /home/circleci/.aws/config /home/circleci/.aws/bb/config
- run:
name: Test AWS permissions
command: aws ec2 describe-instances --region us-east-1 --profile $AWS_PROFILE_NAME

- run:
name: test-terratests-dep-init
command: make terratest-dep-init
Expand Down Expand Up @@ -276,7 +162,7 @@ jobs:
#
release-version-with-changelog:
machine:
image: ubuntu-1604:202007-01
image: ubuntu-2004:202107-01 # Ubuntu 16.04, Docker v19.03.12, Docker Compose v1.26.1
docker_layer_caching: false

environment:
Expand Down Expand Up @@ -402,14 +288,8 @@ workflows:
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
ignore: # only branches matching the below regex filters will run
- master
- release-version-with-changelog:
context: binbashar-org-global-context
filters:
Expand Down
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,13 @@ Thumbs.db
*.tfstate
*.tfstate.backup
#
# Ignore override files as they are usually used to override resources locally and so
# are not checked in
override.tf
override.tf.json
*_override.tf
*_override.tf.json
#
# Module directory
#
.terraform
Expand Down
Loading

0 comments on commit 2611881

Please sign in to comment.