Skip to content

Instantly share code, notes, and snippets.

View nicosingh's full-sized avatar

Nico Singh nicosingh

View GitHub Profile
# . . . 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",
# /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]
terraform {
required_version = "~> 1.0.3"
required_providers {
acme = {
source = "vancluever/acme"
version = "~> 2.5.3"
}
}
}
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"))
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}")
}
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" {
image: docker:20.10.8
services:
- docker:20.10.8-dind
variables:
DOCKER_DRIVER: overlay2
BUILDX_VERSION: "v0.6.1"
BUILDX_ARCH: "linux-amd64"
#!/usr/bin/env python
from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello_world():
return "<p>Hello, World!</p>"
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 .
# 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 \
.