.gitlab-ci.yml 1.26 KB
Newer Older
1
include:
2
3
   local: 'docker.gitlab-ci.yml'

4
5
6
variables:
  DOCKER_HOST: tcp://localhost:2375
  DOCKER_DRIVER: overlay2
7

8
9
10
11
stages:
  - version
  - build
  - deploy
12

13
.versioning_template:
14
15
16
17
18
   stage: version
   image: docker:19.03.4
   artifacts:
     paths:
       - shared-vars.sh
19
     expire_in: 1 week
20
   script:
21
22
     - echo $SGA_VERSION
     - echo "export VERSION=$SGA_VERSION" >> shared-vars.sh
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
versioning_master:
  extends: .versioning_template
  before_script:
    - export SGA_VERSION="latest"
  only:
    - master

versioning_tag:
  extends: .versioning_template
  before_script:
    - export SGA_VERSION=$(cat sga-daemon-*.rockspec | grep 'version[[:space:]]=[[:space:]]' | awk '{print $3}' | sed -E s/-[0-9]+//g | sed -E s/\"//g)
  only:
    - tags

static_check:
  stage: build
  image: repo.tecgraf.puc-rio.br:18089/soma/ubuntu:16.04-sga-posix
  script:
    - mkdir sgarest-daemon
    - curl -L https://git.tecgraf.puc-rio.br/csbase-dev/sgarest-daemon/-/archive/${CI_COMMIT_REF_NAME}/sgarest-daemon-${CI_COMMIT_REF_NAME}.tar.gz | tar xzf - -C sgarest-daemon --strip-components 1
    - cd sgarest-daemon
    - export errors=$(luac5.3 -p sgad | find . -regex ".*\.lua"  | awk '{print "luac5.3 -p "$1}' | sh -) 
    - ([ -z "$errors" ] && exit 0 || exit 1)
  only:
    - master
    - tags