.gitlab-ci.yml 1.26 KB
Newer Older
1
2
default:
  image: "archlinux:latest"
3
4

stages:
5
  - lint
6
  - build
7

Christian Rebischke's avatar
Christian Rebischke committed
8
shellcheck:
9
  stage: lint
10
11
  before_script:
    - pacman -Syu --needed --noconfirm shellcheck
Christian Rebischke's avatar
Christian Rebischke committed
12
13
14
15
  script:
    find . -iname "*.sh" -exec shellcheck {} +

shfmt:
16
  stage: lint
17
18
  before_script:
    - pacman -Syu --needed --noconfirm shfmt
Christian Rebischke's avatar
Christian Rebischke committed
19
  script:
20
    find . -iname "*.sh" -exec shfmt -i 2 -ci -d {} +
Christian Rebischke's avatar
Christian Rebischke committed
21
22

yapf:
23
  stage: lint
24
25
  before_script:
    - pacman -Syu --needed --noconfirm yapf
Christian Rebischke's avatar
Christian Rebischke committed
26
27
28
29
  script:
    find . -iname "*.py" -exec python3 -m yapf -d {} +

flake8:
30
  stage: lint
31
32
  before_script:
    - pacman -Syu --needed --noconfirm flake8
Christian Rebischke's avatar
Christian Rebischke committed
33
34
35
36
  script:
    find . -iname "*.py" -exec python3 -m flake8 {} +

validate-packer:
37
  stage: lint
38
39
  before_script:
    - pacman -Syu --needed --noconfirm packer
Christian Rebischke's avatar
Christian Rebischke committed
40
  script:
41
42
43
    - packer validate -var "iso_checksum_url=https://mirror.pkgbuild.com/iso/latest/sha1sums.txt" -except=vagrant-cloud vagrant.json
    - packer validate local.json
    - packer validate cloud.json
Christian Rebischke's avatar
Christian Rebischke committed
44
45

build:
46
47
48
49
  stage: build
  tags:
    - secure-kvm
    - secure-virtualbox
50
  before_script:
51
    - pacman -Syu --needed --noconfirm qemu-headless virtualbox packer
52
  script:
Christian Rebischke's avatar
Christian Rebischke committed
53
    packer build -parallel-builds=1 -var 'vagrant_cloud_token=${VAGRANT_API_TOKEN}'-var 'headless=true' -var 'write_zeroes=yes' -except=vmware-iso vagrant.json