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

4
stages:
5
  - lint
6
  - build
7
  - publish
8

Christian Rebischke's avatar
Christian Rebischke committed
9
shellcheck:
10
  stage: lint
11
12
  before_script:
    - pacman -Syu --needed --noconfirm shellcheck
Christian Rebischke's avatar
Christian Rebischke committed
13
  script:
14
    - shellcheck **/*.sh
Christian Rebischke's avatar
Christian Rebischke committed
15
16

shfmt:
17
  stage: lint
18
19
  before_script:
    - pacman -Syu --needed --noconfirm shfmt
Christian Rebischke's avatar
Christian Rebischke committed
20
  script:
21
    - shfmt -i 2 -ci -d **/*.sh
Christian Rebischke's avatar
Christian Rebischke committed
22

23
build:
24
  stage: build
25
  before_script:
26
    - pacman -Syu --needed --noconfirm qemu-headless libisoburn
27
  script:
28
29
    - echo "BUILD_DATE=$(date -I)" > build.env
    - . build.env
30
    - ./build-in-qemu.sh
31
    - mv build.env output/
32
  artifacts:
33
    name: "output"
34
    paths:
35
      - "output/*"
36
    expire_in: 2d
37
38
39
40

publish:
  stage: publish
  tags:
41
    - secure
42
  before_script:
43
    - pacman -Syu --needed --noconfirm vagrant
44
  script:
45
46
    - . output/build.env
    - vagrant cloud auth login --token "${VAGRANT_API_TOKEN}"
47
48
    - vagrant cloud auth login --check
    - vagrant cloud box show archlinux/archlinux
49
50
    - vagrant cloud publish archlinux/archlinux "v${BUILD_DATE}" libvirt output/Arch-Linux-x86_64-libvirt-*.box --release -f
    - vagrant cloud publish archlinux/archlinux "v${BUILD_DATE}" virtualbox output/Arch-Linux-x86_64-virtualbox-*.box --release -f
51
52
53
  only:
    variables:
      - $SCHEDULED_PUBLISH == "TRUE"
54
  resource_group: vm-build