Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🔧 Added deploy config #47

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions d3b_cli_igor/utils/generate_tf.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ def generate(project, region, account, environment, template_name):
print(file)
template_path = file[file.find("templates"):len(file)]
#Create folder structure
#template_path_structure=template_path[len("templates/"+template_name+"/"):]
template_path_structure=template_path[len("templates/"+template_name+"/"):]
#if(not os.path.exists(os.path.dirname(template_path_structure))):
# print(os.path.dirname(template_path_structure))
#os.makedirs(os.path.dirname(template_path_structure))
# os.makedirs(os.path.dirname(template_path_structure))
template = templateEnv.get_template(template_path)
output = template.render(project=project, region=region, account=account, environment=environment, state_files_bucket=d3b_cli_igor.common.get_account_info()[account]["state_files_bucket"], account_id=d3b_cli_igor.common.get_account_info()[account]["account_id"],azs=d3b_cli_igor.common.get_account_info()[account]["azs"])
with(open(template_path[len("templates/"+template_name+"/"):len(template_path)], "w")) as f:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ services:
{{ project }}:
image: {{ project }}:${GIT_COMMIT:-latest}
build:
context: .
context: ../
dockerfile: Dockerfile
2 changes: 1 addition & 1 deletion d3b_cli_igor/utils/templates/simple-tf/scripts/cibuild
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
set -e
config_file=$(find . -name "config" | grep scripts)
config_file=$(find . -name "app_config" | grep scripts)
source $config_file

if [[ -n "${ETL_DEBUG}" ]]; then
Expand Down
2 changes: 1 addition & 1 deletion d3b_cli_igor/utils/templates/simple-tf/scripts/cipublish
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

set -e
config_file=$(find . -name "config" | grep scripts)
config_file=$(find . -name "app_config" | grep scripts)
source $config_file

function usage() {
Expand Down
1 change: 0 additions & 1 deletion d3b_cli_igor/utils/templates/simple-tf/scripts/config

This file was deleted.

6 changes: 6 additions & 0 deletions d3b_cli_igor/utils/templates/simple-tf/scripts/deploy_config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
project="{{ project }}"
BUCKET="{{ account }}-{{ account_id }}-{{ region }}-{{ environment }}-secrets"
ACCOUNT="{{ account }}"
REGION="{{ region }}"
ACCOUNT_ID="{{ account_id }}"
ENVIRONMENT="{{ environment }}"
2 changes: 1 addition & 1 deletion d3b_cli_igor/utils/templates/simple-tf/scripts/infra
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
set -e
config_file=$(find . -name "config" | grep scripts)
config_file=$(find . -name "deploy_config" | grep scripts)
source $config_file

#Check for required variables
Expand Down
10 changes: 7 additions & 3 deletions d3b_cli_igor/utils/templates/simple-tf/terraform/variables.tf
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
#Variables goes here
variable "environment" {
description="Environment name"
description = "Environment name"
default="{{ environment }}"
}

variable "region" {
description="AWS Region"
description = "AWS Region"
default="{{ region }}"
}

variable "image_tag" {
description="Docker Image Tag in ECR"
description = "Docker Image Tag in ECR"
}

variable "project" {
description = "{{ project }}"
}