.gitlab-ci.yml 1.58 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
    - find . -iname "*.sh" -exec shellcheck {} +
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
    - find . -iname "*.sh" -exec shfmt -i 2 -ci -d {} +
Christian Rebischke's avatar
Christian Rebischke committed
22

23
24
# Note: We explicitly need the `ipv6` tag here because otherwise we'd get random
# gpg/pacman-key issues.
25
build:
26
  stage: build
Sven-Hendrik Haase's avatar
Sven-Hendrik Haase committed
27
28
  tags:
    - ipv6
29
  before_script:
30
    - pacman -Syu --needed --noconfirm qemu-headless libisoburn
31
  script:
32
    - ./build-in-qemu.sh
33
  artifacts:
34
    name: "output"
35
    paths:
36
      - "output/*"
37
    expire_in: 2d
38
39
40
41

publish:
  stage: publish
  tags:
42
43
    - ipv6
    - secure
44
  before_script:
45
    - pacman -Syu --needed --noconfirm vagrant
46
  script:
47
48
49
    - vagrant cloud auth login --token $VAGRANT_API_TOKEN
    - vagrant cloud auth login --check
    - vagrant cloud box show archlinux/archlinux
50
51
52
53
    - LIBVIRT_RELEASE=`ls output/Arch-Linux-x86_64-libvirt-*.box | awk -F "." '{print $1}'  | awk -F "-" '{print $5"."$6"."$7}'`
    - VIRTUALBOX_RELEASE=`ls output/Arch-Linux-x86_64-virtualbox-*.box | awk -F "." '{print $1}'  | awk -F "-" '{print $5"."$6"."$7}'`
    - vagrant cloud publish archlinux/archlinux $LIBVIRT_RELEASE libvirt output/Arch-Linux-x86_64-libvirt-*.box --release -f
    - vagrant cloud publish archlinux/archlinux $VIRTUALBOX_RELEASE virtualbox output/Arch-Linux-x86_64-virtualbox-*.box --release -f
54
55
56
  only:
    variables:
      - $SCHEDULED_PUBLISH == "TRUE"
57
  resource_group: vm-build