Skip to content
.gitlab-ci.yml 1.47 KiB
Newer Older
nimrod's avatar
CI.
nimrod committed
---
nimrod's avatar
nimrod committed
include:
  - project: shore/ci-templates
    file: templates/pre-commit.yml

nimrod's avatar
nimrod committed
stages:
  - test
  - build

nimrod's avatar
nimrod committed
variables:
nimrod's avatar
nimrod committed
  VERSION: 0.0.99.1
nimrod's avatar
nimrod committed

nimrod's avatar
CI.
nimrod committed
build:
nimrod's avatar
nimrod committed
  stage: build
nimrod's avatar
CI.
nimrod committed
  image: buildpack-deps:bullseye
  before_script:
    - apt-get update
nimrod's avatar
nimrod committed
    - >-
      apt-get install -y
      bash-completion
      cmake
      golang
      go-md2man
      meson
      podman
      shellcheck
      systemd
nimrod's avatar
nimrod committed
    - >-
      git clone
      --depth=1
      "--branch=$VERSION"
      https://github.com/containers/toolbox.git
nimrod's avatar
CI.
nimrod committed
    - cd toolbox
  script:
    - meson -Dprofile_dir=/etc/profile.d builddir
    - ninja -C builddir
  after_script:
    # I would have prefered to use ninja install with a different prefix, but
    # alas the Bash completion doesn't take the prefix into account nor can it
    # be overwritten, so I went for a manual approach.
    - mkdir -p output/usr/local/share/man/man1
nimrod's avatar
nimrod committed
    - cp toolbox/builddir/doc/* output/usr/local/share/man/man1/
    - mkdir -p output/usr/local/bin
nimrod's avatar
nimrod committed
    - cp toolbox/builddir/src/toolbox output/usr/local/bin/
    - mkdir -p output/usr/share/bash-completion/completions
    # yamllint disable-line rule:line-length
nimrod's avatar
nimrod committed
    - cp toolbox/completion/bash/toolbox output/usr/share/bash-completion/completions/
    - tar -C output -czf toolbox.tar.gz ./
nimrod's avatar
CI.
nimrod committed
  artifacts:
    paths:
      - toolbox/builddir/src/toolbox
      - toolbox/builddir/doc/
      - toolbox/builddir/meson-logs/
      - toolbox/builddir/.ninja_log
      - toolbox/completion/bash/toolbox
      - toolbox.tar.gz