Skip to content

Commit

Permalink
CD (#10)
Browse files Browse the repository at this point in the history
* test

* new cd file

* step

* format

* typo

* typo

* test git tag

* test release

* yaml
  • Loading branch information
julienstroheker authored Jan 30, 2020
1 parent 4f9ee81 commit 0d6f797
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 25 deletions.
21 changes: 11 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,21 @@ name: Build
on:
push:
branches:
- master
- master
jobs:
build:
name: Building ${{ matrix.image }}
runs-on: ubuntu-latest
strategy:
matrix:
image: ['worker','publisher','client']
image: ["worker", "publisher", "client"]
steps:
- uses: actions/checkout@v2
- name: Build Docker image
env: # Or as an environment variable
FTH_REGISTRY_PASSWORD: ${{ secrets.FTH_REGISTRY_PASSWORD }}
FTH_REGISTRY_USERNAME: ${{ secrets.FTH_REGISTRY_USERNAME }}
run: |
make build-${{ matrix.image }}-image
make push-mutable-${{ matrix.image }}-image
- uses: actions/checkout@v2
- name: Build Docker image
env: # Or as an environment variable
FTH_REGISTRY_PASSWORD: ${{ secrets.FTH_REGISTRY_PASSWORD }}
FTH_REGISTRY_USERNAME: ${{ secrets.FTH_REGISTRY_USERNAME }}
run: |
make build-${{ matrix.image }}-image
make push-${{ matrix.image }}-image
make push-mutable-${{ matrix.image }}-image
30 changes: 30 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
on:
release:
types: [published]
jobs:
build:
name: Releasing
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Azure Login
uses: Azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Helm tool installer
uses: Azure/setup-helm@v1
- name: Kubectl tool installer
uses: Azure/setup-kubectl@v1
- name: Get Kubeconfig
env: # Or as an environment variable
AKS_CLUSTER_NAME: ${{ secrets.AKS_CLUSTER_NAME }}
AKS_CLUSTER_RG_NAME: ${{ secrets.AKS_CLUSTER_RG_NAME }}
run: |
az aks get-credentials -n $AKS_CLUSTER_NAME -g $AKS_CLUSTER_RG_NAME
kubectl get pods --all-namespaces
- name: Update Charts
run: |
make helm-upgrade-publisher
make helm-upgrade-worker
make helm-upgrade-client
kubectl get pods --all-namespaces
30 changes: 15 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
image: ['worker','publisher','client']
image: ["worker", "publisher", "client"]
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.13
if: matrix.image != 'client'
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: '10.x'
if: matrix.image == 'client'
- name: Build image
run: |
make build-${{ matrix.image }}-binaries
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.13
if: matrix.image != 'client'
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: "10.x"
if: matrix.image == 'client'
- name: Build image
run: |
make build-${{ matrix.image }}-binaries
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ node_modules
bin
ihaq-*
.env
spn.json
**.pub
juihaq
sshkey
Expand Down
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,11 @@ push-mutable-publisher-image: registry-login
docker tag $(FTH_REGISTRY)/ihaq-publisher:$(IHAQ_VERSION) $(FTH_REGISTRY)/ihaq-publisher:$(MUTABLE_VERSION)
docker push $(FTH_REGISTRY)/ihaq-publisher:$(MUTABLE_VERSION)

.PHONY: helm-upgrade-publisher
helm-upgrade-publisher:
# Dirty hack to bypass redis auth for demo
helm upgrade ihaq-worker charts/api --set image.tag=$(IHAQ_VERSION) --set redis.usePassword=false

###############################################################################
# WORKER
###############################################################################
Expand All @@ -169,6 +174,10 @@ push-mutable-worker-image: registry-login
docker tag $(FTH_REGISTRY)/ihaq-worker:$(IHAQ_VERSION) $(FTH_REGISTRY)/ihaq-worker:$(MUTABLE_VERSION)
docker push $(FTH_REGISTRY)/ihaq-worker:$(MUTABLE_VERSION)

.PHONY: helm-upgrade-worker
helm-upgrade-client:
helm upgrade ihaq-worker charts/worker --set image.tag=$(IHAQ_VERSION)

###############################################################################
# CLIENT
###############################################################################
Expand All @@ -189,3 +198,7 @@ push-client-image: registry-login
push-mutable-client-image: registry-login
docker tag $(FTH_REGISTRY)/ihaq-client:$(IHAQ_VERSION) $(FTH_REGISTRY)/ihaq-client:$(MUTABLE_VERSION)
docker push $(FTH_REGISTRY)/ihaq-client:$(MUTABLE_VERSION)

.PHONY: helm-upgrade-client
helm-upgrade-client:
helm upgrade ihaq-client charts/client --set image.tag=$(IHAQ_VERSION)

0 comments on commit 0d6f797

Please sign in to comment.