From 03ed52dbf126c7be98a8f9a7d97f99476114cc44 Mon Sep 17 00:00:00 2001 From: Sayantan Roychowdhury Date: Wed, 8 Feb 2023 04:35:43 +0530 Subject: [PATCH 1/6] fix pushToRelease --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 337d18042..486cdfaca 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -68,6 +68,8 @@ buildRelease: when: always - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH' when: always + - if: '$CI_COMMIT_TAG !~ "/^$/"' + when: always script: - ./gradlew assembleRelease artifacts: -- GitLab From 3cc5908dca45314d990ad427c95d43b7190cc12c Mon Sep 17 00:00:00 2001 From: Sayantan Roychowdhury Date: Wed, 8 Feb 2023 05:01:59 +0530 Subject: [PATCH 2/6] add pipeline id to commit message. --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 486cdfaca..104e2b29a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -161,7 +161,7 @@ pushToPrebuilt: - sed -i "6s/.*/LOCAL_SRC_FILES := ${NEW_APK_NAME}/" Apps/Android.mk - git add Apps - git status - - git commit -m "Update Apps Lounge apk to ${NEW_APK_VERSION}\nFrom ${CI_COMMIT_SHA}" + - git commit -m "Update Apps Lounge apk to ${NEW_APK_VERSION}\nFrom ${CI_COMMIT_SHA}, pipeline ${CI_PIPELINE_ID}" - git push # Sometimes a single push doesn't do all the job, so we have to push twice - git push \ No newline at end of file -- GitLab From 4877850e464710dc6778a4b445cc33a5a7697345 Mon Sep 17 00:00:00 2001 From: Sayantan Roychowdhury Date: Wed, 8 Feb 2023 07:38:12 +0530 Subject: [PATCH 3/6] add gitlab.e.foundation to known hosts. --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 104e2b29a..73e512de0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -144,7 +144,7 @@ pushToPrebuilt: - echo "$SSH_E_ROBOT_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null - mkdir -p ~/.ssh - chmod 700 ~/.ssh - - echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts + - ssh-keyscan -t rsa gitlab.e.foundation >> ~/.ssh/known_hosts - chmod 644 ~/.ssh/known_hosts - git config user.email "gitlab@e.foundation" - git config user.name "gitlab" -- GitLab From 88c3e72bc551c735daaa1ebf9add8fc85ac50b6d Mon Sep 17 00:00:00 2001 From: Sayantan Roychowdhury Date: Wed, 8 Feb 2023 07:57:24 +0530 Subject: [PATCH 4/6] add --global flag to git config --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 73e512de0..694b12df0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -146,8 +146,8 @@ pushToPrebuilt: - chmod 700 ~/.ssh - ssh-keyscan -t rsa gitlab.e.foundation >> ~/.ssh/known_hosts - chmod 644 ~/.ssh/known_hosts - - git config user.email "gitlab@e.foundation" - - git config user.name "gitlab" + - git config --global user.email "gitlab@e.foundation" + - git config --global user.name "gitlab" script: - NEW_APK_NAME=$(basename ${NEW_APK_PATH}*-release.apk) - NEW_APK_VERSION=$(awk -F '-' '{print $2}' <<< "$NEW_APK_NAME") -- GitLab From bf3d41769ef1057fef70599cc7088ee1947ca417 Mon Sep 17 00:00:00 2001 From: Sayantan Roychowdhury Date: Fri, 10 Feb 2023 17:54:17 +0530 Subject: [PATCH 5/6] Revert "add gitlab.e.foundation to known hosts." This reverts commit 60fefaadfab2ed8494181ff05bb3c15eb010ee4c. --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 694b12df0..d8658af90 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -144,7 +144,7 @@ pushToPrebuilt: - echo "$SSH_E_ROBOT_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null - mkdir -p ~/.ssh - chmod 700 ~/.ssh - - ssh-keyscan -t rsa gitlab.e.foundation >> ~/.ssh/known_hosts + - echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts - chmod 644 ~/.ssh/known_hosts - git config --global user.email "gitlab@e.foundation" - git config --global user.name "gitlab" -- GitLab From 52a958969bcba3b7e0b3c095c30c3c39e0ca5ee5 Mon Sep 17 00:00:00 2001 From: Sayantan Roychowdhury Date: Fri, 10 Feb 2023 17:58:34 +0530 Subject: [PATCH 6/6] update commit message --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d8658af90..a80c072e8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -161,7 +161,7 @@ pushToPrebuilt: - sed -i "6s/.*/LOCAL_SRC_FILES := ${NEW_APK_NAME}/" Apps/Android.mk - git add Apps - git status - - git commit -m "Update Apps Lounge apk to ${NEW_APK_VERSION}\nFrom ${CI_COMMIT_SHA}, pipeline ${CI_PIPELINE_ID}" + - git commit -m "Apps Lounge - ${NEW_APK_VERSION}, ${CI_COMMIT_TAG}" -m "From ${CI_COMMIT_SHA}, pipeline ${CI_PIPELINE_ID}" - git push # Sometimes a single push doesn't do all the job, so we have to push twice - git push \ No newline at end of file -- GitLab