Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Configure deployment pipeline & DNS for superchallenge bot
- Loading branch information
Showing
6 changed files
with
144 additions
and
1 deletion.
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
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
[ | ||
{ | ||
"volumesFrom": [], | ||
"memory": 128, | ||
"extraHosts": null, | ||
"dnsServers": null, | ||
"disableNetworking": null, | ||
"dnsSearchDomains": null, | ||
"portMappings": [], | ||
"hostname": null, | ||
"essential": true, | ||
"entryPoint": null, | ||
"mountPoints": [ | ||
{ | ||
"containerPath": "/var/www/html/config-files", | ||
"sourceVolume": "config-files", | ||
"readOnly": true | ||
} | ||
], | ||
"name": "superchallengebot", | ||
"ulimits": null, | ||
"dockerSecurityOptions": null, | ||
"environment": [ | ||
{ | ||
"name": "VIRTUAL_HOST", | ||
"value": "super-challenge.language-learners.org" | ||
}, | ||
{ | ||
"name": "LETSENCRYPT_HOST", | ||
"value": "super-challenge.language-learners.org" | ||
}, | ||
{ | ||
"name": "LETSENCRYPT_EMAIL", | ||
"value": "letsencrypt@randomhacks.net" | ||
} | ||
], | ||
"links": null, | ||
"workingDirectory": null, | ||
"readonlyRootFilesystem": null, | ||
"image": "${image}", | ||
"command": null, | ||
"user": null, | ||
"dockerLabels": null, | ||
"logConfiguration": null, | ||
"cpu": 0, | ||
"privileged": null, | ||
"memoryReservation": null | ||
}, | ||
{ | ||
"volumesFrom": [], | ||
"memory": 64, | ||
"extraHosts": null, | ||
"dnsServers": null, | ||
"disableNetworking": null, | ||
"dnsSearchDomains": null, | ||
"portMappings": [], | ||
"hostname": null, | ||
"essential": true, | ||
"entryPoint": null, | ||
"mountPoints": [ | ||
{ | ||
"containerPath": "/var/www/html/config-files", | ||
"sourceVolume": "config-files", | ||
"readOnly": true | ||
} | ||
], | ||
"name": "superchallengebot-cron", | ||
"ulimits": null, | ||
"dockerSecurityOptions": null, | ||
"links": null, | ||
"workingDirectory": null, | ||
"readonlyRootFilesystem": null, | ||
"image": "${image}", | ||
"command": ["/var/www/html/worker"], | ||
"user": null, | ||
"dockerLabels": null, | ||
"logConfiguration": null, | ||
"cpu": 0, | ||
"privileged": null, | ||
"memoryReservation": null | ||
} | ||
] |
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,46 @@ | ||
# This defines the CodePipeline that builds and deploys our Super Challenge | ||
# service. | ||
|
||
# Use a module to do all the hard work. | ||
module "superchallengebot_pipeline" { | ||
source = "github_ecs_pipeline" | ||
name = "superchallengebot" | ||
github_repo = "superchallengebot" | ||
github_branch = "master" | ||
|
||
# Pass our taskdef information to the module. | ||
taskdef_family = "${aws_ecs_task_definition.superchallengebot.family}" | ||
taskdef_revision = "${aws_ecs_task_definition.superchallengebot.revision}" | ||
|
||
# Standard parameters which are the same for all pipelines. | ||
aws_region = "${var.aws_region}" | ||
aws_account_id = "${var.aws_account_id}" | ||
pipeline_role_arn = "${aws_iam_role.codepipeline_role.arn}" | ||
build_role_arn = "${aws_iam_role.codebuild_role.arn}" | ||
artifact_store_s3_bucket = "${aws_s3_bucket.codepipeline_artifacts.bucket}" | ||
ecs_cluster = "${aws_ecs_cluster.language_learners.name}" | ||
notification_topic_arn = "${aws_sns_topic.admin_updates.arn}" | ||
} | ||
|
||
# Load our container definitions from a template file. | ||
data "template_file" "superchallengebot_container_definitions" { | ||
template = "${file("${path.module}/superchallengebot-container-definitions.json")}" | ||
vars { | ||
image = "771600087445.dkr.ecr.us-east-1.amazonaws.com/superchallengebot:latest" | ||
} | ||
} | ||
|
||
# Declare our ECS task definition for use by the pipeline. The `family` | ||
# field here must match the module's `name` above. | ||
resource "aws_ecs_task_definition" "superchallengebot" { | ||
family = "superchallengebot" | ||
container_definitions = "${data.template_file.superchallengebot_container_definitions.rendered}" | ||
|
||
# Define our volumes. These are used to map directories on our | ||
# EBS-backed `/data` volume to volume names referred to in our | ||
# `*-container-definitions.json` file. | ||
volume { | ||
name = "config-files" | ||
host_path = "/data/superchallengebot/config-files" | ||
} | ||
} |
Binary file not shown.