diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fe22ab2..bbae196 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,9 +1,13 @@ image: python:2.7-stretch +variables: + S3_BUCKET_NAME: "wirelos" + PROJECT_NAME: "illucat" + stages: - - test - build - - production + - test + - release cache: key: ${CI_COMMIT_REF_SLUG} @@ -22,11 +26,16 @@ firmware: - pio run -t buildfs release: - stage: production + stage: release + only: + - /^release-.*$/ + image: python:latest script: - - mkdir release - - mv .pioenvs/build/firmware.bin release - - mv .pioenvs/build/spiffs.bin release + - pip install awscli + - mkdir -p ${PROJECT_NAME}/${CI_COMMIT_TAG} + - mv .pioenvs/build/firmware.bin ${PROJECT_NAME}/${CI_COMMIT_TAG} + - mv .pioenvs/build/spiffs.bin ${PROJECT_NAME}/${CI_COMMIT_TAG} + - aws s3 --endpoint-url=https://$DO_SPACE_ENDPOINT cp ./ s3://$S3_BUCKET_NAME/ --recursive --exclude "*" --include "*.bin" artifacts: paths: - - release + - ${PROJECT_NAME}/${CI_COMMIT_TAG}