.gitlab-ci.yml 2.1 KB
Newer Older
1
image: chakralinux/chakra-iso:latest
Luca Giambonini's avatar
Luca Giambonini committed
2 3 4 5 6 7 8 9 10 11

variables:
  REPODIR: "$CI_PROJECT_DIR"

stages:
  - build
  - deploy-testing
  - deploy-final

before_script:
12 13 14 15
  # import the gitlab-ci scripts
  - git clone --depth 1 https://code.chakralinux.org/tools/chakra-gitlab-ci-scripts _gitlab-ci-scripts
  # setup basic environment settings, as root
  - _gitlab-ci-scripts/prepare.sh
Luca Giambonini's avatar
Luca Giambonini committed
16 17 18 19 20 21 22 23 24 25 26 27 28

build_iso:
  stage: build
  script:
    # pacstrap does not accept --config, copy the current configuration inside the container
    - cp config/pacman.conf /etc/pacman.conf
    - pacman -Syu --noconfirm
    - ./build
    # rename the generated iso from output.iso to a real name
    # name convention is: chakra-{YEAR}.{MONTH}.{DAY}-{SHA/8}-x86_64.iso
    - mv output.iso chakra-"$(date '+%Y')"."$(date '+%m')"."$(date '+%d')"-$(echo "${CI_COMMIT_SHA}"| cut -c -8)-x86_64.iso
    # sign the iso
    - echo "$GPG_PASSWORD" | gpg -sb --pinentry-mode loopback --passphrase-fd 0 ./*.iso
29
    - sha512sum *.iso >> chakra-"$(date '+%Y')"."$(date '+%m')"."$(date '+%d')"-$(echo "${CI_COMMIT_SHA}"| cut -c -8)-x86_64.iso.sha512sum
30
  when: manual
Luca Giambonini's avatar
Luca Giambonini committed
31 32 33 34
  artifacts:
    # expire artifacts per default - the gitlab web frontend can be used to keep
    # artifacts of interest for an unlimited time
    expire_in: 1 week
35
    when: always
Luca Giambonini's avatar
Luca Giambonini committed
36
    paths:
37
      - ./log
Luca Giambonini's avatar
Luca Giambonini committed
38 39 40 41 42
      - ./*.iso
      - ./*.iso.sig
      - ./*.iso.sha512sum
    name: "chakra-${CI_COMMIT_SHA}.iso"
  tags:
43
    - ISO
Luca Giambonini's avatar
Luca Giambonini committed
44 45 46 47 48 49 50 51 52 53 54 55 56

deploy_testing:
  stage: deploy-testing
  variables:
    DEPLOY_FOLDER: "testing"
    DEPLOY_SERVER: "$DEPLOY_SERVER"
    SSH_USER: "$SSH_USER"
    SSH_PORT: "$SSH_PORT"
  environment:
     name: testing-iso
     url: "${DEPLOY_SERVER}/testing"
  when: manual
  script:
57
     - _gitlab-ci-scripts/deploy_iso.sh
Luca Giambonini's avatar
Luca Giambonini committed
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
  tags:
    - rsync

# skipped for now, we have to rename and move automatically on releasing
.deploy_stable:
  stage: deploy-final
  variables:
    DEPLOY_FOLDER: ""
    DEPLOY_SERVER: "$DEPLOY_SERVER"
    SSH_USER: "$SSH_USER"
    SSH_PORT: "$SSH_PORT"
  environment:
     name: stable-iso
     url: "${DEPLOY_SERVER}"
  when: manual
  script:
74
     - _gitlab-ci-scripts/deploy_iso.sh
Luca Giambonini's avatar
Luca Giambonini committed
75 76
  tags:
    - rsync