-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dev See merge request smartme.io/arancino/arancino-library!27
- Loading branch information
Showing
46 changed files
with
1,134 additions
and
1,272 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,6 +39,8 @@ stages: | |
####### START | ||
start: | ||
stage: start | ||
only: ['tags'] | ||
except: ['master', 'branches'] | ||
|
||
variables: | ||
GIT_STRATEGY: none | ||
|
@@ -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 ####### | ||
|
@@ -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 | ||
|
||
|
@@ -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/ | ||
|
||
|
@@ -168,13 +141,6 @@ package_release: | |
paths: | ||
- tmp/ | ||
|
||
only: | ||
- tags | ||
|
||
except: | ||
- branches | ||
|
||
|
||
################################# | ||
####### UPLOAD ####### | ||
################################# | ||
|
@@ -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 ####### | ||
|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.