Commit 8169949a authored by Josh Zamor's avatar Josh Zamor
Browse files

#461, add covid-ref env

parent b596f72b
Pipeline #142259464 passed with stages
in 26 minutes and 28 seconds
export SSH_PRIV_KEY_PATH="$CHAI_SSH_PRIV_KEY_PATH"
export PCMT_S3_CREDS_CONF="$CHAI_PCMT_S3_CREDS_CONF"
\ No newline at end of file
......@@ -398,4 +398,47 @@ env-gfpvan-uat-destroy:
- ./deploy/terraform/run-docker.sh gfpvan-uat destroy -auto-approve
environment:
name: gfpvan-uat
action: stop
############### CHAI COVID REF Environment ###############
.env-covid-ref:
stage: deploy
when: manual
environment:
name: covid-ref
url: http://covid-ref.productcatalog.io
on_stop: env-covid-ref-destroy
.env-covid-ref_script-deploy:
script:
- source .ci-chai.env
- ./bin/ci-deploy.sh covid-ref
env-covid-ref (WIPE DB):
extends:
- .env-covid-ref
- .env-covid-ref_script-deploy
variables:
PCMT_PROFILE: dev
PCMT_VER: '1.1.3'
PCMT_ASSET_URL: 'https://gitlab.com/pcmt/pcmt/-/archive/v1.1.3/pcmt-v1.1.3.tar.gz'
env-covid-ref (KEEP DB):
extends:
- .env-covid-ref
- .env-covid-ref_script-deploy
variables:
PCMT_PROFILE: production
PCMT_VER: '1.1.3'
PCMT_ASSET_URL: 'https://gitlab.com/pcmt/pcmt/-/archive/v1.1.3/pcmt-v1.1.3.tar.gz'
env-covid-ref-destroy:
extends:
- .env-covid-ref
script:
- ./deploy/terraform/run-docker.sh covid-ref destroy -auto-approve
environment:
name: covid-ref
action: stop
\ No newline at end of file
######################################################################
# Copyright (c) 2019, VillageReach
# Licensed under the Non-Profit Open Software License version 3.0.
# SPDX-License-Identifier: NPOSL-3.0
######################################################################
terraform {
backend "s3" {
profile = "chai"
bucket = "chai-pcmt-terraform-states"
key = "pcmt-covid-ref.tf"
region = "us-east-1"
}
}
provider "aws" {
alias = "villagereach"
profile = "villagereach"
region = "${var.aws-region}"
}
provider "aws" {
alias = "chai"
profile = "chai"
region = "${var.aws-region}"
}
data "terraform_remote_state" "pcmt-network" {
backend = "s3"
config = {
profile = "chai"
bucket = "chai-pcmt-terraform-states"
key = "chai-network-useast.tf"
region = "us-east-1"
}
}
data "terraform_remote_state" "pcmt-hosted-zone" {
backend = "s3"
config = {
profile = "villagereach"
bucket = "pcmt-terraform-states"
key = "pcmt-productcatalog-io.tf"
region = "eu-west-1"
}
}
module "covid-ref" {
source = "../modules/pcmt"
providers = {
aws.compute = aws.chai
aws.network = aws.villagereach
}
aws-region = "${var.aws-region}"
ec2-key-pair = "${var.ec2-key-pair}"
tag-name = "${var.tag-name}"
tag-type = "${var.tag-type}"
tag-bill-to = "${var.tag-bill-to}"
root-volume-size = "${var.root-volume-size}"
instance-type = "${var.instance-type}"
app-deploy-group = "${var.app-deploy-group}"
domain-name = "${var.domain-name}"
subnet-id = "${data.terraform_remote_state.pcmt-network.outputs.vpc-subnet-id}"
security-group-id = "${data.terraform_remote_state.pcmt-network.outputs.security-group-id}"
route53-zone-id = "${data.terraform_remote_state.pcmt-hosted-zone.outputs.main-hosted-zone-id}"
}
ec2-key-pair = "PcmtCovidRefKeyPair"
aws-region = "us-east-1"
tag-name = "covid-ref"
tag-type = "staging"
tag-bill-to = "PCMT"
domain-name = "covid-ref.productcatalog.io"
variable "aws-region" {
type = string
description = "AWS Region to use"
}
variable "tag-name" {
type = string
description = "Name of the environment"
}
variable "tag-type" {
type = string
description = "Type of deployment, dev, staging, producting, buildinf, etc"
}
variable "tag-bill-to" {
type = string
description = "Which project to bill the provisioned resources"
default = "PCMT"
}
variable "root-volume-size" {
type = number
description = "Size in GB of root volume"
default = "20"
}
variable "instance-type" {
type = string
description = "Size in GB of root volume"
default = "t3a.small"
}
variable "app-deploy-group" {
type = "string"
description = "Tags ec2 app instance for use by Ansible Playbooks."
default = "docker-hosts"
}
variable "ec2-key-pair" {
type = "string"
description = "Name of EC2 key-pair for instance"
default = "pcmt-ec2"
}
variable "domain-name" {
type = string
description = "AWS Route53 Domain Name"
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment