.gitlab-ci.yml 2.24 KB
Newer Older
1
2
3
## Template para empacotamento utilizando o Gitlab-ci.

stages:
4
    - lint
5
6
7
8
    - build
    - test
    - deploy

9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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



lint_python:
  stage: lint
  tags:
    - debian-packaging
  script:
    - apt-get update && apt-get install python3-pip -y
    - pip3 install -r py_linter_requirements.txt
    - ./.linter_python.sh


35
36
37
38
39
40
build:
  stage: build
  artifacts:
    paths:
      - build/
  tags:
41
    - debian-packaging
42
  script:
43
    - apt-get update && apt-get install -y build-essential devscripts dh-make dh-python dh-systemd quilt python-setuptools python3-all python-all python-distutils-extra python3 python3-dev python3-all-dev pandoc 
44
    - ./.build.sh
45
46
47
48
49

test:
  stage: test
  tags:
    - ubuntu
50
    - regular
51
  script:
52
    - apt-get update && apt-get install -y wget
53
    - echo "deb http://repo.c3sl.ufpr.br/le6/ unstable main" > /etc/apt/sources.list.d/le6.list
54
    - wget -O- http://repo.c3sl.ufpr.br/le6/le.c3sl.ufpr.br.key | apt-key add -
55
    - echo "Installation test:"
56
    - apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install $(pwd)/build/*.deb language-pack-gnome-pt language-pack-pt-base
57
    - echo "Removal test:"
58
    - pkg_name=$(head -n 1 package/debian/changelog | cut -d' ' -f1)
59
60
61
62
63
64
65
66
67
68
69
70
    - DEBIAN_FRONTEND=noninteractive apt -y remove $pkg_name
  dependencies:
    - build

deploy_for_unstable:
  stage: deploy
  only:
      - develop
  tags:
    - debian-packaging
  script:
    - ./.deploy.sh
71
72
73
74
75
  dependencies:
    - build

deploy_for_testing:
  stage: deploy
76
  when: manual
77
78
79
80
81
82
  only:
      - master
  tags:
    - debian-packaging
  script:
    - ./.deploy.sh
83
84
85
  dependencies:
    - build

86
deploy_for_stable:
87
  stage: deploy
88
  when: manual
89
  only:
90
      - master
91
  tags:
92
    - debian-packaging
93
  script:
94
    - ./.deploy.sh
95
96
  dependencies:
    - build