Skip to content

Commit 363f533

Browse files
committed
feat(ci): add github workflows and remove travis
1 parent fd2ce99 commit 363f533

File tree

4 files changed

+114
-28
lines changed

4 files changed

+114
-28
lines changed

.github/workflows/cd-development.yml

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: Continuous deployment in dev
2+
3+
on:
4+
push:
5+
branches:
6+
- development
7+
8+
jobs:
9+
check:
10+
runs-on: ubuntu-latest
11+
container: "openjdk:11-slim"
12+
steps:
13+
- uses: actions/checkout@v2
14+
- uses: actions/cache@v1
15+
with:
16+
path: ~/.gradle/caches
17+
key: ${{ runner.os }}-patio-api-gradle-${{ hashFiles('**/*.gradle') }}
18+
restore-keys: |
19+
${{ runner.os }}-patio-api-gradle-
20+
- uses: actions/cache@v1
21+
with:
22+
path: ~/.gradle/wrapper
23+
key: ${{ runner.os }}-patio-api-wrapper-${{ hashFiles('**/*.gradle') }}
24+
restore-keys: |
25+
${{ runner.os }}-patio-api-wrapper-
26+
- name: Tests
27+
run: ./gradlew test
28+
- name: PMD (src/main)
29+
run: ./gradlew pmdMain
30+
- name: PMD (src/test)
31+
run: ./gradlew pmdTest
32+
- name: Files have the license header
33+
run: ./gradlew license
34+
- name: Formatter (Spotless)
35+
run: ./gradlew spotlessCheck
36+
- name: Spotbugs (Main)
37+
run: ./gradlew spotbugsMain
38+
- name: Spotbugs (Test)
39+
run: ./gradlew spotbugsTest
40+
41+
docker:
42+
needs: check
43+
runs-on: ubuntu-latest
44+
container: "openjdk:11-slim"
45+
steps:
46+
- uses: actions/checkout@v2
47+
- name: Publish latest image to Docker Hub
48+
env:
49+
REGISTRY_KEY: ${{ secrets.REGISTRY_KEY }}
50+
REGISTRY_USER: ${{ secrets.REGISTRY_USER }}
51+
run: ./gradlew --stacktrace dockerPush -PregistryUser=$REGISTRY_USER -PregistryKey=$REGISTRY_KEY
52+
53+
deploy:
54+
needs: docker
55+
runs-on: ubuntu-latest
56+
steps:
57+
- name: Deploy to K8s (dev)
58+
uses: steebchen/kubectl@master
59+
env:
60+
KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG_DATA }}
61+
with:
62+
args: set image deployment/patio-api patio-api=kaleidosteam/patio-api
63+
- name: verify API deployment
64+
uses: steebchen/kubectl@master
65+
env:
66+
KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG_DATA }}
67+
KUBECTL_VERSION: "1.15"
68+
with:
69+
args: rollout restart deployment/patio-api
70+
- name: Make front be aware of API changes (Hack)
71+
uses: steebchen/kubectl@master
72+
env:
73+
KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG_DATA }}
74+
KUBECTL_VERSION: "1.15"
75+
with:
76+
args: rollout restart deployment/patio-front

.github/workflows/ci.yml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: API Continuos Integration
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
check:
7+
runs-on: ubuntu-latest
8+
container: "openjdk:11-slim"
9+
steps:
10+
- uses: actions/checkout@v2
11+
- uses: actions/cache@v1
12+
with:
13+
path: ~/.gradle/caches
14+
key: ${{ runner.os }}-patio-api-gradle-${{ hashFiles('**/*.gradle') }}
15+
restore-keys: |
16+
${{ runner.os }}-patio-api-gradle-
17+
- uses: actions/cache@v1
18+
with:
19+
path: ~/.gradle/wrapper
20+
key: ${{ runner.os }}-patio-api-wrapper-${{ hashFiles('**/*.gradle') }}
21+
restore-keys: |
22+
${{ runner.os }}-patio-api-wrapper-
23+
- name: Tests
24+
run: ./gradlew test
25+
- name: PMD (src/main)
26+
run: ./gradlew pmdMain
27+
- name: PMD (src/test)
28+
run: ./gradlew pmdTest
29+
- name: Files have the license header
30+
run: ./gradlew license
31+
- name: Formatter (Spotless)
32+
run: ./gradlew spotlessCheck
33+
- name: Spotbugs (Main)
34+
run: ./gradlew spotbugsMain
35+
- name: Spotbugs (Test)
36+
run: ./gradlew spotbugsTest

.travis.yml

-26
This file was deleted.

gradle/docker.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
docker {
22
registryCredentials {
3-
url = 'kaleidos-docker-registry.bintray.io'
43
username = project.properties.registryUser
54
password = project.properties.registryKey
65
}
76

87
javaApplication {
98
baseImage = 'openjdk:11-slim'
10-
tag = "kaleidos-docker-registry.bintray.io/dwbh/dwbh-api:$version"
9+
// tag = "kaleidosteam/patio-api:$version"
10+
tag = "kaleidosteam/patio-api:latest"
1111
}
1212
}

0 commit comments

Comments
 (0)