Merge branch 'tibor' into 'master'

Tibor

See merge request bossanyit/aitrainer_server!9
This commit is contained in:
Bossanyi Tibor 2020-05-12 19:46:10 +00:00
commit 58e97691f0
3 changed files with 13 additions and 8 deletions

View File

@ -1,11 +1,10 @@
services:
- mysql:latest
stages: stages:
- build - build
- prepare - prepare
- test - test
# - deploy - deploy
variables: variables:
# Configure mysql environment variables (https://hub.docker.com/_/mysql/) # Configure mysql environment variables (https://hub.docker.com/_/mysql/)
@ -43,7 +42,7 @@ connect:
script: script:
- apt-get update && apt-get --assume-yes install mysql-client - apt-get update && apt-get --assume-yes install mysql-client
- mysql --user=root --password="$MYSQL_ROOT_PASSWORD" --host=mysql -e "use $MYSQL_DATABASE; show tables;" - mysql --user=root --password="$MYSQL_ROOT_PASSWORD" --host=mysql -e "use $MYSQL_DATABASE; show tables;"
- mysql --user=root --password="$MYSQL_ROOT_PASSWORD" --host=mysql -e "use $MYSQL_DATABASE; DROP table customer; DROP table exercises; DROP table exercise_types; DROP table exercise_ages;" - mysql --user=root --password="$MYSQL_ROOT_PASSWORD" --host=mysql -e "use $MYSQL_DATABASE; DROP table if exists customer; DROP table if exists exercises; DROP table if exists exercise_type; DROP table if exists exercise_ages;"
- mysql --user=root --password="$MYSQL_ROOT_PASSWORD" --host=mysql < "data/db/install.sql" #first time - mysql --user=root --password="$MYSQL_ROOT_PASSWORD" --host=mysql < "data/db/install.sql" #first time
test: test:
@ -53,10 +52,14 @@ test:
- export spring_profiles_active=test - export spring_profiles_active=test
- ./gradlew check - ./gradlew check
#deploy: deploy:
# stage: deploy stage: deploy
# script: image: mysql:latest
# - ./deploy script:
- apt-get update && apt-get --assume-yes install sshpass
- ci-cd/deploy.sh
only:
- master
after_script: after_script:
- echo "End CI" - echo "End CI"

1
ci-cd/.ssh/.scp Normal file
View File

@ -0,0 +1 @@
tbi6012AndiBossanyi

1
ci-cd/deploy.sh Normal file
View File

@ -0,0 +1 @@
sshpass -f /ci-cd/.ssh/.scp scp build/libs/aitrainer_server-0.0.2.jar bosi@andio.shop:/home/bosi/deploy/aitrainer_server.jar