-
Notifications
You must be signed in to change notification settings - Fork 3
103 lines (84 loc) · 3.34 KB
/
mimock-bundle.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
102
103
name: Mimock Bundle App Pipeline
on: [workflow_dispatch]
jobs:
bundle-app:
name: Bundle spring-boot app with UI
runs-on: ubuntu-latest
env:
MIMOCK_CURRENT_VERSION: ${{ secrets.MIMOCK_CURRENT_VERSION }}
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Build Mimock app
run: |
make bundle-app
- name: Build platform bundles
run: |
cp -p ./mimock-backend/target/mimock-${{ secrets.MIMOCK_CURRENT_VERSION }}.jar ./installation/lib/mimock.jar
cd ./installation
zip -r mimock-${{ secrets.MIMOCK_CURRENT_VERSION }}.zip lib/*
cd .. && mv ./installation/mimock-${{ secrets.MIMOCK_CURRENT_VERSION }}.zip .
zip -ju mimock-${{ secrets.MIMOCK_CURRENT_VERSION }}.zip installation/*.bat installation/mimock.properties installation/psql_setup.sql
tar czf mimock-${{ secrets.MIMOCK_CURRENT_VERSION }}.tar.gz --directory=installation lib start mimock.properties setup_database psql_setup.sql
- name: Publish JAR
uses: actions/upload-artifact@v2
with:
name: mimock-${{ secrets.MIMOCK_CURRENT_VERSION }}-jar.zip
path: |
./mimock-backend/target/mimock-${{ secrets.MIMOCK_CURRENT_VERSION }}.jar
- name: Publish Linux Bundle
uses: actions/upload-artifact@v2
with:
name: mimock-${{ secrets.MIMOCK_CURRENT_VERSION }}.tar.gz
path: |
mimock-${{ secrets.MIMOCK_CURRENT_VERSION }}.tar.gz
- name: Publish Windows Bundle
uses: actions/upload-artifact@v2
with:
name: mimock-${{ secrets.MIMOCK_CURRENT_VERSION }}.zip
path: |
mimock-${{ secrets.MIMOCK_CURRENT_VERSION }}.zip
hold-release:
name: Wait for review
needs: bundle-app
runs-on: ubuntu-latest
environment:
name: mimockRelease
steps:
- name: Wait for reviewer to initiate the release
run: |
echo "Awaiting Review!"
push-docker-image:
name: Push Docker image to Docker Hub
needs: hold-release
runs-on: ubuntu-latest
env:
MIMOCK_CURRENT_VERSION: ${{ secrets.MIMOCK_CURRENT_VERSION }}
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Build JAR bundle-app
run: |
SKIP_TESTS=true make bundle-app
- name: Build mimock docker image
run: |
docker system prune -f
docker build -t mimock/mimock:slim . -f ./Dockerfile.slim
docker tag mimock/mimock:slim mimock/mimock:${{ secrets.MIMOCK_CURRENT_VERSION }}-slim
docker build -t mimock/mimock:latest . -f ./Dockerfile.complete
docker tag mimock/mimock:latest mimock/mimock:${{ secrets.MIMOCK_CURRENT_VERSION }}
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: mimock/mimock
- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
push: true
tags: mimock/mimock:${{ secrets.MIMOCK_CURRENT_VERSION }},mimock/mimock:latest,mimock/mimock:${{ secrets.MIMOCK_CURRENT_VERSION }}-slim