Fetch before getting branches
This commit is contained in:
11
kibot-ci.yml
11
kibot-ci.yml
@@ -111,6 +111,7 @@ image:
|
|||||||
if [[ $GITLAB_CI == 'true' && $CI_COMMIT_BRANCH == "main" ]]; then
|
if [[ $GITLAB_CI == 'true' && $CI_COMMIT_BRANCH == "main" ]]; then
|
||||||
git config --global user.name "KicadCi"
|
git config --global user.name "KicadCi"
|
||||||
git config --global user.email "andrew@micromelon.com.au"
|
git config --global user.email "andrew@micromelon.com.au"
|
||||||
|
cd $CI_PROJECT_DIR
|
||||||
for d in "libs/melonlib" "libs/melon3d"
|
for d in "libs/melonlib" "libs/melon3d"
|
||||||
do
|
do
|
||||||
cd $d
|
cd $d
|
||||||
@@ -120,13 +121,13 @@ image:
|
|||||||
else
|
else
|
||||||
TOKEN=$KI_LIB_3D_TOKEN
|
TOKEN=$KI_LIB_3D_TOKEN
|
||||||
fi
|
fi
|
||||||
SHA=$(git rev-parse HEAD)
|
git fetch --all
|
||||||
CURR_B=$(git name-rev --name-only $SHA)
|
CURR_B=$(git name-rev --name-only $(git rev-parse HEAD))
|
||||||
REPO=$(basename $(git remote get-url origin))
|
REPO=$(basename $(git remote get-url origin))
|
||||||
git remote add gl_origin https://ci_push:$TOKEN@gitlab.com/Micromelon/education/hardware/$REPO
|
|
||||||
git checkout $CURR_B
|
|
||||||
git commit --allow-empty -m "Merge"
|
|
||||||
echo $CURR_B
|
echo $CURR_B
|
||||||
|
git checkout $CURR_B
|
||||||
|
git remote add gl_origin https://ci_push:$TOKEN@gitlab.com/Micromelon/education/hardware/$REPO
|
||||||
|
git commit --allow-empty -m "Merge"
|
||||||
git remote get-url gl_origin
|
git remote get-url gl_origin
|
||||||
git push gl_origin HEAD:$CURR_B -o merge_request.create -o merge_request.remove_source_branch=false -o merge_request.merge_when_pipeline_succeeds -o merge_request.target=master
|
git push gl_origin HEAD:$CURR_B -o merge_request.create -o merge_request.remove_source_branch=false -o merge_request.merge_when_pipeline_succeeds -o merge_request.target=master
|
||||||
cd $CI_PROJECT_DIR
|
cd $CI_PROJECT_DIR
|
||||||
|
|||||||
Reference in New Issue
Block a user