.gitlab-ci.yml 1.28 KB
Newer Older
1
2
default:
  image: "archlinux:latest"
3
4
5
6
7
8
9
10

stages:
  - shfmt
  - shellcheck
  - yapf
  - flake8
  - validate-packer
  - build
11

Christian Rebischke's avatar
Christian Rebischke committed
12
shellcheck:
13
  stage: shellcheck
14
15
  before_script:
    - pacman -Syu --needed --noconfirm shellcheck
Christian Rebischke's avatar
Christian Rebischke committed
16
17
18
19
  script:
    find . -iname "*.sh" -exec shellcheck {} +

shfmt:
20
  stage: shfmt
21
22
  before_script:
    - pacman -Syu --needed --noconfirm shfmt
Christian Rebischke's avatar
Christian Rebischke committed
23
  script:
24
    find . -iname "*.sh" -exec shfmt -i 2 -ci -d {} +
Christian Rebischke's avatar
Christian Rebischke committed
25
26

yapf:
27
  stage: yapf
28
29
  before_script:
    - pacman -Syu --needed --noconfirm yapf
Christian Rebischke's avatar
Christian Rebischke committed
30
31
32
33
  script:
    find . -iname "*.py" -exec python3 -m yapf -d {} +

flake8:
34
  stage: flake8
35
36
  before_script:
    - pacman -Syu --needed --noconfirm flake8
Christian Rebischke's avatar
Christian Rebischke committed
37
38
39
40
  script:
    find . -iname "*.py" -exec python3 -m flake8 {} +

validate-packer:
41
  stage: validate-packer
42
43
  before_script:
    - pacman -Syu --needed --noconfirm packer
Christian Rebischke's avatar
Christian Rebischke committed
44
  script:
45
46
47
    - 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
48
49

build:
50
51
52
53
  stage: build
  tags:
    - secure-kvm
    - secure-virtualbox
54
55
  before_script:
    - pacman -Syu --needed --noconfirm qemu-headless virtualbox
56
  script:
57
    packer build -parallel-builds=1 -var 'headless=true' -var 'write_zeroes=yes' -except=vmware-iso local.json