Loading create_new_tag.sh +49 −20 Original line number Diff line number Diff line #!/bin/bash REPO="git@gitlab.e.foundation:e/os/android.git" # Install xmlstarlet if not available which xmlstarlet || (apt-get update && apt-get install -y xmlstarlet) Loading @@ -12,7 +10,6 @@ create_branch (){ git push $2 $1 } iterate_remote () { projects=`xmlstarlet select --template --value-of /manifest/project[@remote=\"$1\"]/@name $2` for project in $projects; do Loading @@ -27,11 +24,11 @@ iterate_remote () { done } parse_manifests () { for filename in *.xml; do iterate_remote e $filename iterate_remote e-priv $filename done } Loading Loading @@ -76,12 +73,6 @@ else version_branch=$version_branch_name-$current_version fi if [ "$REGENERATE_MANIFEST" = "true" ] then git clone $REPO current_project -b $CI_COMMIT_REF_NAME Loading @@ -98,7 +89,6 @@ then rm -rf current_project sync_main_manifest $CI_COMMIT_REF_NAME echo "==> Creating new branches on /e/ projects" repo forall -e -v -p -c 'if [ "${REPO_REMOTE}" = "e" ] || [ "${REPO_REMOTE}" = "e-priv" ] ; then Loading @@ -122,7 +112,6 @@ then fi fi ;' # Not using repo sync in case of some conflicts between devices manifests rm -rf working-dir || true mkdir working-dir Loading @@ -133,9 +122,6 @@ then clone_and_parse_project_manifest git@gitlab.e.foundation:e/devices/manifests.git cd .. else # For REGENERATE_MANIFEST=false, sync from version branch (e.g., v3.1-a14) not tag branch if [ -n "$NEW_TAG" ]; then Loading Loading @@ -188,14 +174,57 @@ else cd "$SRC_DIR/$CI_COMMIT_REF_NAME" repo manifest -r -o $CI_PROJECT_DIR/default.xml cd $CI_PROJECT_DIR # Update e and e-priv remote revisions to version branch name xmlstarlet ed --inplace \ -u "/manifest/remote[@name='e']/@revision" \ -v "refs/heads/$new_version" default.xml xmlstarlet ed --inplace \ -u "/manifest/remote[@name='e-priv']/@revision" \ -v "refs/heads/$new_version" default.xml # Update upstream and dest-branch for e projects tracking main/master (common repos) xmlstarlet ed --inplace \ -u "//project[@remote='e'][contains(@upstream,'main') or contains(@upstream,'master')]/@upstream" \ -v "refs/heads/$new_version_without_android" default.xml xmlstarlet ed --inplace \ -u "//project[@remote='e'][contains(@upstream,'main') or contains(@upstream,'master')]/@dest-branch" \ -v "refs/heads/$new_version_without_android" default.xml # Update upstream and dest-branch for e projects tracking android branch xmlstarlet ed --inplace \ -u "//project[@remote='e'][not(contains(@upstream,'main') or contains(@upstream,'master'))]/@upstream" \ -v "refs/heads/$new_version" default.xml xmlstarlet ed --inplace \ -u "//project[@remote='e'][not(contains(@upstream,'main') or contains(@upstream,'master'))]/@dest-branch" \ -v "refs/heads/$new_version" default.xml # Update upstream and dest-branch for e-priv projects tracking main/master (common repos) xmlstarlet ed --inplace \ -u "//project[@remote='e-priv'][contains(@upstream,'main') or contains(@upstream,'master')]/@upstream" \ -v "refs/heads/$new_version_without_android" default.xml xmlstarlet ed --inplace \ -u "//project[@remote='e-priv'][contains(@upstream,'main') or contains(@upstream,'master')]/@dest-branch" \ -v "refs/heads/$new_version_without_android" default.xml # Update upstream and dest-branch for e-priv projects tracking android branch xmlstarlet ed --inplace \ -u "//project[@remote='e-priv'][not(contains(@upstream,'main') or contains(@upstream,'master'))]/@upstream" \ -v "refs/heads/$new_version" default.xml xmlstarlet ed --inplace \ -u "//project[@remote='e-priv'][not(contains(@upstream,'main') or contains(@upstream,'master'))]/@dest-branch" \ -v "refs/heads/$new_version" default.xml fi git add . git commit -m "Update $CI_COMMIT_REF_NAME manifest" || true git push origin HEAD:$CI_COMMIT_REF_NAME if [ "$CREATE_TAG" = "true" ] then echo "CREATE_TAG=true: Creating git tag" Loading Loading
create_new_tag.sh +49 −20 Original line number Diff line number Diff line #!/bin/bash REPO="git@gitlab.e.foundation:e/os/android.git" # Install xmlstarlet if not available which xmlstarlet || (apt-get update && apt-get install -y xmlstarlet) Loading @@ -12,7 +10,6 @@ create_branch (){ git push $2 $1 } iterate_remote () { projects=`xmlstarlet select --template --value-of /manifest/project[@remote=\"$1\"]/@name $2` for project in $projects; do Loading @@ -27,11 +24,11 @@ iterate_remote () { done } parse_manifests () { for filename in *.xml; do iterate_remote e $filename iterate_remote e-priv $filename done } Loading Loading @@ -76,12 +73,6 @@ else version_branch=$version_branch_name-$current_version fi if [ "$REGENERATE_MANIFEST" = "true" ] then git clone $REPO current_project -b $CI_COMMIT_REF_NAME Loading @@ -98,7 +89,6 @@ then rm -rf current_project sync_main_manifest $CI_COMMIT_REF_NAME echo "==> Creating new branches on /e/ projects" repo forall -e -v -p -c 'if [ "${REPO_REMOTE}" = "e" ] || [ "${REPO_REMOTE}" = "e-priv" ] ; then Loading @@ -122,7 +112,6 @@ then fi fi ;' # Not using repo sync in case of some conflicts between devices manifests rm -rf working-dir || true mkdir working-dir Loading @@ -133,9 +122,6 @@ then clone_and_parse_project_manifest git@gitlab.e.foundation:e/devices/manifests.git cd .. else # For REGENERATE_MANIFEST=false, sync from version branch (e.g., v3.1-a14) not tag branch if [ -n "$NEW_TAG" ]; then Loading Loading @@ -188,14 +174,57 @@ else cd "$SRC_DIR/$CI_COMMIT_REF_NAME" repo manifest -r -o $CI_PROJECT_DIR/default.xml cd $CI_PROJECT_DIR # Update e and e-priv remote revisions to version branch name xmlstarlet ed --inplace \ -u "/manifest/remote[@name='e']/@revision" \ -v "refs/heads/$new_version" default.xml xmlstarlet ed --inplace \ -u "/manifest/remote[@name='e-priv']/@revision" \ -v "refs/heads/$new_version" default.xml # Update upstream and dest-branch for e projects tracking main/master (common repos) xmlstarlet ed --inplace \ -u "//project[@remote='e'][contains(@upstream,'main') or contains(@upstream,'master')]/@upstream" \ -v "refs/heads/$new_version_without_android" default.xml xmlstarlet ed --inplace \ -u "//project[@remote='e'][contains(@upstream,'main') or contains(@upstream,'master')]/@dest-branch" \ -v "refs/heads/$new_version_without_android" default.xml # Update upstream and dest-branch for e projects tracking android branch xmlstarlet ed --inplace \ -u "//project[@remote='e'][not(contains(@upstream,'main') or contains(@upstream,'master'))]/@upstream" \ -v "refs/heads/$new_version" default.xml xmlstarlet ed --inplace \ -u "//project[@remote='e'][not(contains(@upstream,'main') or contains(@upstream,'master'))]/@dest-branch" \ -v "refs/heads/$new_version" default.xml # Update upstream and dest-branch for e-priv projects tracking main/master (common repos) xmlstarlet ed --inplace \ -u "//project[@remote='e-priv'][contains(@upstream,'main') or contains(@upstream,'master')]/@upstream" \ -v "refs/heads/$new_version_without_android" default.xml xmlstarlet ed --inplace \ -u "//project[@remote='e-priv'][contains(@upstream,'main') or contains(@upstream,'master')]/@dest-branch" \ -v "refs/heads/$new_version_without_android" default.xml # Update upstream and dest-branch for e-priv projects tracking android branch xmlstarlet ed --inplace \ -u "//project[@remote='e-priv'][not(contains(@upstream,'main') or contains(@upstream,'master'))]/@upstream" \ -v "refs/heads/$new_version" default.xml xmlstarlet ed --inplace \ -u "//project[@remote='e-priv'][not(contains(@upstream,'main') or contains(@upstream,'master'))]/@dest-branch" \ -v "refs/heads/$new_version" default.xml fi git add . git commit -m "Update $CI_COMMIT_REF_NAME manifest" || true git push origin HEAD:$CI_COMMIT_REF_NAME if [ "$CREATE_TAG" = "true" ] then echo "CREATE_TAG=true: Creating git tag" Loading