You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
1.4 KiB
53 lines
1.4 KiB
variables: |
|
CI_BUILD_IMAGE: $CI_REGISTRY_IMAGE/zmk-build |
|
|
|
build: |
|
rules: |
|
- if: '$CI_COMMIT_REF_SLUG =~ /^docker/' |
|
when: never |
|
- when: on_success |
|
|
|
cache: |
|
paths: |
|
- workspace/modules |
|
- workspace/tools |
|
- workspace/zephyr |
|
- workspace/bootloader |
|
|
|
image: $CI_BUILD_IMAGE:v0.1.1 |
|
|
|
variables: |
|
GIT_CLONE_PATH: $CI_BUILDS_DIR/zmk |
|
|
|
before_script: |
|
- mkdir -p workspace/zmk |
|
- mv * workspace/zmk || true |
|
- mv .* workspace/zmk || true |
|
- cd workspace/zmk |
|
- west init -l . |
|
- west update |
|
- west config --global zephyr.base-prefer configfile |
|
- west zephyr-export |
|
|
|
script: |
|
- west build -b nucleo_wb55rg -- -DSHIELD=petejohanson_handwire |
|
|
|
build:dockerimage: |
|
services: |
|
- docker:stable-dind |
|
|
|
image: docker:stable |
|
|
|
rules: |
|
- if: '$CI_COMMIT_REF_SLUG =~ /^docker/' |
|
when: always |
|
|
|
before_script: |
|
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY |
|
|
|
script: |
|
- docker pull $CI_BUILD_IMAGE:latest || true |
|
- 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 |
|
- docker tag $CI_BUILD_IMAGE:$CI_COMMIT_SHORT_SHA $CI_BUILD_IMAGE:latest && docker push $CI_BUILD_IMAGE:latest |
|
- 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
|
|
|