Skip to content
This repository was archived by the owner on Mar 10, 2023. It is now read-only.

Commit b1dc3f0

Browse files
Waterdripsalexellis
authored andcommitted
Publish multi-arch functions
Signed-off-by: Alistair Hey <alistair@heyal.co.uk>
1 parent 05f418d commit b1dc3f0

File tree

5 files changed

+32
-37
lines changed

5 files changed

+32
-37
lines changed

.github/workflows/build.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,23 +26,23 @@ jobs:
2626
go-version: ${{ matrix.go-version }}
2727
- name: Run Tests
2828
run: curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash && make test-chart
29-
# Run the CI tests
3029
build-stack:
3130
strategy:
3231
matrix:
33-
go-version: [1.13.x]
3432
os: [ubuntu-latest]
33+
stack-file: [
34+
stack.yml,
35+
dashboard/stack.yml,
36+
aws.yml,
37+
gitlab.yml
38+
]
3539
runs-on: ${{ matrix.os }}
3640
steps:
3741
- uses: actions/checkout@master
3842
with:
3943
fetch-depth: 1
40-
- name: Install Go
41-
uses: actions/setup-go@v2
42-
with:
43-
go-version: ${{ matrix.go-version }}
44-
- name: Run CI
45-
run: sh ./contrib/ci.sh
44+
- name: Run Build
45+
run: STACKFILE=${{ matrix.stack-file }} sh ./contrib/ci.sh
4646

4747
# Test building the non-cli Containers
4848
build-containers:
@@ -77,6 +77,6 @@ jobs:
7777
outputs: "type=image,push=false"
7878
platforms: linux/amd64,linux/arm/v7,linux/arm64
7979
tags: |
80-
ghcr.io/${{ steps.get_repo_owner.outputs.repo_owner }}/${{ matrix.svc }}:${{ steps.get_tag.outputs.TAG }}
81-
ghcr.io/${{ steps.get_repo_owner.outputs.repo_owner }}/${{ matrix.svc }}:${{ github.sha }}
82-
ghcr.io/${{ steps.get_repo_owner.outputs.repo_owner }}/${{ matrix.svc }}:latest
80+
ghcr.io/${{ steps.get_repo_owner.outputs.repo_owner }}/ofc-${{ matrix.svc }}:${{ steps.get_tag.outputs.TAG }}
81+
ghcr.io/${{ steps.get_repo_owner.outputs.repo_owner }}/ofc-${{ matrix.svc }}:${{ github.sha }}
82+
ghcr.io/${{ steps.get_repo_owner.outputs.repo_owner }}/ofc-${{ matrix.svc }}:latest

.github/workflows/publish.yaml

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,25 @@ on:
77

88

99
jobs:
10-
# Run the CI tests
1110
publish-stack:
1211
strategy:
1312
matrix:
14-
go-version: [1.13.x]
1513
os: [ubuntu-latest]
14+
stack-file: [
15+
stack.yml,
16+
dashboard/stack.yml,
17+
aws.yml,
18+
gitlab.yml
19+
]
1620
runs-on: ${{ matrix.os }}
1721
steps:
1822
- uses: actions/checkout@master
1923
with:
2024
fetch-depth: 1
21-
- name: Install Go
22-
uses: actions/setup-go@v2
23-
with:
24-
go-version: ${{ matrix.go-version }}
25+
- name: Set up QEMU
26+
uses: docker/setup-qemu-action@v1
27+
- name: Set up Docker Buildx
28+
uses: docker/setup-buildx-action@v1
2529
- name: Login to Docker Registry
2630
uses: docker/login-action@v1
2731
with:
@@ -35,9 +39,8 @@ jobs:
3539
id: get_repo_owner
3640
run: echo ::set-output name=repo_owner::$(echo ${{ github.event.repository.owner.login }} | tr '[:upper:]' '[:lower:]')
3741
- name: Deploy Stacks
38-
run: TAG=${{ steps.get_tag.outputs.TAG }} REPO=${{ steps.get_repo_owner.outputs.repo_owner }} sh ./contrib/publish.sh
42+
run: STACKFILE=${{ matrix.stack-file }} TAG=${{ steps.get_tag.outputs.TAG }} REPO=${{ steps.get_repo_owner.outputs.repo_owner }} sh ./contrib/publish.sh
3943

