Skip to content

Commit

Permalink
Migrate build, deploy & release system to BuildKite.
Browse files Browse the repository at this point in the history
Also remove support for Cloudflare file-based authentication, relying solely on environment variables for authentication info to the Docker entry-point.
  • Loading branch information
Arik Kfir committed Nov 1, 2017
1 parent 62ca077 commit 4b2cedd
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 39 deletions.
6 changes: 6 additions & 0 deletions .buildkite/build.pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
steps:

- label: Build Docker image
command:
- gcloud docker -- build --tag gcr.io/infolinks-gcr/k8s-cloudflared:${BUILDKITE_COMMIT} .
- gcloud docker -- push gcr.io/infolinks-gcr/k8s-cloudflared:${BUILDKITE_COMMIT}
9 changes: 9 additions & 0 deletions .buildkite/release.pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
steps:

- label: Build versioned Docker image
command:
- gcloud docker -- pull gcr.io/infolinks-gcr/k8s-cloudflared:${BUILDKITE_COMMIT}
- gcloud docker -- tag gcr.io/infolinks-gcr/k8s-cloudflared:${BUILDKITE_COMMIT} infolinks/k8s-cloudflared:${VERSION}
- gcloud docker -- push infolinks/k8s-cloudflared:${VERSION}
- gcloud docker -- tag gcr.io/infolinks-gcr/k8s-cloudflared:${BUILDKITE_COMMIT} infolinks/k8s-cloudflared:latest
- gcloud docker -- push infolinks/k8s-cloudflared:latest
16 changes: 0 additions & 16 deletions .travis.yml

This file was deleted.

12 changes: 0 additions & 12 deletions .travis/build.sh

This file was deleted.

6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# k8s-cloudflared

[![Build Status](https://travis-ci.org/infolinks/k8s-cloudflared.svg?branch=master)](https://travis-ci.org/infolinks/k8s-cloudflared)
[![Build status](https://badge.buildkite.com/8e3145c6e8516acd680b71ea97e5bfa18073f9ee4eb286126c.svg)](https://buildkite.com/infolinks/k8s-cloudflared)

Container for continually updating Cloudflare DNS records for Kubernetes
`Service` and `Ingress` objects found in a cluster.
Expand Down Expand Up @@ -42,7 +42,9 @@ to point to `1.2.3.4` in Cloudflare.

## Ingress Resources

The same applies to `Ingress` resources in the cluster.
The same applies to `Ingress` resources in the cluster, but you don't
have to define the `dns` annotation - the host names will be taken
automatically from the host rules.

## Deployment

Expand Down
18 changes: 9 additions & 9 deletions cloudflared.sh
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
#!/usr/bin/env bash

AUTH_EMAIL_FILE=./conf/cf_auth_email.txt
AUTH_KEY_FILE=./conf/cf_auth_key.txt
DOMAIN_FILE=./conf/cf_domain.txt
# small IntelliJ hack to prevent warning on non-existing variables
if [[ "THIS_WILL_NEVER_BE_TRUE" == "true" ]]; then
DOMAIN=${DOMAIN}
AUTH_EMAIL=${AUTH_EMAIL}
AUTH_KEY=${AUTH_KEY}
fi

while true; do
# read domain name
[[ -e "${DOMAIN_FILE}" ]] && DOMAIN=$(cat ${DOMAIN_FILE})
if [[ -z "${DOMAIN}" ]]; then
echo "DOMAIN not defined, and empty Cloudflare domain at '${DOMAIN_FILE}'!" >&2
echo "DOMAIN environment variable not defined" >&2
exit 1
fi

# read Cloudflare authentication Email
[[ -e "${AUTH_EMAIL_FILE}" ]] && AUTH_EMAIL=$(cat ${AUTH_EMAIL_FILE})
if [[ -z "${AUTH_EMAIL}" ]]; then
echo "AUTH_EMAIL not defined, and empty Cloudflare authentication Email at '${AUTH_EMAIL_FILE}'!" >&2
echo "AUTH_EMAIL environment variable not defined" >&2
exit 1
fi

# read Cloudflare authentication key
[[ -e "${AUTH_KEY_FILE}" ]] && AUTH_KEY=$(cat ${AUTH_KEY_FILE})
if [[ -z "${AUTH_KEY}" ]]; then
echo "AUTH_KEY not defined, and empty Cloudflare authentication key at '${AUTH_KEY_FILE}'!" >&2
echo "AUTH_KEY environment variable not defined" >&2
exit 1
fi

Expand Down

0 comments on commit 4b2cedd

Please sign in to comment.