Skip to content

Commit

Permalink
update ci for integral repo and discrete repo sync
Browse files Browse the repository at this point in the history
  • Loading branch information
llh730 committed Aug 14, 2024
1 parent 631d211 commit 477cfb1
Show file tree
Hide file tree
Showing 12 changed files with 460 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/push-to-discrete-repo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: push-to-discrete-repo
on:
push:
branches: [mi_dev]
jobs:
push:
runs-on: ubuntu-latest
steps:
- name: Setup SSH
uses: webfactory/ssh-agent@v0.7.0
with:
ssh-private-key: ${{ secrets.SSH_KEY }}
- name: Setup Env
run: |
git clone https://github.com/ingydotnet/git-subrepo /opt/git-subrepo
echo 'source /opt/git-subrepo/.rc' >> ~/.bashrc
git clone git@github.com:rel4team/mi-dev-integral-rel4.git
cd mi-dev-integral-rel4
PARENT_COMMIT_ID=$(git log -1 --pretty=%H | head -n 1)
INTEGRAL_COMMIT_MESSAGE=$(git log -1 --pretty=%B | head -n 1)
echo "INTEGRAL_COMMIT_MESSAGE=${INTEGRAL_COMMIT_MESSAGE}" >> $GITHUB_ENV
echo "PARENT_COMMIT_ID=${PARENT_COMMIT_ID}" >> $GITHUB_ENV
git config user.name "$(git log -n 1 --pretty=format:%an)"
git config user.email "$(git log -n 1 --pretty=format:%ae)"
- name: Push To Discrete Repo
if: ${{ ! contains(github.event.head_commit.message, 'git subrepo')}}
run: |
source /opt/git-subrepo/.rc
cd mi-dev-integral-rel4
git subrepo push --all
- name: Update Current Repo
if: ${{ ! contains(github.event.head_commit.message, 'git subrepo')}}
run: |
source /opt/git-subrepo/.rc
cd mi-dev-integral-rel4
git reset ${PARENT_COMMIT_ID}
./update.sh
git add .
git commit -m "git subrepo update commit for $INTEGRAL_COMMIT_MESSAGE"
git push
39 changes: 39 additions & 0 deletions driver-collect/.github/workflows/push-to-discrete-repo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: push-to-integral-repo
on:
push:
branches: [mi_dev]
jobs:
push:
runs-on: ubuntu-latest
steps:
- name: Setup SSH
uses: webfactory/ssh-agent@v0.7.0
with:
ssh-private-key: ${{ secrets.SSH_KEY }}
- name: Setup Env
run: |
git clone https://github.com/ingydotnet/git-subrepo /opt/git-subrepo
echo 'source /opt/git-subrepo/.rc' >> ~/.bashrc
git clone git@github.com:rel4team/mi-dev-integral-rel4.git
cd mi-dev-integral-rel4
git config user.name "$(git log -n 1 --pretty=format:%an)"
git config user.email "$(git log -n 1 --pretty=format:%ae)"
INTEGRAL_COMMIT_MESSAGE=$(git log -1 --pretty=%B | head -n 1)
echo "INTEGRAL_COMMIT_MESSAGE=${INTEGRAL_COMMIT_MESSAGE}" >> $GITHUB_ENV
- name: Push To Integral Repo
if: ${{! contains(github.event.head_commit.message,'git subrepo') }}
env:
CURRENT_COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
run: |
echo "current repo commit message: $CURRENT_COMMIT_MESSAGE"
echo "integral repo commit message: $INTEGRAL_COMMIT_MESSAGE"
if echo "$CURRENT_COMMIT_MESSAGE" | grep -q -E "$INTEGRAL_COMMIT_MESSAGE" || echo "$INTEGRAL_COMMIT_MESSAGE" | grep -q -E "$CURRENT_COMMIT_MESSAGE"; then
echo "sync finished"
else
echo "prepare sync"
source /opt/git-subrepo/.rc
cd mi-dev-integral-rel4
git subrepo pull --all
git push
fi
39 changes: 39 additions & 0 deletions kernel/.github/workflows/push-to-discrete-repo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: push-to-integral-repo
on:
push:
branches: [mi_dev]
jobs:
push:
runs-on: ubuntu-latest
steps:
- name: Setup SSH
uses: webfactory/ssh-agent@v0.7.0
with:
ssh-private-key: ${{ secrets.SSH_KEY }}
- name: Setup Env
run: |
git clone https://github.com/ingydotnet/git-subrepo /opt/git-subrepo
echo 'source /opt/git-subrepo/.rc' >> ~/.bashrc
git clone git@github.com:rel4team/mi-dev-integral-rel4.git
cd mi-dev-integral-rel4
git config user.name "$(git log -n 1 --pretty=format:%an)"
git config user.email "$(git log -n 1 --pretty=format:%ae)"
INTEGRAL_COMMIT_MESSAGE=$(git log -1 --pretty=%B | head -n 1)
echo "INTEGRAL_COMMIT_MESSAGE=${INTEGRAL_COMMIT_MESSAGE}" >> $GITHUB_ENV
- name: Push To Integral Repo
if: ${{! contains(github.event.head_commit.message,'git subrepo') }}
env:
CURRENT_COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
run: |
echo "current repo commit message: $CURRENT_COMMIT_MESSAGE"
echo "integral repo commit message: $INTEGRAL_COMMIT_MESSAGE"
if echo "$CURRENT_COMMIT_MESSAGE" | grep -q -E "$INTEGRAL_COMMIT_MESSAGE" || echo "$INTEGRAL_COMMIT_MESSAGE" | grep -q -E "$CURRENT_COMMIT_MESSAGE"; then
echo "sync finished"
else
echo "prepare sync"
source /opt/git-subrepo/.rc
cd mi-dev-integral-rel4
git subrepo pull --all
git push
fi
39 changes: 39 additions & 0 deletions sel4_common/.github/workflows/push-to-discrete-repo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: push-to-integral-repo
on:
push:
branches: [mi_dev]
jobs:
push:
runs-on: ubuntu-latest
steps:
- name: Setup SSH
uses: webfactory/ssh-agent@v0.7.0
with:
ssh-private-key: ${{ secrets.SSH_KEY }}
- name: Setup Env
run: |
git clone https://github.com/ingydotnet/git-subrepo /opt/git-subrepo
echo 'source /opt/git-subrepo/.rc' >> ~/.bashrc
git clone git@github.com:rel4team/mi-dev-integral-rel4.git
cd mi-dev-integral-rel4
git config user.name "$(git log -n 1 --pretty=format:%an)"
git config user.email "$(git log -n 1 --pretty=format:%ae)"
INTEGRAL_COMMIT_MESSAGE=$(git log -1 --pretty=%B | head -n 1)
echo "INTEGRAL_COMMIT_MESSAGE=${INTEGRAL_COMMIT_MESSAGE}" >> $GITHUB_ENV
- name: Push To Integral Repo
if: ${{! contains(github.event.head_commit.message,'git subrepo') }}
env:
CURRENT_COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
run: |
echo "current repo commit message: $CURRENT_COMMIT_MESSAGE"
echo "integral repo commit message: $INTEGRAL_COMMIT_MESSAGE"
if echo "$CURRENT_COMMIT_MESSAGE" | grep -q -E "$INTEGRAL_COMMIT_MESSAGE" || echo "$INTEGRAL_COMMIT_MESSAGE" | grep -q -E "$CURRENT_COMMIT_MESSAGE"; then
echo "sync finished"
else
echo "prepare sync"
source /opt/git-subrepo/.rc
cd mi-dev-integral-rel4
git subrepo pull --all
git push
fi
39 changes: 39 additions & 0 deletions sel4_cspace/.github/workflows/push-to-discrete-repo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: push-to-integral-repo
on:
push:
branches: [mi_dev]
jobs:
push:
runs-on: ubuntu-latest
steps:
- name: Setup SSH
uses: webfactory/ssh-agent@v0.7.0
with:
ssh-private-key: ${{ secrets.SSH_KEY }}
- name: Setup Env
run: |
git clone https://github.com/ingydotnet/git-subrepo /opt/git-subrepo
echo 'source /opt/git-subrepo/.rc' >> ~/.bashrc
git clone git@github.com:rel4team/mi-dev-integral-rel4.git
cd mi-dev-integral-rel4
git config user.name "$(git log -n 1 --pretty=format:%an)"
git config user.email "$(git log -n 1 --pretty=format:%ae)"
INTEGRAL_COMMIT_MESSAGE=$(git log -1 --pretty=%B | head -n 1)
echo "INTEGRAL_COMMIT_MESSAGE=${INTEGRAL_COMMIT_MESSAGE}" >> $GITHUB_ENV
- name: Push To Integral Repo
if: ${{! contains(github.event.head_commit.message,'git subrepo') }}
env:
CURRENT_COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
run: |
echo "current repo commit message: $CURRENT_COMMIT_MESSAGE"
echo "integral repo commit message: $INTEGRAL_COMMIT_MESSAGE"
if echo "$CURRENT_COMMIT_MESSAGE" | grep -q -E "$INTEGRAL_COMMIT_MESSAGE" || echo "$INTEGRAL_COMMIT_MESSAGE" | grep -q -E "$CURRENT_COMMIT_MESSAGE"; then
echo "sync finished"
else
echo "prepare sync"
source /opt/git-subrepo/.rc
cd mi-dev-integral-rel4
git subrepo pull --all
git push
fi
39 changes: 39 additions & 0 deletions sel4_ipc/.github/workflows/push-to-discrete-repo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: push-to-integral-repo
on:
push:
branches: [mi_dev]
jobs:
push:
runs-on: ubuntu-latest
steps:
- name: Setup SSH
uses: webfactory/ssh-agent@v0.7.0
with:
ssh-private-key: ${{ secrets.SSH_KEY }}
- name: Setup Env
run: |
git clone https://github.com/ingydotnet/git-subrepo /opt/git-subrepo
echo 'source /opt/git-subrepo/.rc' >> ~/.bashrc
git clone git@github.com:rel4team/mi-dev-integral-rel4.git
cd mi-dev-integral-rel4
git config user.name "$(git log -n 1 --pretty=format:%an)"
git config user.email "$(git log -n 1 --pretty=format:%ae)"
INTEGRAL_COMMIT_MESSAGE=$(git log -1 --pretty=%B | head -n 1)
echo "INTEGRAL_COMMIT_MESSAGE=${INTEGRAL_COMMIT_MESSAGE}" >> $GITHUB_ENV
- name: Push To Integral Repo
if: ${{! contains(github.event.head_commit.message,'git subrepo') }}
env:
CURRENT_COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
run: |
echo "current repo commit message: $CURRENT_COMMIT_MESSAGE"
echo "integral repo commit message: $INTEGRAL_COMMIT_MESSAGE"
if echo "$CURRENT_COMMIT_MESSAGE" | grep -q -E "$INTEGRAL_COMMIT_MESSAGE" || echo "$INTEGRAL_COMMIT_MESSAGE" | grep -q -E "$CURRENT_COMMIT_MESSAGE"; then
echo "sync finished"
else
echo "prepare sync"
source /opt/git-subrepo/.rc
cd mi-dev-integral-rel4
git subrepo pull --all
git push
fi
39 changes: 39 additions & 0 deletions sel4_task/.github/workflows/push-to-discrete-repo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: push-to-integral-repo
on:
push:
branches: [mi_dev]
jobs:
push:
runs-on: ubuntu-latest
steps:
- name: Setup SSH
uses: webfactory/ssh-agent@v0.7.0
with:
ssh-private-key: ${{ secrets.SSH_KEY }}
- name: Setup Env
run: |
git clone https://github.com/ingydotnet/git-subrepo /opt/git-subrepo
echo 'source /opt/git-subrepo/.rc' >> ~/.bashrc
git clone git@github.com:rel4team/mi-dev-integral-rel4.git
cd mi-dev-integral-rel4
git config user.name "$(git log -n 1 --pretty=format:%an)"
git config user.email "$(git log -n 1 --pretty=format:%ae)"
INTEGRAL_COMMIT_MESSAGE=$(git log -1 --pretty=%B | head -n 1)
echo "INTEGRAL_COMMIT_MESSAGE=${INTEGRAL_COMMIT_MESSAGE}" >> $GITHUB_ENV
- name: Push To Integral Repo
if: ${{! contains(github.event.head_commit.message,'git subrepo') }}
env:
CURRENT_COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
run: |
echo "current repo commit message: $CURRENT_COMMIT_MESSAGE"
echo "integral repo commit message: $INTEGRAL_COMMIT_MESSAGE"
if echo "$CURRENT_COMMIT_MESSAGE" | grep -q -E "$INTEGRAL_COMMIT_MESSAGE" || echo "$INTEGRAL_COMMIT_MESSAGE" | grep -q -E "$CURRENT_COMMIT_MESSAGE"; then
echo "sync finished"
else
echo "prepare sync"
source /opt/git-subrepo/.rc
cd mi-dev-integral-rel4
git subrepo pull --all
git push
fi
39 changes: 39 additions & 0 deletions sel4_vspace/.github/workflows/push-to-discrete-repo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: push-to-integral-repo
on:
push:
branches: [mi_dev]
jobs:
push:
runs-on: ubuntu-latest
steps:
- name: Setup SSH
uses: webfactory/ssh-agent@v0.7.0
with:
ssh-private-key: ${{ secrets.SSH_KEY }}
- name: Setup Env
run: |
git clone https://github.com/ingydotnet/git-subrepo /opt/git-subrepo
echo 'source /opt/git-subrepo/.rc' >> ~/.bashrc
git clone git@github.com:rel4team/mi-dev-integral-rel4.git
cd mi-dev-integral-rel4
git config user.name "$(git log -n 1 --pretty=format:%an)"
git config user.email "$(git log -n 1 --pretty=format:%ae)"
INTEGRAL_COMMIT_MESSAGE=$(git log -1 --pretty=%B | head -n 1)
echo "INTEGRAL_COMMIT_MESSAGE=${INTEGRAL_COMMIT_MESSAGE}" >> $GITHUB_ENV
- name: Push To Integral Repo
if: ${{! contains(github.event.head_commit.message,'git subrepo') }}
env:
CURRENT_COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
run: |
echo "current repo commit message: $CURRENT_COMMIT_MESSAGE"
echo "integral repo commit message: $INTEGRAL_COMMIT_MESSAGE"
if echo "$CURRENT_COMMIT_MESSAGE" | grep -q -E "$INTEGRAL_COMMIT_MESSAGE" || echo "$INTEGRAL_COMMIT_MESSAGE" | grep -q -E "$CURRENT_COMMIT_MESSAGE"; then
echo "sync finished"
else
echo "prepare sync"
source /opt/git-subrepo/.rc
cd mi-dev-integral-rel4
git subrepo pull --all
git push
fi
39 changes: 39 additions & 0 deletions serial-frame/.github/workflows/push-to-discrete-repo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: push-to-integral-repo
on:
push:
branches: [mi_dev]
jobs:
push:
runs-on: ubuntu-latest
steps:
- name: Setup SSH
uses: webfactory/ssh-agent@v0.7.0
with:
ssh-private-key: ${{ secrets.SSH_KEY }}
- name: Setup Env
run: |
git clone https://github.com/ingydotnet/git-subrepo /opt/git-subrepo
echo 'source /opt/git-subrepo/.rc' >> ~/.bashrc
git clone git@github.com:rel4team/mi-dev-integral-rel4.git
cd mi-dev-integral-rel4
git config user.name "$(git log -n 1 --pretty=format:%an)"
git config user.email "$(git log -n 1 --pretty=format:%ae)"
INTEGRAL_COMMIT_MESSAGE=$(git log -1 --pretty=%B | head -n 1)
echo "INTEGRAL_COMMIT_MESSAGE=${INTEGRAL_COMMIT_MESSAGE}" >> $GITHUB_ENV
- name: Push To Integral Repo
if: ${{! contains(github.event.head_commit.message,'git subrepo') }}
env:
CURRENT_COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
run: |
echo "current repo commit message: $CURRENT_COMMIT_MESSAGE"
echo "integral repo commit message: $INTEGRAL_COMMIT_MESSAGE"
if echo "$CURRENT_COMMIT_MESSAGE" | grep -q -E "$INTEGRAL_COMMIT_MESSAGE" || echo "$INTEGRAL_COMMIT_MESSAGE" | grep -q -E "$CURRENT_COMMIT_MESSAGE"; then
echo "sync finished"
else
echo "prepare sync"
source /opt/git-subrepo/.rc
cd mi-dev-integral-rel4
git subrepo pull --all
git push
fi
Loading

0 comments on commit 477cfb1

Please sign in to comment.