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.
39 lines
1.1 KiB
39 lines
1.1 KiB
stages:
|
|
- build
|
|
- deploy
|
|
|
|
build:
|
|
stage: build
|
|
image: python:2.7
|
|
before_script:
|
|
- pip install -U platformio
|
|
- platformio update
|
|
script:
|
|
# - date +%s > version.txt
|
|
- platformio ci --lib="script" --project-conf platformio.ini --board=lolin_d32_pro --build-dir="build" --keep-build-dir
|
|
variables: {PLATFORMIO_CI_SRC: "src"}
|
|
artifacts:
|
|
paths:
|
|
- build/.pio/build/lolin_d32_pro/*.bin
|
|
- version.txt
|
|
|
|
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:
|
|
- scp build/.pio/build/lolin_d32_pro/firmware.bin "${SSH_USER_HOST}:${DEPLOY_PATH}"
|
|
- scp version.txt "${SSH_USER_HOST}:${DEPLOY_PATH}".version
|
|
dependencies:
|
|
- build
|
|
when: manual
|
|
only:
|
|
- master
|
|
|