Wetterstation v2
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.

75 lines
2.1 KiB

5 years ago
stages:
5 years ago
- test
# - codequality
5 years ago
- build
- deploy
5 years ago
5 years ago
build:
5 years ago
stage: build
5 years ago
image: python:2.7
before_script:
- pip install -U platformio
5 years ago
- platformio update
5 years ago
script:
5 years ago
- platformio ci --project-conf platformio.ini --board=lolin_d32_pro --build-dir build --keep-build-dir
# - cp ~/.platformio/packages/framework-arduinoespressif32/tools/sdk/bin/bootloader_dio_40m.bin build/.pio/build/lolin_d32_pro/
# - cp ~/.platformio/packages/framework-arduinoespressif32/tools/partitions/default.bin build/.pio/build/lolin_d32_pro/
5 years ago
variables: {PLATFORMIO_CI_SRC: "src"}
artifacts:
paths:
5 years ago
- build/.pio/build/lolin_d32_pro/*.bin
5 years ago
5 years ago
codequality:
5 years ago
stage: codequality
image: docker:stable
5 years ago
variables:
DOCKER_DRIVER: overlay2
allow_failure: true
5 years ago
services:
- docker:stable-dind
5 years ago
script:
- export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')
- docker run
--env SOURCE_CODE="$PWD"
--volume "$PWD":/code
--volume /var/run/docker.sock:/var/run/docker.sock
"registry.gitlab.com/gitlab-org/security-products/codequality:$SP_VERSION" /code
5 years ago
artifacts:
reports:
codequality: gl-code-quality-report.json
5 years ago
5 years ago
test:
stage: test
image: debian:testing
allow_failure: true
before_script:
- apt -q update
- apt install -qy build-essential
- apt install -qy cppcheck
script:
# - cppcheck --enable=all --check-config src
- cppcheck src
# artifacts:
# reports:
# -
5 years ago
deploy:
stage: deploy
image: alpine:latest
before_script:
- apk update && apk add openssh-client bash rsync
# - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
- eval $(ssh-agent -s)
- echo "${SSH_PRIVATE_KEY}" | tr -d '\r' | ssh-add - > /dev/null
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- echo "${SSH_HOST_KEY}" > ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
script:
5 years ago
- scp build/.pio/build/lolin_d32_pro/firmware.bin "${SSH_USER_HOST}:${DEPLOY_PATH}"
5 years ago
dependencies:
- build
5 years ago
when: manual
only:
5 years ago
- master