Skip to content

Commit

Permalink
testing merging
Browse files Browse the repository at this point in the history
  • Loading branch information
klaxalk committed Nov 18, 2023
1 parent 23290f9 commit d26ec64
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .ci/get_test_matrix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -e

trap 'last_command=$current_command; current_command=$BASH_COMMAND' DEBUG
trap 'echo "$0: \"${last_command}\" command failed with exit code $?, log:" && cat /tmp/log.txt' ERR
trap 'echo "$0: \"${last_command}\" command failed with exit code $?' ERR

DEBUG=false

Expand Down
85 changes: 85 additions & 0 deletions .ci/merge_push_to_release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
#!/bin/bash

set -e

trap 'last_command=$current_command; current_command=$BASH_COMMAND' DEBUG
trap 'echo "$0: \"${last_command}\" command failed with exit code $?' ERR

ARCH=amd64
LOCATION=/tmp/git

REPOS=$(./.ci/parse_yaml.py mrs.yaml $ARCH)

REPOS="$REPOS
$(./.ci/parse_yaml.py thirdparty.yaml $ARCH)"

REPOS="$REPOS
$(./.ci/parse_yaml.py nonbloom.yaml $ARCH)"

[ -e $LOCATION ] && rm -rf $LOCATION || echo "$0: nothing to delete"
mkdir -p $LOCATION

cd $LOCATION

# clone and checkout
echo "$REPOS" | while IFS= read -r REPO; do

echo "Cloning $REPO"

PACKAGE=$(echo "$REPO" | awk '{print $1}')
URL=$(echo "$REPO" | awk '{print $2}')

# strip the https from the url
URL=$(echo $URL | sed -r 's|https://(.+)|\1|' | head -n 1)

RELEASE_BRANCH=$(echo "$REPO" | awk '{print $3}')
TESTING_BRANCH=$(echo "$REPO" | awk '{print $4}')

echo "$0: cloning '$URL --branch $RELEASE_BRANCH' into '$PACKAGE'"
[ ! -e $PACKAGE ] && git clone https://$PUSH_TOKEN@$URL --branch $RELEASE_BRANCH $PACKAGE

echo ""

done

echo "$0: Done cloning"
echo "$0: Going to merge and dry-run the push"

# merge and try dry-run push
echo "$REPOS" | while IFS= read -r REPO; do

PACKAGE=$(echo "$REPO" | awk '{print $1}')
TESTING_BRANCH=$(echo "$REPO" | awk '{print $4}')

echo "$0: going to merge $PACKAGE"

cd $LOCATION/$PACKAGE

git merge origin/$TESTING_BRANCH

git push --dry-run

echo ""

done

echo "$0: Done merging"
echo "$0: Going to push"

# merge and try dry-run push
echo "$REPOS" | while IFS= read -r REPO; do

PACKAGE=$(echo "$REPO" | awk '{print $1}')
TESTING_BRANCH=$(echo "$REPO" | awk '{print $4}')

echo "$0: going to push $PACKAGE"

cd $LOCATION/$PACKAGE

git push

echo ""

done

echo "$0: Done pushing"
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,8 @@ name: rostest
on:
workflow_dispatch:

push:
branches: [ testing ]

# schedule:
# - cron: '0 20 * * *' # every day at 10pm UTC+2
schedule:
- cron: '0 5 * * *' # every day at 7am UTC+2

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -51,7 +48,7 @@ jobs:
run: |
.ci/test.sh "${{ matrix.job }}"
merge:
merge_and_push:
runs-on: ubuntu-20.04
needs: build-job
env:
Expand All @@ -61,12 +58,6 @@ jobs:
with:
fetch-depth: 0
submodules: 'recursive'
- name: Checkout CI scripts
uses: actions/checkout@v3
with:
repository: ctu-mrs/ci_scripts
ref: master
path: .ci_scripts
token: ${{ secrets.PUSH_TOKEN }}
- name: Merge
run: echo "Merging release_candidate to release"
- id: merge
run: |
.ci/merge_push_to_release.sh

0 comments on commit d26ec64

Please sign in to comment.