zmk_mf68/.gitlab-ci.yml

50 lines
1.4 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 03:40:58 +10:00
- workspace/modules
- workspace/tools
- workspace/zephyr
- workspace/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
before_script:
2020-05-12 03:40:58 +10:00
- mkdir -p workspace/zmk
- mv * workspace/zmk || true
- cd workspace/zmk
- 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