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

variables:
  PACKER_LOG: 1
6
7

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

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

shfmt:
20
  stage: lint
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

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

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

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

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
66
    - packer build -parallel-builds=1 -var "vagrant_cloud_token=$VAGRANT_API_TOKEN" -except=vmware-iso vagrant.json
67
68
69
  only:
    variables:
      - $SCHEDULED_PUBLISH == "TRUE"
70
  resource_group: vm-build