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
# . . . remaining part of /etc/gitlab-runner/config.toml | |
[runners.machine] | |
MachineDriver = "amazonec2" | |
MachineName = "gitlab-docker-machine-%s" | |
MachineOptions = [ | |
"amazonec2-access-key=XXXX", | |
"amazonec2-secret-key=XXXX", | |
"amazonec2-region=us-central-1", | |
"amazonec2-vpc-id=vpc-xxxxx", |
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
# /etc/gitlab-runner/config.toml | |
concurrent = 10 | |
[[runners]] | |
name = "gitlab-ci-runner-bastion" | |
url = "https://gitlab.com/" | |
token = "our-own-gitlab-token-goes-here" | |
executor = "docker+machine" | |
[runners.docker] |
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
terraform { | |
required_version = "~> 1.0.3" | |
required_providers { | |
acme = { | |
source = "vancluever/acme" | |
version = "~> 2.5.3" | |
} | |
} | |
} |
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
output "certificate_pem" { | |
value = lookup(acme_certificate.certificate, "certificate_pem") | |
} | |
output "issuer_pem" { | |
value = lookup(acme_certificate.certificate, "issuer_pem") | |
} | |
output "private_key_pem" { | |
value = nonsensitive(lookup(acme_certificate.certificate, "private_key_pem")) |
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
resource "aws_s3_bucket_object" "certificate_artifacts_s3_objects" { | |
for_each = toset(["certificate_pem", "issuer_pem", "private_key_pem"]) | |
bucket = "test-singh-cl-ssl-cert" # TODO put your own S3 bucket, and create it before if necessary! | |
key = "ssl-certs/${each.key}" # TODO set your own bucket path | |
content = lookup(acme_certificate.certificate, "${each.key}") | |
} |
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
provider "acme" { | |
server_url = "https://acme-staging-v02.api.letsencrypt.org/directory" | |
#server_url = "https://acme-v02.api.letsencrypt.org/directory" | |
} | |
data "aws_route53_zone" "base_domain" { | |
name = "test.singh.cl" # TODO put your own DNS in here! | |
} | |
resource "tls_private_key" "private_key" { |
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
image: docker:20.10.8 | |
services: | |
- docker:20.10.8-dind | |
variables: | |
DOCKER_DRIVER: overlay2 | |
BUILDX_VERSION: "v0.6.1" | |
BUILDX_ARCH: "linux-amd64" |
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
#!/usr/bin/env python | |
from flask import Flask | |
app = Flask(__name__) | |
@app.route("/") | |
def hello_world(): | |
return "<p>Hello, World!</p>" |
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
FROM python:3.8-alpine | |
RUN apk add --no-cache \ | |
curl \ | |
libffi-dev \ | |
openssl-dev \ | |
build-base &&\ | |
rm -rf /var/cache/apk/* | |
COPY requirements.txt . |
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
# build and push docker image | |
docker buildx build \ | |
--platform linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8,linux/ppc64le \ | |
--tag registry.gitlab.com/nicosingh/demo-flask-application:latest \ | |
--push \ | |
. | |