-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix deployment of infrastructure through Terraform (#47)
* Pinned azurerm provider to specific version and adjusted parameters in module * Added configuration to install newer Terraform version in cicd executor * Changed OS architecture in circleci config file * Added quotes to string * Removed Terraform Orb and set new executor to install required Terraform version * Changed working directory * Changed executor image * Restored circleci base image for the executor * Removed unnecessary terraform commands * Added required parameter in terraform file * Updated kubernetes and orchestrator version and sku-tier * Changed some variable names to what is expected by Terraform Cloud * Removed default value in variables * Extended cluster deletion to 3 hours * Updated external-dns image tag * Fixed Kubernetes version * Added configuration to tag image
- Loading branch information
1 parent
28faac7
commit c09fe35
Showing
7 changed files
with
279 additions
and
247 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 |
---|---|---|
@@ -1,64 +1,68 @@ | ||
version: 2.1 | ||
orbs: | ||
terraform: circleci/[email protected] | ||
jobs: | ||
terraform-cycle: | ||
executor: terraform/default | ||
docker: | ||
- image: "cimg/base:stable" | ||
steps: | ||
- checkout | ||
- setup_remote_docker: | ||
version: 20.10.7 | ||
- run: | ||
name: Create .terraformrc file locally | ||
command: >- | ||
echo "credentials \"app.terraform.io\" {token = | ||
\"$TERRAFORM_TOKEN\"}" > $HOME/.terraformrc | ||
- run: | ||
- run: | ||
name: Install Terraform cli | ||
command: | | ||
wget https://releases.hashicorp.com/terraform/1.4.2/terraform_1.4.2_linux_386.zip | ||
unzip terraform_1.4.2_linux_386.zip | ||
sudo mv terraform /usr/local/bin | ||
- run: | ||
name: Terraform cycle | ||
command: | | ||
cd aws/terraform-aws | ||
terraform init -upgrade | ||
terraform validate | ||
terraform init | ||
terraform plan | ||
cd ../../azure/terraform-azure | ||
terraform init -upgrade | ||
terraform validate | ||
terraform init | ||
terraform plan | ||
working_directory: ~/src | ||
working_directory: ~/project | ||
|
||
build-publish: | ||
docker: | ||
- image: 'cimg/base:stable' | ||
- image: "cimg/base:stable" | ||
auth: | ||
username: $DOCKER_USERNAME | ||
password: $DOCKER_PASSWORD | ||
environment: | ||
TAG: 0.1.<< pipeline.number >> | ||
steps: | ||
- checkout | ||
- setup_remote_docker: | ||
version: 20.10.7 | ||
version: 20.10.7 | ||
- run: | ||
name: Build geekzone/infra image | ||
name: Build geekzone/infra image | ||
command: | | ||
docker build -t geekzone/infra . | ||
docker build -t geekzone/infra:$TAG . | ||
- deploy: | ||
name: Push geekzone/infra image to Docker Hub | ||
command: | | ||
docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD | ||
docker push geekzone/infra | ||
docker push geekzone/infra:$TAG | ||
workflows: | ||
main-infra: | ||
jobs: | ||
- terraform-cycle: | ||
filters: | ||
branches: | ||
ignore: | ||
- /junk-.*/ | ||
ignore: | ||
- /junk-.*/ | ||
- build-publish: | ||
requires: | ||
- terraform-cycle | ||
- terraform-cycle | ||
filters: | ||
branches: | ||
ignore: | ||
- /junk-.*/ | ||
|
||
|
||
ignore: | ||
- /junk-.*/ |
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
Oops, something went wrong.