.gitlab-ci.yml 1.9 KB
Newer Older
root's avatar
root committed
1
2
3
## Template para empacotamento utilizando o Gitlab-ci.

stages:
4
    - lint
root's avatar
root committed
5
6
7
8
    - build
    - test
    - deploy

9
10
11
12
13
14
15
16
17
18
19
20
21
22
lint_shell:
  stage: lint
  tags:
    - debian-packaging
  script:
    - apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install wget locales locales-all -y
    - locale-gen pt_BR.UTF-8
    - export LANG=pt_BR.UTF-8
    - scversion="stable" # or "v0.4.7", or "latest"
    - wget "https://storage.googleapis.com/shellcheck/shellcheck-$scversion.linux.x86_64.tar.xz"
    - tar --xz -xvf "shellcheck-$scversion.linux.x86_64.tar.xz"
    - shellcheck() { "shellcheck-$scversion/shellcheck" "$@"; }
    - ./.linter_shell.sh

root's avatar
root committed
23
24
25
26
27
28
29
30
build:
  stage: build
  artifacts:
    paths:
      - build/
  tags:
    - debian-packaging
  script:
31
    - apt-get update && apt-get install -y libx11-dev libcairo2-dev 
root's avatar
root committed
32
33
34
35
36
37
    - ./.build.sh

test:
  stage: test
  tags:
    - ubuntu
38
    - debootstrap
root's avatar
root committed
39
  script:
40
41
42
43
    - apt-get update && apt-get install -y wget
    - echo "deb http://repo.c3sl.ufpr.br/le6/ unstable main" > /etc/apt/sources.list.d/le6.list
    - wget -O- http://repo.c3sl.ufpr.br/le6/le.c3sl.ufpr.br.key | apt-key add -
    - echo "Installation test:"
44
    - apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install $(pwd)/build/*.deb language-pack-gnome-pt language-pack-pt-base
45
    - echo "Removal test:"
46
    - pkg_name=$(head -n 1 package/debian/changelog | cut -d' ' -f1)
47
    - DEBIAN_FRONTEND=noninteractive apt -y remove $pkg_name
root's avatar
root committed
48
49
50
  dependencies:
    - build

51
52
53
54
55
56
57
58
59
60
61
deploy_for_unstable:
  stage: deploy
  only:
      - develop
  tags:
    - debian-packaging
  script:
    - ./.deploy.sh
  dependencies:
    - build

root's avatar
root committed
62
63
64
deploy_for_testing:
  stage: deploy
  only:
65
      - /^rc-.*$/
root's avatar
root committed
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
  tags:
    - debian-packaging
  script:
    - ./.deploy.sh
  dependencies:
    - build

deploy_for_stable:
  stage: deploy
  when: manual
  only:
      - master
  tags:
    - debian-packaging
  script:
    - ./.deploy.sh
  dependencies:
    - build