-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update common CI files to latest version from networkservicemesh/cmd-…
…template@master networkservicemesh/cmd-template#30 networkservicemesh/cmd-template PR link: networkservicemesh/cmd-template#30 networkservicemesh/cmd-template commit message: commit 1932dcf6f37c6847460367f9f995d5908e4ee811 Author: Denis Tingaikin <[email protected]> Date: Wed Nov 4 22:55:36 2020 +0700 fix: Do not try to restore files if .templateignore file is empty (#30) Signed-off-by: Denis Tingajkin <[email protected]> Signed-off-by: NSMBot <[email protected]>
- Loading branch information
NSMBot
committed
Nov 4, 2020
1 parent
b5856a6
commit 7a40728
Showing
4 changed files
with
149 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -164,7 +164,7 @@ jobs: | |
env: | ||
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | ||
DOCKER_USER: ${{ secrets.DOCKER_LOGIN }} | ||
TAG: master | ||
TAG: ${GITHUB_SHA::8} | ||
ORG: networkservicemeshci | ||
CGO_ENABLED: 0 | ||
NAME: ${{ github.event.repository.name }} | ||
|
@@ -183,6 +183,8 @@ jobs: | |
docker login -u $DOCKER_USER -p $DOCKER_PASSWORD | ||
docker push "${ORG}/${NAME}:${TAG}" | ||
docker image rm "${ORG}/${NAME}:${TAG}" | ||
docker push "${ORG}/${NAME}:latest" | ||
docker image rm "${ORG}/${NAME}:latest" | ||
automerge: | ||
name: automerge | ||
|
@@ -205,3 +207,69 @@ jobs: | |
with: | ||
GITHUB_LOGIN: nsmbot | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
update-integration-k8s-kind: | ||
name: Update integration-k8s-kind | ||
runs-on: ubuntu-latest | ||
if: github.repository != 'networkservicemesh/cmd-template' | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
- name: Find merged PR | ||
uses: jwalton/gh-find-current-pr@v1 | ||
id: findPr | ||
with: | ||
github-token: ${{ github.token }} | ||
- name: Create commit message | ||
working-directory: ${{ github.repository }} | ||
run: | | ||
echo "Update image version of ${{ github.repository }} ${{ github.repository }}#${{ steps.findPr.outputs.pr }}" >> /tmp/commit-message | ||
echo "" >> /tmp/commit-message | ||
echo "${{ github.repository }} PR link: https://github.com/${{ github.repository }}/pull/${{ steps.findPr.outputs.pr }}" >> /tmp/commit-message | ||
echo "" >> /tmp/commit-message | ||
echo "${{ github.repository }} commit message:" >> /tmp/commit-message | ||
git log -1 >> /tmp/commit-message | ||
echo "Commit Message:" | ||
cat /tmp/commit-message | ||
- name: Checkout networkservicemesh/integration-k8s-kind | ||
uses: actions/checkout@v2 | ||
with: | ||
path: networkservicemesh/integration-k8s-kind | ||
repository: networkservicemesh/integration-k8s-kind | ||
token: ${{ secrets.NSM_BOT_GITHUB_TOKEN }} | ||
- uses: actions/setup-go@v1 | ||
with: | ||
go-version: 1.13.4 | ||
- uses: benjlevesque/[email protected] | ||
id: short-sha | ||
with: | ||
length: 8 | ||
- name: Find and Replace version | ||
uses: jacobtomlinson/gha-find-replace@master | ||
with: | ||
find: "${{ github.event.repository.name }}:.*\n" | ||
replace: "${{ github.event.repository.name }}:${{ steps.short-sha.outputs.sha }}\n" | ||
- name: Push update to the integration-k8s-kind | ||
working-directory: networkservicemesh/integration-k8s-kind | ||
run: | | ||
echo Starting to update repositotry integration-k8s-kind | ||
git add -- . | ||
if ! [ -n "$(git diff --cached --exit-code)" ]; then | ||
echo Repository already up to date | ||
exit 0; | ||
fi | ||
diff=$(git diff --name-only) | ||
branchName="${{ github.event.repository.name }}" | ||
if [ $(grep "go.mod" <<< "${diff}") && $(grep "" -c <<< "${diff}") == 1 ]; then | ||
sdkPattern="github.com\/networkservicemesh\/sdk " | ||
sdkVersion=$(grep --regexp "${sdkPattern}" go.mod) | ||
branchName="${sdkVersion:${#sdkPattern}}" | ||
fi; | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "NSMBot" | ||
git commit -s -F /tmp/commit-message | ||
git checkout -b update/"${branchName}" | ||
while [ git push -f origin update/"${branchName}" ]; do | ||
git fetch origin update/"${branchName}" | ||
git rebase origin/update/"${branchName}" | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
--- | ||
name: Update integration-k8s-kind reposiotry | ||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
update-integration-k8s-kind: | ||
name: Update integration-k8s-kind | ||
runs-on: ubuntu-latest | ||
if: github.repository != 'networkservicemesh/cmd-template' | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
- name: Find merged PR | ||
uses: jwalton/gh-find-current-pr@v1 | ||
id: findPr | ||
with: | ||
github-token: ${{ github.token }} | ||
- name: Create commit message | ||
working-directory: ${{ github.repository }} | ||
run: | | ||
echo "Update image version of ${{ github.repository }} ${{ github.repository }}#${{ steps.findPr.outputs.pr }}" >> /tmp/commit-message | ||
echo "" >> /tmp/commit-message | ||
echo "${{ github.repository }} PR link: https://github.com/${{ github.repository }}/pull/${{ steps.findPr.outputs.pr }}" >> /tmp/commit-message | ||
echo "" >> /tmp/commit-message | ||
echo "${{ github.repository }} commit message:" >> /tmp/commit-message | ||
git log -1 >> /tmp/commit-message | ||
echo "Commit Message:" | ||
cat /tmp/commit-message | ||
- name: Checkout networkservicemesh/integration-k8s-kind | ||
uses: actions/checkout@v2 | ||
with: | ||
path: networkservicemesh/integration-k8s-kind | ||
repository: networkservicemesh/integration-k8s-kind | ||
token: ${{ secrets.NSM_BOT_GITHUB_TOKEN }} | ||
- uses: actions/setup-go@v1 | ||
with: | ||
go-version: 1.13.4 | ||
- uses: benjlevesque/[email protected] | ||
id: short-sha | ||
with: | ||
length: 8 | ||
- name: Find and Replace version | ||
uses: jacobtomlinson/gha-find-replace@master | ||
with: | ||
find: "${{ github.event.repository.name }}:.*\n" | ||
replace: "${{ github.event.repository.name }}:${{ steps.short-sha.outputs.sha }}\n" | ||
- name: Push update to the integration-k8s-kind | ||
working-directory: networkservicemesh/integration-k8s-kind | ||
run: | | ||
echo Starting to update repositotry integration-k8s-kind | ||
git add -- . | ||
if ! [ -n "$(git diff --cached --exit-code)" ]; then | ||
echo Repository already up to date | ||
exit 0; | ||
fi | ||
diff=$(git diff --name-only) | ||
branchName="${{ github.event.repository.name }}" | ||
if [ $(grep "go.mod" <<< "${diff}") && $(grep "" -c <<< "${diff}") == 1 ]; then | ||
sdkPattern="github.com\/networkservicemesh\/sdk " | ||
sdkVersion=$(grep --regexp "${sdkPattern}" go.mod) | ||
branchName="${sdkVersion:${#sdkPattern}}" | ||
fi; | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "NSMBot" | ||
git commit -s -F /tmp/commit-message | ||
git checkout -b update/"${branchName}" | ||
while [ git push -f origin update/"${branchName}" ]; do | ||
git fetch origin update/"${branchName}" | ||
git rebase origin/update/"${branchName}" | ||
done |