.gitlab-ci.yml 2.08 KB
Newer Older
TonyFord's avatar
TonyFord committed
1
2
3
4
5
6
7
8
9
10
stages:
  - build
  - start
  - stop
  - uninstall
  - remove

build-explorer:
  stage: build
  tags:
TonyFord's avatar
TonyFord committed
11
    - kaana.red
TonyFord's avatar
TonyFord committed
12
13
  only:
    refs:
TonyFord's avatar
TonyFord committed
14
      - master
TonyFord's avatar
TonyFord committed
15
16
17
18
19
    variables:
      - $CMD =~ /build/
  before_script:
    - export RUNNER_UID=`id -u`
    - export RUNNER_GID=`id -g`
TonyFord's avatar
TonyFord committed
20
    - cat ${CCE_CONF} | sed -e s/MYSQL_USER/${MYSQL_USER}/g -e s/MYSQL_PASSWORD/${MYSQL_PASSWORD}/g -e s/MYSQL_DATABASE_PORT/${MYSQL_DATABASE_PORT}/g > ./cce.conf
21
    - export LH_PORT=${LH_PORT_explorer} && curl https://git.fairkom.net/faircoin.co/admin/-/raw/master/nginx_proxy | sed -e s/DOMAIN/${CI_PROJECT_NAME}/g -e s/LH_PORT/${LH_PORT}/g > ${CI_PROJECT_NAME}
TonyFord's avatar
TonyFord committed
22
23
  script:
    - docker-compose stop
TonyFord's avatar
TonyFord committed
24
    - docker-compose down -v
TonyFord's avatar
ts    
TonyFord committed
25
    - docker-compose build app
TonyFord's avatar
TonyFord committed
26
    - docker-compose up -d db
TonyFord's avatar
ts    
TonyFord committed
27
    - sleep 20
TonyFord's avatar
fixes    
TonyFord committed
28
    - chmod +x create_db.sh
TonyFord's avatar
TonyFord committed
29
    - docker-compose exec -T db /opt/explorer.kaana.red/create_db.sh
TonyFord's avatar
ts    
TonyFord committed
30
    - docker-compose up -d app
TonyFord's avatar
TonyFord committed
31
    - docker-compose exec -T app python3 dbload.py -n -l
TonyFord's avatar
ts    
TonyFord committed
32
33
  timeout: 6h

TonyFord's avatar
TonyFord committed
34
35
36
start-explorer:
  stage: start
  tags:
TonyFord's avatar
TonyFord committed
37
    - kaana.red
TonyFord's avatar
TonyFord committed
38
39
  only:
    refs:
TonyFord's avatar
TonyFord committed
40
      - master
TonyFord's avatar
TonyFord committed
41
42
43
44
45
    variables:
      - $CMD =~ /build|start/
  before_script:
    - export RUNNER_UID=`id -u`
    - export RUNNER_GID=`id -g`
TonyFord's avatar
TonyFord committed
46
    - cat ${CCE_CONF} | sed -e s/MYSQL_USER/${MYSQL_USER}/g -e s/MYSQL_PASSWORD/${MYSQL_PASSWORD}/g -e s/MYSQL_DATABASE_PORT/${MYSQL_DATABASE_PORT}/g > ./cce.conf
47
48
    - export LH_PORT=${LH_PORT_explorer} && curl https://git.fairkom.net/faircoin.co/admin/-/raw/master/nginx_proxy | sed -e s/DOMAIN/${CI_PROJECT_NAME}/g -e s/LH_PORT/${LH_PORT}/g > ${CI_PROJECT_NAME}
    - cat ${SERVER_CONF} | sed -e s/LH_PORT_explorer/${LH_PORT_explorer}/g > ./server.conf
TonyFord's avatar
TonyFord committed
49
50
51
  script:
    - docker-compose stop
    - docker-compose up -d
TonyFord's avatar
TonyFord committed
52
    - docker-compose exec -T app python3 websrv.py
TonyFord's avatar
TonyFord committed
53
54
55
56

stop-explorer:
  stage: stop
  tags:
TonyFord's avatar
TonyFord committed
57
    - kaana.red
TonyFord's avatar
TonyFord committed
58
59
  only:
    refs:
TonyFord's avatar
TonyFord committed
60
      - master
TonyFord's avatar
TonyFord committed
61
62
63
64
65
66
67
68
    variables:
      - $CMD =~ /stop/
  script:
    - docker-compose stop

uninstall-explorer:
  stage: uninstall
  tags:
TonyFord's avatar
TonyFord committed
69
    - kaana.red
TonyFord's avatar
TonyFord committed
70
71
  only:
    refs:
TonyFord's avatar
TonyFord committed
72
      - master
TonyFord's avatar
TonyFord committed
73
74
75
76
    variables:
      - $CMD =~ /uninstall/
  script:
    - docker-compose stop
TonyFord's avatar
TonyFord committed
77
    - docker-compose down -v