From 4d7182fd675bc267c76a8eb24572f85305fb6a6f Mon Sep 17 00:00:00 2001 From: Roman Pelmegov Date: Fri, 3 Mar 2023 14:33:55 +0000 Subject: [PATCH 1/5] issue-333 last commit date --- scripts/export_src.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/export_src.sh b/scripts/export_src.sh index 11a5290..86e8e9f 100755 --- a/scripts/export_src.sh +++ b/scripts/export_src.sh @@ -19,8 +19,12 @@ if [ -z "${GIT_BRANCH}" ]; then GIT_BRANCH="master" fi +if [ -z "${EXPORT_DATE}" ]; then + EXPORT_DATE=$(env -i git log -1 --pretty='format:%cd' --date=format:'%Y-%m-%d') +fi + PROJECT_NAME=$1 -SRC_FOLDER_NAME="${PROJECT_NAME}-src-$(date +%F)" +SRC_FOLDER_NAME="${PROJECT_NAME}-src-${EXPORT_DATE}" SRC_DIR="./${SRC_FOLDER_NAME}" COMMAND_LINE_ARGUMENTS=$@ From c5b794752600b22e23500d89f395ce8e954d6116 Mon Sep 17 00:00:00 2001 From: Roman Pelmegov Date: Fri, 3 Mar 2023 14:52:02 +0000 Subject: [PATCH 2/5] issue-333 use git archive --- scripts/export_src.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/export_src.sh b/scripts/export_src.sh index 86e8e9f..f9b8c07 100755 --- a/scripts/export_src.sh +++ b/scripts/export_src.sh @@ -48,6 +48,6 @@ do done find . -name ".git*" -print0 | xargs -0 rm -rf -zip -r -q ${SRC_FOLDER_NAME}.zip . +git archive -o ${SRC_FOLDER_NAME}.zip HEAD open . From 84db8a0e092a54d49f2149fc5206c8a4da8444d5 Mon Sep 17 00:00:00 2001 From: Roman Pelmegov Date: Fri, 3 Mar 2023 15:13:10 +0000 Subject: [PATCH 3/5] issue-333 fix --- scripts/export_src.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/export_src.sh b/scripts/export_src.sh index f9b8c07..5ad69e8 100755 --- a/scripts/export_src.sh +++ b/scripts/export_src.sh @@ -47,7 +47,6 @@ do fi done -find . -name ".git*" -print0 | xargs -0 rm -rf git archive -o ${SRC_FOLDER_NAME}.zip HEAD open . From 216c2288982b022601acb16155768b17239507cd Mon Sep 17 00:00:00 2001 From: Roman Pelmegov Date: Tue, 7 Mar 2023 11:07:27 +0000 Subject: [PATCH 4/5] last commit date --- scripts/export_src.sh | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/scripts/export_src.sh b/scripts/export_src.sh index 5ad69e8..f09b432 100755 --- a/scripts/export_src.sh +++ b/scripts/export_src.sh @@ -19,12 +19,9 @@ if [ -z "${GIT_BRANCH}" ]; then GIT_BRANCH="master" fi -if [ -z "${EXPORT_DATE}" ]; then - EXPORT_DATE=$(env -i git log -1 --pretty='format:%cd' --date=format:'%Y-%m-%d') -fi - +LAST_COMMIT_DATE="" PROJECT_NAME=$1 -SRC_FOLDER_NAME="${PROJECT_NAME}-src-${EXPORT_DATE}" +SRC_FOLDER_NAME="${PROJECT_NAME}-src" SRC_DIR="./${SRC_FOLDER_NAME}" COMMAND_LINE_ARGUMENTS=$@ @@ -32,8 +29,17 @@ COMMAND_LINE_ARGUMENTS=$@ clone_platform() { PROJECT_NAME=$1 PLATFORM=$2 - - git clone --recurse-submodules -j8 "git@github.com:TouchInstinct/${PROJECT_NAME}-${PLATFORM}.git" --branch "${GIT_BRANCH}" + + if git clone --recurse-submodules -j8 "git@gitlab.ti:touchinstinct/${PROJECT_NAME}-${PLATFORM}.git" --branch "${GIT_BRANCH}"; then + cd ${PROJECT_NAME}-${PLATFORM} + + COMMIT_DATE=`git log -1 --pretty='format:%cd' --date=format:'%Y-%m-%d'` + if [[ $LAST_COMMIT_DATE < $COMMIT_DATE ]]; then + LAST_COMMIT_DATE="${COMMIT_DATE}" + fi + + cd .. + fi } mkdir -p "${SRC_DIR}" @@ -47,6 +53,11 @@ do fi done -git archive -o ${SRC_FOLDER_NAME}.zip HEAD +if [ -z "${EXPORT_DATE}" ]; then + EXPORT_DATE="${LAST_COMMIT_DATE}" +fi + +find . -name ".git*" -print0 | xargs -0 rm -rf +zip -r -q "${SRC_FOLDER_NAME}-${EXPORT_DATE}".zip . open . From 0400dbe36db6f6f12118f09f54b2022e880ad7dd Mon Sep 17 00:00:00 2001 From: Roman Pelmegov Date: Tue, 7 Mar 2023 16:26:54 +0000 Subject: [PATCH 5/5] issue-333 break on git clone error --- scripts/export_src.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/export_src.sh b/scripts/export_src.sh index f09b432..0267c66 100755 --- a/scripts/export_src.sh +++ b/scripts/export_src.sh @@ -39,6 +39,8 @@ clone_platform() { fi cd .. + else + exit 1 fi }