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

stages:
  - shfmt
  - shellcheck
  - yapf
  - flake8
  - validate-packer
  - validate-local
  - validate-cloud
  - build
13
14

before_script:
Christian Rebischke's avatar
Christian Rebischke committed
15
  - pacman -Syu --needed --noconfirm qemu-headless virtualbox packer shfmt shellcheck yapf flake8
16

Christian Rebischke's avatar
Christian Rebischke committed
17
shellcheck:
18
  stage: shellcheck
Christian Rebischke's avatar
Christian Rebischke committed
19
20
21
22
  script:
    find . -iname "*.sh" -exec shellcheck {} +

shfmt:
23
  stage: shfmt
Christian Rebischke's avatar
Christian Rebischke committed
24
  script:
25
    find . -iname "*.sh" -exec shfmt -i 2 -ci -d {} +
Christian Rebischke's avatar
Christian Rebischke committed
26
27

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

flake8:
33
  stage: flake8
Christian Rebischke's avatar
Christian Rebischke committed
34
35
36
37
  script:
    find . -iname "*.py" -exec python3 -m flake8 {} +

validate-packer:
38
  stage: validate-packer
Christian Rebischke's avatar
Christian Rebischke committed
39
40
41
42
  script:
    packer validate -var "iso_checksum_url=https://mirror.pkgbuild.com/iso/latest/sha1sums.txt" -except=vagrant-cloud vagrant.json

validate-local:
43
  stage: validate-local
Christian Rebischke's avatar
Christian Rebischke committed
44
45
46
47
  script:
    packer validate local.json

validate-cloud:
48
  stage: validate-cloud
Christian Rebischke's avatar
Christian Rebischke committed
49
50
51
52
  script:
    packer validate cloud.json

build:
53
54
55
56
  stage: build
  tags:
    - secure-kvm
    - secure-virtualbox
57
  script:
58
    packer build -parallel-builds=1 -var 'headless=true' -var 'write_zeroes=yes' -except=vmware-iso local.json