generated from bmstu-rsoi/lab4-template
-
Notifications
You must be signed in to change notification settings - Fork 1
99 lines (87 loc) · 3.16 KB
/
classroom.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
name: GitHub Classroom Workflow
on:
push:
branches:
- master
pull_request:
branches:
- master
env:
OKTETO_SERVER: ${{ secrets.OKTETO_SERVER }}
OKTETO_TOKEN: ${{ secrets.OKTETO_TOKEN }}
jobs:
build:
name: Autograding
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Login in dockerhub
uses: docker/login-action@v2
with:
username: vgilko
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'
- name: Build with Maven
uses: stCarolas/[email protected]
with:
maven-version: 3.6.3
- name: cars build
run: mvn -f cars/pom.xml --batch-mode --update-snapshots clean install -DskipTests
- name: payment build
run: mvn -f payment/pom.xml --batch-mode --update-snapshots clean install -DskipTests
- name: rental build
run: mvn -f rental/pom.xml --batch-mode --update-snapshots clean install -DskipTests
- name: gateway build
run: mvn -f gateway/pom.xml --batch-mode --update-snapshots clean install -DskipTests
- name: Build images
run: |
docker build ./rental/ -t vgilko/dockerhub:rental
docker build ./payment/ -t vgilko/dockerhub:payment
docker build ./cars/ -t vgilko/dockerhub:cars
docker build ./gateway/ -t vgilko/dockerhub:gateway
- name: Push docker images
run: |
docker push vgilko/dockerhub:rental
docker push vgilko/dockerhub:payment
docker push vgilko/dockerhub:cars
docker push vgilko/dockerhub:gateway
sleep 30
- name: Deploy to Okteto
run: |
kubectl config set-cluster car-rental-service-cluster --server="$OKTETO_SERVER" --insecure-skip-tls-verify=true
kubectl config set-credentials cloud_okteto_com-user --token="$OKTETO_TOKEN"
kubectl config set-context default --cluster=car-rental-service-cluster --user=cloud_okteto_com-user --namespace="vgilko"
kubectl config use-context default
cd k8s && helm upgrade --install services ./services-chart
sleep 60
- name: Run API Tests
uses: matt-ball/newman-action@master
with:
collection: info/variants/v3/postman/collection.json
environment: info/variants/v3/postman/environment.json
delayRequest: 100
reporters: '[ "cli" ]'
- name: Dump docker logs on failure
if: failure()
uses: jwalton/gh-docker-logs@v2
with:
images: 'library/postgres:13,gateway,rental,payment,cars'
tail: '250'
- uses: education/autograding@v1
id: autograder
continue-on-error: true
- name: Github auto grader mark
uses: Romanow/[email protected]
with:
google_token: ${{secrets.GOOGLE_API_KEY}}
sheet_id: "1xkgjUX6Qmk7rdJG-QPOToav-HWWtthJjnShIKnw3oIY"
homework_number: 4
user_column: 'D'
column_offset: 'F'
mark: "'+"