Skip to content

Commit

Permalink
Add a custom GitHub actions script
Browse files Browse the repository at this point in the history
We don't actually *build* Envoy, we just add a script that we run when
the image starts up.

Signed-off-by: Toby Cabot <[email protected]>
  • Loading branch information
caboteria committed Sep 12, 2023
1 parent 4c79456 commit e2672dc
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 15 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Build

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v3
with: {submodules: recursive}

- uses: actions/setup-go@v4
with: {go-version: '=1.19.8'}

- name: Decide what we're going to call this
run: |
TAG_SPECIFIC=${{ github.ref_name }}
# if we're building from a branch (i.e., not a tag) then add
# the short sha so we can have more than one build per branch
if [[ ${{ github.ref }} != refs/tags/* ]]; then
TAG_SPECIFIC=${TAG_SPECIFIC}-$(git rev-parse --short HEAD)
fi
echo $TAG_SPECIFIC
echo "TAG_SPECIFIC=$TAG_SPECIFIC" >> $GITHUB_ENV
- name: Make
run: |
make SUFFIX=${TAG_SPECIFIC} image-build
- name: Push
if: startsWith(github.ref, 'refs/tags/')
run: |
docker login -u epic-gateway+github_actions -p ${{ secrets.QUAY_EPIC_GATEWAY }} quay.io
make SUFFIX=${TAG_SPECIFIC} image-push
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ docker:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY

script:
- make SUFFIX=${TAG_SPECIFIC} GITLAB_USER=gitlab-ci-token GITLAB_PASSWORD=${CI_JOB_TOKEN} install
- make SUFFIX=${TAG_SPECIFIC} GITLAB_USER=gitlab-ci-token GITLAB_PASSWORD=${CI_JOB_TOKEN} docker-build docker-push
22 changes: 12 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
REPO ?= registry.gitlab.com/acnodal/epic
PREFIX = envoy
SUFFIX = ${USER}-dev
REPO ?= quay.io/epic-gateway
PREFIX ?= envoy
SUFFIX ?= ${USER}-dev

TAG=${REPO}/${PREFIX}:${SUFFIX}
DOCKERFILE=Dockerfile
TAG ?= ${REPO}/${PREFIX}:${SUFFIX}

##@ Default Goal
.PHONY: help
Expand All @@ -12,16 +11,19 @@ help: ## Display this help
@echo " make <goal> [VAR=value ...]"
@echo
@echo "Variables"
@echo " PREFIX Docker tag prefix (useful to set the docker registry)"
@echo " SUFFIX Docker tag suffix (the part after ':')"
@echo " REPO The registry part of the Docker tag"
@echo " PREFIX Image tag prefix (usually the image name)"
@echo " SUFFIX Image tag suffix (the part after ':')"
@awk 'BEGIN {FS = ":.*##"}; \
/^[a-zA-Z0-9_-]+:.*?##/ { printf " %-15s %s\n", $$1, $$2 } \
/^##@/ { printf "\n%s\n", substr($$0, 5) } ' $(MAKEFILE_LIST)

##@ Development Goals

image: ## Build the Docker image
docker build --file=${DOCKERFILE} --tag=${TAG} .
.PHONY: image-build
image-build: ## Build the Docker image
docker build --tag=${TAG} ${DOCKER_BUILD_OPTIONS} .

install: image ## Push the image to the repo
.PHONY: image-test
image-push: ## Push the image to the repo
docker push ${TAG}
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
This is the Envoy used in the EPIC.
This is the Envoy used in the EPIC Gateway.

It bootstraps its config from the container filesystem at the standard location: /etc/envoy/envoy.yaml.

The container includes some basic stuff for troubleshooting networking not found in the containers from envoy

Note: the container registry is private, you will need to authenticate
The container includes some basic stuff for troubleshooting networking not found in the containers from envoy.

0 comments on commit e2672dc

Please sign in to comment.