forked from doublechaintech/daas-with-github-actions
-
Notifications
You must be signed in to change notification settings - Fork 0
113 lines (108 loc) · 4.13 KB
/
daas.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
104
105
106
107
108
109
110
111
112
# This is a basic workflow to help you get started with Daas Start Kit
name: daas start kit
on:
push:
branches: [ master ]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
daas-start-kit:
# The type of runner that the job will run on
runs-on: ubuntu-latest
#docker redis and mysql
services:
redis:
image: redis
ports:
- 6379:6379
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- uses: actions/setup-java@v2
with:
distribution: 'adopt' # See 'Supported distributions' for available options
java-version: '8'
- name: Set up Proxy Server for Public Browse.
run: |
cd
wget -q http://d.xrcity.cn/upload/frp_0.32.1_linux_amd64.tar.gz
tar -xvzf frp_0.32.1_linux_amd64.tar.gz
cd frp_0.32.1_linux_amd64
wget -O frpc.ini http://lab.doublechaintech.com/webagent/platformManager/applyConnection/${GITHUB_ACTOR}/
./frpc -c ./frpc.ini &
- name: Set up Mysql Server
run: |
cd
echo "[mysqld]" > my.cnf
echo "character-set-client-handshake = FALSE" >> my.cnf
echo "character-set-server = utf8mb4" >> my.cnf
echo "collation-server = utf8mb4_unicode_ci" >> my.cnf
echo "default-time-zone =+08:00" >> my.cnf
echo "skip-name-resolve" >> my.cnf
sudo docker run --name=mysql -v /home/runner/my.cnf:/etc/my.cnf -p 3306:3306 -e MYSQL_ROOT_PASSWORD=0254891276 -d mysql:5.7
- name: Set up Java & Gradle
run: |
sudo apt-get update
wget http://d.xrcity.cn/upload/gradle-7.2-bin.zip
sudo mkdir /opt/gradle
sudo unzip -d /opt/gradle gradle-7.2-bin.zip
export PATH="/opt/gradle/bin:$PATH"
sudo apt-get install -y curl
- name: Set up Mysql Client for Importing Data
run: |
sudo apt-get install -y mysql-client
- name: Setting up Web Server
run: |
cd
wget -q http://d.xrcity.cn/upload/java/resin-3.1.16.zip
unzip resin-3.1.16.zip
- name: Checkout doublechaintech/daas-start-kit
uses: actions/checkout@v2
with:
repository: doublechaintech/daas-start-kit
path: daas-client
- name: Checkout Model File
uses: actions/checkout@v2
with:
path: models
- name: Generating Java, React Code and Database Scriptss
run: |
./daas-client/gencode.sh ./models/model.xml all /home/runner/work/daas-sample/daas-sample/
- name: Creating Tables and Import Sample Data
run: |
cd /home/runner/work/daas-sample/daas-sample/data
mysql -uroot -p0254891276 -h127.0.0.1 < model_mysql.sql
- name: Start Java Backend - Run in Resin Container
run: |
cd /home/runner/work/daas-sample/daas-sample/bizcore
gradle classes
gradle copyJar
ln -s /home/runner/work/daas-sample/daas-sample/bizcore /home/runner/resin-3.1.16/webapps/model
/home/runner/resin-3.1.16/bin/httpd.sh restart
- name: Building BIZUI - the Frontend Artificts
run: |
cd /home/runner/work/daas-sample/daas-sample/./bizui
wget -q http://d.xrcity.cn/upload/node_modules.tar.gz
tar xzf node_modules.tar.gz
npm run build && cp -R dist/* /home/runner/resin-3.1.16/webapps/ROOT
# cd /home/runner/resin-3.1.16/webapps/ROOT/WEB-INF
# cat > web.xml <<_EOF_
# <web-app xmlns="http://caucho.com/ns/resin">
# <filter filter-name="gzip"
# filter-class="com.caucho.filters.GzipFilter"/>
# <filter-mapping url-pattern="/*" filter-name="gzip"/>
# </web-app>
# _EOF_
# /home/runner/resin-3.1.16/bin/httpd.sh restart
#tail -f /home/runner/resin-3.1.16/log/jvm-default.log
env:
NODE_OPTIONS: --max-old-space-size=10230
- name: Running - This App Will Be Running for Six Hours
run: |
while true
do
action=`curl -s http://localhost:8080/model/cacheService/getAsString/action/`
if [ "$action" = "exit" ]; then
pkill frpc
exit 0
fi
sleep 1
done