From 7899fc41273c4a3404ae134a8eef3d3266ea3ea3 Mon Sep 17 00:00:00 2001 From: aminecmi Date: Wed, 14 Sep 2022 10:38:03 +0200 Subject: [PATCH] Push. --- .drone.yml | 19 +++++++++++++++++++ build.sh | 2 +- version.sh | 12 ++++++++---- 3 files changed, 28 insertions(+), 5 deletions(-) diff --git a/.drone.yml b/.drone.yml index 53719ce..432acc9 100644 --- a/.drone.yml +++ b/.drone.yml @@ -24,6 +24,25 @@ steps: - apt-get update && apt-get install -y git - ./build.sh --publish --from-ci + - name: git-push + image: appleboy/drone-git-push + settings: + remote: root@aminecmi+giteaadmin@pm.me:Louvorg/ReaderForSelfoss-multiplatform.git + followtags: true + ssh_key: + from_secret: giteaKey + + - name: scpFiles + image: appleboy/drone-scp + settings: + host: amine-louveau.fr + username: ubuntu + key: + from_secret: privateKey + port: 22 + target: /home/ubuntu/ + source: version.txt + trigger: event: - promote diff --git a/build.sh b/build.sh index a5e7138..c68baad 100755 --- a/build.sh +++ b/build.sh @@ -21,7 +21,7 @@ VERSION="${INITIAL_VERSION}${TODAYS_VERSION}" PARAMS_EXCEPT_PUBLISH=$(echo $1 | sed 's/\-\-publish//') -./version.sh ${VERSION} ${PARAMS_EXCEPT_PUBLISH} +./version.sh ${VERSION} ${PARAMS_EXCEPT_PUBLISH} $@ if [[ "$@" == *'--publish'* ]] then diff --git a/version.sh b/version.sh index 3bb4033..67afe93 100755 --- a/version.sh +++ b/version.sh @@ -4,8 +4,12 @@ echo "Creating tag $@" TAG="v$@" -git tag ${TAG} +git tag -a ${TAG} -echo "Pushing tag" - -git push origin ${TAG} +if [[ "$@" == *'--from-ci'* ]] +then + echo "Tag created. HANDLE IN CI" +else + echo "Pushing tag" + git push origin ${TAG} +fi