This repository has been archived by the owner on Mar 25, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
60 lines (56 loc) · 2.99 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: build_poi
on:
push:
paths:
- "src/poi/**"
tags:
- v1.*
env:
RESOURCE_GROUP: 'teamResources'
CLUSTER_NAME: 'openhack-dpd-v2-0'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: main
- name: ACR build
id: acr
uses: azure/docker-login@v1
with:
login-server: ${{ secrets.REGISTRY_LOGIN_SERVER }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- run: |
cd ./src/poi
docker build --no-cache --build-arg IMAGE_VERSION="1.0" --build-arg IMAGE_CREATE_DATE="`date -u +"%Y-%m-%dT%H:%M:%SZ"`" --build-arg IMAGE_SOURCE_REVISION="`git rev-parse HEAD`" . -f ./../../dockerfiles/Dockerfile_3 -t ${{ secrets.REGISTRY_LOGIN_SERVER }}/tripinsights/poi:1.0
docker push ${{ secrets.REGISTRY_LOGIN_SERVER }}/tripinsights/poi:1.0
cd ../../src/user-java
docker build --no-cache --build-arg IMAGE_VERSION="1.0" --build-arg IMAGE_CREATE_DATE="`date -u +"%Y-%m-%dT%H:%M:%SZ"`" --build-arg IMAGE_SOURCE_REVISION="`git rev-parse HEAD`" . -f ./../../dockerfiles/Dockerfile_0 -t ${{ secrets.REGISTRY_LOGIN_SERVER }}/tripinsights/user-java:1.0
docker push ${{ secrets.REGISTRY_LOGIN_SERVER }}/tripinsights/user-java:1.0
cd ../../src/tripviewer
docker build . -f ./../../dockerfiles/Dockerfile_1 --no-cache --build-arg IMAGE_VERSION="1.0" --build-arg IMAGE_CREATE_DATE="`date -u +"%Y-%m-%dT%H:%M:%SZ"`" --build-arg IMAGE_SOURCE_REVISION="`git rev-parse HEAD`" -t ${{ secrets.REGISTRY_LOGIN_SERVER }}/tripinsights/tripviewer:1.0
docker push ${{ secrets.REGISTRY_LOGIN_SERVER }}/tripinsights/tripviewer:1.0
cd ../../src/userprofile
docker build . -f ./../../dockerfiles/Dockerfile_2 --no-cache --build-arg IMAGE_VERSION="1.0" --build-arg IMAGE_CREATE_DATE="`date -u +"%Y-%m-%dT%H:%M:%SZ"`" --build-arg IMAGE_SOURCE_REVISION="`git rev-parse HEAD`" -t ${{ secrets.REGISTRY_LOGIN_SERVER }}/tripinsights/userprofile:1.0
docker push ${{ secrets.REGISTRY_LOGIN_SERVER }}/tripinsights/userprofile:1.0
cd ../../src/trips
docker build . -f ./../../dockerfiles/Dockerfile_4 --no-cache --build-arg IMAGE_VERSION="1.0" --build-arg IMAGE_CREATE_DATE="`date -u +"%Y-%m-%dT%H:%M:%SZ"`" --build-arg IMAGE_SOURCE_REVISION="`git rev-parse HEAD`" -t ${{ secrets.REGISTRY_LOGIN_SERVER }}/tripinsights/trips:1.0
docker push ${{ secrets.REGISTRY_LOGIN_SERVER }}/tripinsights/trips:1.0
deploy:
runs-on: ubuntu-latest
steps:
- name: Install Kubctl
uses: azure/setup-kubectl@v1
with:
version: 'v1.18.14'
id: install
- name: AKS set context
uses: azure/aks-set-context@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
resource-group: ${{ env.RESOURCE_GROUP }}
cluster-name: ${{ env.CLUSTER_NAME }}
id: login