Skip to content
Snippets Groups Projects
Commit 455f2524 authored by Cyril Danilevski's avatar Cyril Danilevski
Browse files

CI: Use tag or commit sha for artifact

parent 979a275c
No related branches found
No related tags found
1 merge request!2Initial MPOD feature
Pipeline #131888 passed
......@@ -3,7 +3,7 @@ build:
script:
# Set up Arduino environment
- cat /etc/os-release
- apt-get install -y wget python3-pip
- apt-get install -y wget python3-pip rename
- wget -nv
https://downloads.arduino.cc/arduino-cli/arduino-cli_latest_Linux_64bit.tar.gz
- tar -xf arduino-cli_latest_Linux_64bit.tar.gz
......@@ -29,12 +29,18 @@ build:
- arduino-cli lib install Ethernet
- arduino-cli lib install --git-url https://github.com/patricklaf/SNMP.git --config-file arduino-cli.yaml
# Set version, tag if available else commit sha
- ICBM_GIT_VERSION=$CI_COMMIT_SHORT_SHA
- if [[ -v CI_COMMIT_TAG ]]; then ICBM_GIT_VERSION=$CI_COMMIT_TAG; fi;
- echo "Firmware version is $ICBM_GIT_VERSION"
# Compile artifact
- arduino-cli compile --fqbn esp32:esp32:esp32wroverkit icbm.ino --output-dir firmware --build-property build.extra_flags="-DICBM_GIT_VERSION=\"$CI_COMMIT_SHORT_SHA\" -DICBM_GIT_TIMESTAMP=\"$CI_COMMIT_TIMESTAMP\""
- zip -r firmware.zip firmware
- arduino-cli compile --fqbn esp32:esp32:esp32wroverkit icbm.ino --output-dir icbm-$ICBM_GIT_VERSION --build-property build.extra_flags="-DICBM_GIT_VERSION=\"$ICBM_GIT_VERSION\" -DICBM_GIT_TIMESTAMP=\"$CI_COMMIT_TIMESTAMP\""
- rename "s/ino/$ICBM_GIT_VERSION/" icbm-$ICBM_GIT_VERSION/*
- zip -r icbm-$ICBM_GIT_VERSION.zip icbm-$ICBM_GIT_VERSION
artifacts:
when: always
paths:
- firmware.zip
- icbm-*.zip
expire_in: 1 week
interruptible: true
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment