Skip to content

Commit

Permalink
Merge branch 'dev' into 'master'
Browse files Browse the repository at this point in the history
Dev

See merge request smartme.io/arancino/arancino-library!27
  • Loading branch information
sergiotomasello committed Mar 15, 2021
2 parents c9bc700 + 620e8e7 commit 6737fc4
Show file tree
Hide file tree
Showing 46 changed files with 1,134 additions and 1,272 deletions.
120 changes: 42 additions & 78 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ stages:
####### START
start:
stage: start
only: ['tags']
except: ['master', 'branches']

variables:
GIT_STRATEGY: none
Expand All @@ -53,36 +55,37 @@ start:
- tmp/
expire_in: 1d

except:
- master

######## PUSH
push:
stage: start
only: ['tags']
except: ['master', 'branches']

allow_failure: true

variables:
GIT_STRATEGY: clone

before_script:
- sed -i "s/version=.*/version=${CI_COMMIT_TAG}/g" library.properties
- eval `python3 check-version-tag.py ${CI_COMMIT_TAG}`

script:
#- apk add git
- git remote add github https://$GITHUB_BOT_USERNAME:[email protected]/$GITHUB_DEST_REPO
#- git remote show github
#- git remote show origin
#- git branch -a
- git checkout $CI_COMMIT_REF_NAME
- git checkout $CI_COMMIT_TAG
- git fetch github
#- git push github $CI_COMMIT_REF_NAME --force
- >
if [[ ${PRE_RELEASE} == "test" ]]; then
echo "not performing TAG push";
else
git push github ${CI_COMMIT_TAG}
fi
- git push github --all --force
- git push github --tags

only:
- branches
- tags

# except:
# - master

#################################
####### TEST #######
Expand All @@ -91,9 +94,12 @@ push:
####### CLI Sketch Test Job #######
cli-test:
stage: test
#only: ['tags']
#except: ['master', 'branches']

# copying the Library source to the Arduino libraries folder
before_script:
- sed -i "s/version=.*/version=${CI_COMMIT_TAG}/g" library.properties
- cp -r ${CI_PROJECT_DIR} ${HOME}/Arduino/libraries/Arancino
- chmod +x ./test/arduino-cli-test.sh

Expand All @@ -102,62 +108,29 @@ cli-test:
- ./test/arduino-cli-test.sh arancino
- ./test/arduino-cli-test.sh arancino_mignon

#################################
####### PACKAGE #######
#################################

####### Package Staging #######
#questo job esegue la compressione ad ogni commit su tutti i branch tranne master
package_staging:

stage: package

script:
#- apk add zip
- DATE="$(cat tmp/date.tmp)"
- TIME="$(cat tmp/time.tmp)"
- PKG_NAME=$CI_PROJECT_NAME-$DATE-$TIME-$CI_COMMIT_REF_NAME-${CI_COMMIT_SHA:0:8}
- echo $PKG_NAME > tmp/pgk_name.tmp
- echo $CI_PROJECT_NAME-snapshot > tmp/repo_name.tmp
- echo $DATE/$CI_COMMIT_REF_NAME-${CI_COMMIT_SHA:0:8} > tmp/target_path.tmp
- mv tmp/ ../tmp && cd ../
#- tar --exclude='*.git*' --exclude='*.DS_Store*' -zcvf $PKG_NAME.zip $CI_PROJECT_NAME/
- zip -r $PKG_NAME.zip $CI_PROJECT_NAME -x "$CI_PROJECT_NAME/*.git*" "$CI_PROJECT_NAME/*.DS_Store*" "$CI_PROJECT_NAME/test/*"
- mv tmp/ $CI_PROJECT_NAME/
- mv $PKG_NAME.zip $CI_PROJECT_NAME/tmp/

dependencies:
- start

artifacts:
paths:
- tmp/

only:
- branches

except:
- master
- tags



####### Package Release #######
#esegue la compressione del pacchetto quando viene creato un tag su master (ovvero ad ogni release)
#esegue la compressione del pacchetto quando viene creato un tag (ovvero ad ogni release)
package_release:

stage: package
only: ['tags']
except: ['master', 'branches']

