generated from bmstu-rsoi/lab4-template
-
Notifications
You must be signed in to change notification settings - Fork 0
101 lines (87 loc) · 3.12 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
100
101
name: GitHub Classroom Workflow
on:
push:
branches: [ master ]
pull_request:
branches:
- master
jobs:
build:
name: Autograding
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: docker/setup-buildx-action@v2
# TODO build, publish to docker hub, deploy to k8s
- name: set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 17
cache: gradle
- name: set up gradle
uses: gradle/gradle-build-action@v2
# Flight Service
- name: Grant execute permission for gradlew
run: cd flight-service && chmod +x gradlew
- name: Build with Gradle
run: cd flight-service && ./gradlew build
# Ticket Service
- name: Grant execute permission for gradlew
run: cd ticket-service && chmod +x gradlew
- name: Build with Gradle
run: cd ticket-service && ./gradlew build
# Bonus Service
- name: Grant execute permission for gradlew
run: cd bonus-service && chmod +x gradlew
- name: Build with Gradle
run: cd bonus-service && ./gradlew build
# Gateway Service
- name: Grant execute permission for gradlew
run: cd gateway-service && chmod +x gradlew
- name: Build with Gradle
run: cd gateway-service && ./gradlew build
- name: Login Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_LOGIN }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Push images
timeout-minutes: 10
run: |
docker compose build
docker compose push
docker compose up -d
docker commit postgres shemich/postgres:1.0
docker compose down
docker push shemich/postgres:1.0
- name: Deploy to k8s
run: |
kubectl config set-cluster flights-service-cluster --server="${{ secrets.OKTETO_SERVER }}" --insecure-skip-tls-verify=true
kubectl config set-credentials cloud_okteto_com-user --token="${{ secrets.OKTETO_TOKEN }}"
kubectl config set-context default --cluster=flights-service-cluster --user=cloud_okteto_com-user --namespace="shemich"
kubectl config use-context default
kubectl get pods
cd k8s && helm upgrade --install --force --debug services services-chart/
sleep 45
kubectl get pods
- name: Run API Tests
uses: matt-ball/newman-action@master
with:
collection: v1/postman/collection.json
environment: v1/postman/environment.json
delayRequest: 100
reporters: '[ "cli" ]'
- 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: "'+"