Skip to content

Commit

Permalink
Add build artifacts CI (spiffe#31)
Browse files Browse the repository at this point in the history
* Add build artifacts CI

Signed-off-by: Brandon Lum <lumjjb@gmail.com>

* Reorder spire versions build

Signed-off-by: Brandon Lum <lumjjb@gmail.com>
  • Loading branch information
lumjjb authored and mrsabath committed Sep 15, 2021
1 parent 26e4bd9 commit e7ed7fd
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 10 deletions.
File renamed without changes.
41 changes: 41 additions & 0 deletions .github/workflows/master-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Tornjak Artifact push
on:
push:
branches:
- main
jobs:
tornjak-build:
runs-on: ubuntu-latest
steps:
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
- name: Check out repository code
uses: actions/checkout@v2
- name: Install Golang
uses: actions/setup-go@v1
with:
go-version: '1.15.5'
- uses: actions/setup-node@v2
with:
node-version: '15'
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
version: v1.29
args: --timeout 5m
- name: Log in to GHCR.io
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
# Create sha tagged image for container-agent
- name: Set Image names
run: echo "CONTAINER_TAG=ghcr.io/${{ github.repository_owner }}/tornjak-spire-server:$GITHUB_SHA" >> $GITHUB_ENV
- name: Build and push tornjak agent image
run: make container-agent-push
# Create tagged versioned images
- name: Push artifacts for container-agent-multiversions
run: make release-container-agent-multiversions-ghcr
- run: echo "🍏 This job's status is ${{ job.status }}."
13 changes: 10 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
.PHONY: ui vendor build ui-agent ui-manager container-agent container-agent-push container-manager container-manager-push release-container-agent-multiversions

CONTAINER_TAG ?= ghcr.io/spiffe/tornjak-spire-server:latest
CONTAINER_VERSION_IMAGEPATH ?= ghcr.io/spiffe/tornjak-spire-server
CONTAINER_MANAGER_TAG ?= tghcr.io/spiffe/tornjak-manager:latest
CONTAINER_TAG ?= tsidentity/tornjak-spire-server:latest
CONTAINER_VERSION_IMAGEPATH ?= tsidentity/tornjak-spire-server
CONTAINER_VERSION_GHCR_IMAGEPATH ?= ghcr.io/spiffe/tornjak-spire-server
CONTAINER_MANAGER_TAG ?= tsidentity/tornjak-manager:latest
GO_FILES := $(shell find . -type f -name '*.go' -not -name '*_test.go' -not -path './vendor/*')

all: bin/tornjak-agent bin/tornjak-manager ui-agent ui-manager container-agent container-manager
Expand Down Expand Up @@ -53,6 +54,12 @@ release-container-agent-multiversions: bin/tornjak-agent ui-agent
./build-and-push-versioned-container.sh $$i ${CONTAINER_VERSION_IMAGEPATH}; \
done

release-container-agent-multiversions-ghcr: bin/tornjak-agent ui-agent
for i in $(shell cat SPIRE_BUILD_VERSIONS); do \
./build-and-push-versioned-container.sh $$i ${CONTAINER_VERSION_GHCR_IMAGEPATH}; \
done


clean:
rm -rf bin/
rm -rf tornjak-frontend/build
Expand Down
14 changes: 7 additions & 7 deletions SPIRE_BUILD_VERSIONS
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
1.0.1
1.0.0
0.12.1
0.12.0
0.11.3
0.11.2
0.11.1
0.11.0
0.11.1
0.11.2
0.11.3
0.12.0
0.12.1
1.0.0
1.0.1

0 comments on commit e7ed7fd

Please sign in to comment.