zmk_mf68/.gitlab-ci.yml

50 lines
1.3 KiB
YAML
Raw Normal View History

2020-05-12 00:57:59 +10:00
variables:
CI_BUILD_IMAGE: $CI_REGISTRY_IMAGE/zmk-build
2020-05-02 05:07:34 +10:00
build:
rules:
- if: '$CI_COMMIT_REF_SLUG =~ /^docker/'
when: never
- when: on_success
2020-05-12 02:44:19 +10:00
cache:
paths:
2020-05-12 02:53:34 +10:00
- $CI_BUILDS_DIR/modules
- $CI_BUILDS_DIR/tools
- $CI_BUILDS_DIR/zephyr
- $CI_BUILDS_DIR/bootloader
2020-05-12 02:44:19 +10:00
2020-05-12 01:54:08 +10:00
image: $CI_BUILD_IMAGE:v0.1.1
2020-05-12 00:57:59 +10:00
variables:
2020-05-12 01:05:04 +10:00
GIT_CLONE_PATH: $CI_BUILDS_DIR/zmk
2020-05-02 05:07:34 +10:00
before_script:
- west init -l .
- west update
2020-05-02 06:11:07 +10:00
- west config --global zephyr.base-prefer configfile
2020-05-02 06:29:18 +10:00
- west zephyr-export
2020-05-02 05:07:34 +10:00
script:
2020-05-02 06:36:56 +10:00
- west build -b nucleo_wb55rg -- -DSHIELD=petejohanson_handwire
2020-05-11 13:27:40 +10:00
build:dockerimage:
services:
- docker:stable-dind
image: docker:stable
2020-05-12 01:38:04 +10:00
rules:
- if: '$CI_COMMIT_REF_SLUG =~ /^docker/'
when: always
2020-05-11 23:44:37 +10:00
before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
2020-05-11 13:27:40 +10:00
script:
2020-05-11 23:44:37 +10:00
- docker pull $CI_BUILD_IMAGE:latest || true
2020-05-12 01:38:04 +10:00
- docker build --cache-from $CI_BUILD_IMAGE:latest -t $CI_BUILD_IMAGE:$CI_COMMIT_SHORT_SHA .
- docker push $CI_BUILD_IMAGE:$CI_COMMIT_SHORT_SHA
2020-05-12 01:46:49 +10:00
- docker tag $CI_BUILD_IMAGE:$CI_COMMIT_SHORT_SHA $CI_BUILD_IMAGE:latest && docker push $CI_BUILD_IMAGE:latest
2020-05-12 01:51:19 +10:00
- if [ -n "$CI_COMMIT_TAG" ]; then docker tag $CI_BUILD_IMAGE:$CI_COMMIT_SHORT_SHA $CI_BUILD_IMAGE:${CI_COMMIT_TAG#docker-} && docker push $CI_BUILD_IMAGE:${CI_COMMIT_TAG#docker-}; fi