stages: - verify - build - deploy variables: GIT_STRATEGY: clone GIT_DEPTH: "500" lint: stage: verify interruptible: true script: - | sudo apk add shellcheck atools doas abuild export PATH="$PATH:$CI_PROJECT_DIR/.gitlab/bin" lint allow_failure: true only: - merge_requests tags: - apk-$CI_MERGE_REQUEST_TARGET_BRANCH_NAME .build: stage: build interruptible: true script: - | sudo apk add alpine-sdk lua-aports doas doas addgroup $USER abuild export PATH="$PATH:$CI_PROJECT_DIR/.gitlab/bin" sudo -Eu $USER build.sh artifacts: paths: - packages/ - keys/ - logs/ expire_in: 7 days when: always only: - merge_requests tags: - apk-$CI_MERGE_REQUEST_TARGET_BRANCH_NAME .cross: stage: build interruptible: true script: - | sudo apk add alpine-sdk lua-aports doas gzip xz qemu-$CI_QEMU_TARGET_ARCH doas addgroup $USER abuild export PATH="$PATH:$CI_PROJECT_DIR/.gitlab/bin" build-rootfs.sh alpine${CI_MERGE_REQUEST_TARGET_BRANCH_NAME/v} $CI_ALPINE_TARGET_ARCH --rootfsdir $HOME/sysroot-$CI_ALPINE_TARGET_ARCH cp /etc/apk/repositories $HOME/sysroot-$CI_ALPINE_TARGET_ARCH/etc/apk/. sudo -Eu $USER CHOST=$CI_TARGET_ALPINE_ARCH build.sh artifacts: paths: - packages/ - keys/ - logs/ expire_in: 7 days when: always only: - merge_requests tags: - apk-$CI_MERGE_REQUEST_TARGET_BRANCH_NAME build-x86_64: extends: .build build-armv7: extends: .cross variables: CI_ALPINE_TARGET_ARCH: armv7 CI_QEMU_TARGET_ARCH: arm push: interruptible: true stage: deploy script: - | sudo apk add abuild git-lfs findutils export PATH="$PATH:$CI_PROJECT_DIR/.gitlab/bin" push.sh rules: - if: $CI_PIPELINE_SOURCE == "merge_request_event" when: manual tags: - repo