40-
# Test building the non-cli Containers
4144
publish-containers:
4245
runs-on: ubuntu-latest
4346
strategy:
@@ -76,6 +79,6 @@ jobs:
7679
outputs: "type=registry,push=true"
7780
platforms: linux/amd64,linux/arm/v7,linux/arm64
7881
tags: |
79-
ghcr.io/${{ steps.get_repo_owner.outputs.repo_owner }}/${{ matrix.svc }}:${{ steps.get_tag.outputs.TAG }}
80-
ghcr.io/${{ steps.get_repo_owner.outputs.repo_owner }}/${{ matrix.svc }}:${{ github.sha }}
81-
ghcr.io/${{ steps.get_repo_owner.outputs.repo_owner }}/${{ matrix.svc }}:latest
82+
ghcr.io/${{ steps.get_repo_owner.outputs.repo_owner }}/ofc-${{ matrix.svc }}:${{ steps.get_tag.outputs.TAG }}
83+
ghcr.io/${{ steps.get_repo_owner.outputs.repo_owner }}/ofc-${{ matrix.svc }}:${{ github.sha }}
84+
ghcr.io/${{ steps.get_repo_owner.outputs.repo_owner }}/ofc-${{ matrix.svc }}:latest

contrib/ci.sh

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ CLI="faas-cli"
66
if ! [ -x "$(command -v faas-cli)" ]; then
77
HERE=`pwd`
88
cd /tmp/
9-
curl -sL https://github.com/openfaas/faas-cli/releases/download/0.9.3/faas-cli > faas-cli
9+
curl -sL https://github.com/openfaas/faas-cli/releases/download/0.12.19/faas-cli > faas-cli
1010
chmod +x ./faas-cli
1111
CLI="/tmp/faas-cli"
1212

@@ -16,7 +16,4 @@ fi
1616

1717
echo "Working folder: `pwd`"
1818

19-
$CLI build --parallel=4
20-
$CLI build -f dashboard/stack.yml
21-
$CLI build -f aws.yml
22-
$CLI build -f gitlab.yml
19+
$CLI build -f $STACKFILE

contrib/publish.sh

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ CLI="faas-cli"
77
if ! [ -x "$(command -v faas-cli)" ]; then
88
HERE=`pwd`
99
cd /tmp/
10-
curl -sL https://github.com/openfaas/faas-cli/releases/download/0.9.3/faas-cli > faas-cli
10+
curl -sL https://github.com/openfaas/faas-cli/releases/download/0.12.19/faas-cli > faas-cli
1111
chmod +x ./faas-cli
1212
CLI="/tmp/faas-cli"
1313

@@ -17,10 +17,4 @@ fi
1717

1818
echo "Working folder: `pwd`"
1919

20-
$CLI up --parallel=4 --skip-deploy
21-
HERE=`pwd`
22-
cd dashboard
23-
$CLI up -f stack.yml --skip-deploy
24-
cd $HERE
25-
$CLI up -f gitlab.yml --skip-deploy
26-
$CLI up -f aws.yml --skip-deploy
20+
$CLI publish -f $STACKFILE --platforms linux/amd64,linux/arm64,linux/arm/v7

dashboard/stack.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,17 @@ provider:
22
name: openfaas
33
gateway: http://127.0.0.1:8080
44

5+
# needs to be run from root folder
56
functions:
67
system-dashboard:
78
lang: node12
8-
handler: ./of-cloud-dashboard
9+
handler: ./dashboard/of-cloud-dashboard
910
image: ghcr.io/${REPO:-openfaas}/of-cloud-dashboard:${TAG:-dev}
1011
labels:
1112
openfaas-cloud: "1"
1213
role: openfaas-system
1314
environment_file:
14-
- dashboard_config.yml
15+
- dashboard/dashboard_config.yml
1516
limits:
1617
memory: 256Mi
1718
requests:

0 commit comments

Comments
 (0)