script:
#- apk add zip
#- DATE="$(cat tmp/date.tmp)"
- PKG_NAME=$CI_PROJECT_NAME-$CI_COMMIT_REF_NAME
# packaging for PlatformIO
- jq --arg tag_ver ${CI_COMMIT_TAG} '.version = $tag_ver' library.json|sponge library.json
# - pio package pack -o /tmp
# standard packaging as ZIP archive
- sed -i "s/version=.*/version=${CI_COMMIT_TAG}/g" library.properties
- PKG_NAME=$CI_PROJECT_NAME-$CI_COMMIT_TAG
- echo $PKG_NAME > tmp/pgk_name.tmp
- echo $CI_PROJECT_NAME > tmp/repo_name.tmp
- echo $CI_COMMIT_REF_NAME > tmp/target_path.tmp
- echo $CI_COMMIT_TAG > tmp/target_path.tmp
- mv tmp/ ../tmp && cd ../
#- tar --exclude='*.git*' --exclude='*.DS_Store*' -zcvf $PKG_NAME.zip $CI_PROJECT_NAME/
- zip -r $PKG_NAME.zip $CI_PROJECT_NAME -x "$CI_PROJECT_NAME/*.git*" "$CI_PROJECT_NAME/*.DS_Store*"
- zip -r $PKG_NAME.zip $CI_PROJECT_NAME -x "$CI_PROJECT_NAME/check-version-tag.py" -x "$CI_PROJECT_NAME/*.git*" "$CI_PROJECT_NAME/*.DS_Store*"
- mv tmp/ $CI_PROJECT_NAME/
- mv $PKG_NAME.zip $CI_PROJECT_NAME/tmp/

Expand All @@ -168,13 +141,6 @@ package_release:
paths:
- tmp/

only:
- tags

except:
- branches


#################################
####### UPLOAD #######
#################################
Expand All @@ -184,26 +150,30 @@ package_release:
upload:

stage: upload
only: ['tags']
except: ['master', 'branches']

variables:
GIT_STRATEGY: none

before_script:
- eval `python3 check-version-tag.py ${CI_COMMIT_TAG}`

script:
- DATE="$(cat tmp/date.tmp)"
- TIME="$(cat tmp/time.tmp)"
- PKG_NAME="$(cat tmp/pgk_name.tmp)"
- REPO_NAME="$(cat tmp/repo_name.tmp)"
- TARGET_PATH="$(cat tmp/target_path.tmp)"
#- apk add curl
- >
if [[ ${PRE_RELEASE} == "test" ]]; then
REPO_NAME=${REPO_NAME}-snapshot
fi
# Upload to Artifactory
- curl -u $REPO_USR:$REPO_PWD -T tmp/$PKG_NAME.zip "${REPO_BASE_URL}/artifactory/${REPO_NAME}/${TARGET_PATH}/${PKG_NAME}.zip"

only:
- branches
- tags

except:
- master
# publishing to PlatformIO
# - pio package publish --owner smartme-io /tmp/Arancino-${CI_COMMIT_TAG}.tar.gz

#################################
####### CLEANUP #######
Expand All @@ -212,18 +182,12 @@ upload:
####### Cleanup Job #######
cleanup:
stage: cleanup
#only: ['tags']
#except: ['master', 'branches']

variables:
GIT_STRATEGY: none

script:
- echo "Cleaning up"
- rm -rf tmp/

#when: always
only:
- branches
- tags

except:
- master
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

#### v 1.4.0 - 2021.03.15
* Upd: Metadata structure is now mandatory to the `begin` function. [#aex3e4](https://app.clickup.com/t/aex3e4)
* Add: New `ArancinoConfig` Class used to pass configuration at `begin`. [#fd4ped](https://app.clickup.com/t/fd4ped)

#### v 1.3.1 - 2021.02.08
* Fix: Fixed a memory leak bug's `get`-based functions [#c8y3rg](https://app.clickup.com/t/c8y3rg)
* Add: Utility to use for UTF-8 verification [#cq2620](https://app.clickup.com/t/cq2620)
Expand All @@ -24,7 +28,6 @@
* Fix: Fixed a bug of timeout in serial comm, it introduces synch error #57
* Fix: Introduced checks to avoid NULL keys and values #58


#### v 1.1.0 - 2020.03.16
* Fix: CI script to push even master branch to GitHub #52
* Upd: `KEYS` Command sends to Arancino Module a default arg (`*`) when call `Arancino.keys()` #51
Expand Down
Loading

0 comments on commit 6737fc4

Please sign in to comment.