🚀save for delete #41
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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 | |