.gitlab-ci.yml 1.54 KB
Newer Older
1
2
default:
  image: "archlinux:latest"
Sven-Hendrik Haase's avatar
Sven-Hendrik Haase committed
3
  variables:
Sven-Hendrik Haase's avatar
Sven-Hendrik Haase committed
4
    PACKER_LOG: 1
5
6

stages:
7
  - lint
8
  - build
9
  - publish
10

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

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

validate-packer:
26
  stage: lint
27
28
  before_script:
    - pacman -Syu --needed --noconfirm packer
Christian Rebischke's avatar
Christian Rebischke committed
29
  script:
30
31
32
    - 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
33

34
35
build:cloud-qemu:
  stage: build
Sven-Hendrik Haase's avatar
Sven-Hendrik Haase committed
36
37
  tags:
    - ipv6
38
39
40
  before_script:
    - pacman -Syu --needed --noconfirm packer qemu-headless
  script:
Sven-Hendrik Haase's avatar
Sven-Hendrik Haase committed
41
    - packer build -except=sign cloud.json
42
43
44
  artifacts:
    name: "cloud-qemu"
    paths:
Sven-Hendrik Haase's avatar
Sven-Hendrik Haase committed
45
      - "release/Arch-Linux-x86_64-cloudimg-*.qcow2"
46
47
48
    expire_in: 2d

build:vagrant-qemu:
49
  stage: build
Sven-Hendrik Haase's avatar
Sven-Hendrik Haase committed
50
51
  tags:
    - ipv6
52
  before_script:
53
    - pacman -Syu --needed --noconfirm packer qemu-headless
54
  script:
Sven-Hendrik Haase's avatar
Sven-Hendrik Haase committed
55
    - packer build -only=qemu local.json
56
57
58
59
60
61
62
63
64

publish:
  stage: publish
  tags:
    - secure-kvm
    - secure-virtualbox
  before_script:
    - pacman -Syu --needed --noconfirm qemu-headless virtualbox packer
  script:
Sven-Hendrik Haase's avatar
Sven-Hendrik Haase committed
65
    - packer build -parallel-builds=1 -var "vagrant_cloud_token=$VAGRANT_API_TOKEN" -except=vmware-iso vagrant.json
66
67
68
  only:
    variables:
      - $SCHEDULED_PUBLISH == "TRUE"
69
  resource_group: vm-build