jkulvich

Untitled

Apr 7th, 2020
154
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. stages:
  2.  - swagger
  3.   - build
  4.   - deploy
  5.  
  6. swagger:
  7.   stage: swagger
  8.   only:
  9.    - dev
  10.   script:
  11.    - export go=/usr/local/go/bin/go
  12.     - $go get -u github.com/swaggo/swag/cmd/swag
  13.     - export swag=/root/go/bin/swag
  14.     - $swag init -o ./swagger
  15.     - cp -rf ./swagger /root
  16.  
  17. build:
  18.   stage: build
  19.   only:
  20.    - dev
  21.   script:
  22.    - export go=/usr/local/go/bin/go
  23.     - export name=gschat
  24.     - $go get
  25.     - $go build -o $name
  26.     - mv $name /root
  27.  
  28. deploy:
  29.   stage: deploy
  30.   only:
  31.    - dev
  32.   script:
  33.    - export go=/usr/local/go/bin/go
  34.     - tmux new -d ''
  35.     - if [ "$(tmux ls | grep gschat)" != "" ]; then tmux kill-session -t gschat; fi
  36.     - mv -f ./config-dev.yaml /root/config.yaml
  37.     - mkdir -p /root/assets
  38.     - mkdir -p /root/assets/web
  39.     - cp -rf ./assets/mail /root/assets
  40.     - cd /root
  41.     - tmux new -s gschat -d 'while true; do echo '\n\n\n' >> gschat.log; date >> gschat.log; /root/gschat 2>> /root/assets/web/logs.txt; sleep 5; done'
RAW Paste Data