Skip to content

Commit

Permalink
Update from update/networkservicemesh/cmd-template
Browse files Browse the repository at this point in the history
  • Loading branch information
nsmbot authored Nov 4, 2020
1 parent d73661c commit 79bd697
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 28 deletions.
22 changes: 10 additions & 12 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -209,23 +209,24 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

update-integration-k8s-kind:
needs:
- automerge
name: Update integration-k8s-kind
runs-on: ubuntu-latest
if: github.repository != 'networkservicemesh/cmd-template'
if: github.repository != 'networkservicemesh/cmd-template' && github.actor == 'nsmbot' && github.base_ref == 'master' && github.event_name == 'pull_request'
steps:
- name: Checkout repository
- name: Checkout ${{ github.repository }}
uses: actions/checkout@v2
- name: Find merged PR
uses: jwalton/gh-find-current-pr@v1
id: findPr
with:
github-token: ${{ github.token }}
path: ${{ github.repository }}S
ref: master
fetch-depth: '0'
- 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 "Update application version to latest version from ${{ github.repository }}@master ${{ github.repository }}#${{ github.event.number }}" >> /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 "${{ github.repository }} PR link: https://github.com/${{ github.repository }}/pull/${{ github.event.number }}" >> /tmp/commit-message
echo "" >> /tmp/commit-message
echo "${{ github.repository }} commit message:" >> /tmp/commit-message
git log -1 >> /tmp/commit-message
Expand All @@ -237,9 +238,6 @@ jobs:
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/short-sha@v1.1
id: short-sha
with:
Expand Down Expand Up @@ -269,7 +267,7 @@ jobs:
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
while [ git push origin update/"${branchName}" ]; do
git fetch origin update/"${branchName}"
git rebase origin/update/"${branchName}"
done
11 changes: 7 additions & 4 deletions .github/workflows/docker-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,25 @@ jobs:
env:
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKER_USER: ${{ secrets.DOCKER_LOGIN }}
TAG: ${GITHUB_SHA::8}
ORG: networkservicemeshci
CGO_ENABLED: 0
NAME: ${{ github.event.repository.name }}
if: github.repository != 'networkservicemesh/cmd-template'
steps:
- uses: actions/checkout@v2
- uses: benjlevesque/short-sha@v1.1
id: short-sha
with:
length: 8
- uses: actions/setup-go@v1
with:
go-version: 1.15
- name: Build ${NAME} image
run: docker build . -t "${ORG}/${NAME}:${TAG}" --target runtime
run: docker build . -t "${ORG}/${NAME}:${{ steps.short-sha.outputs.sha }}" --target runtime
- name: Push ${NAME} image
run: |
docker login -u $DOCKER_USER -p $DOCKER_PASSWORD
docker push "${ORG}/${NAME}:${TAG}"
docker image rm "${ORG}/${NAME}:${TAG}"
docker push "${ORG}/${NAME}:${{ steps.short-sha.outputs.sha }}"
docker image rm "${ORG}/${NAME}:${{ steps.short-sha.outputs.sha }}"
docker push "${ORG}/${NAME}:latest"
docker image rm "${ORG}/${NAME}:latest"
4 changes: 2 additions & 2 deletions .github/workflows/update-cmd-repositories.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ jobs:
git restore --staged -- .templateignore &&
git restore -- .templateignore
} || {
rm .templateignore
touch .templateignore
rm .templateignore &&
touch .templateignore &&
git add .templateignore
}
while read -r line || [[ -n "$line" ]]; do
Expand Down
16 changes: 6 additions & 10 deletions .github/workflows/update-integration-k8s-kind.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,18 @@ jobs:
runs-on: ubuntu-latest
if: github.repository != 'networkservicemesh/cmd-template'
steps:
- name: Checkout repository
- name: Checkout ${{ github.repository }}
uses: actions/checkout@v2
- name: Find merged PR
uses: jwalton/gh-find-current-pr@v1
id: findPr
with:
github-token: ${{ github.token }}
path: ${{ github.repository }}S
ref: master
fetch-depth: '0'
- 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 "Update application version to latest version from ${{ github.repository }}@master ${{ github.repository }}#${{ github.event.number }}" >> /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 "${{ github.repository }} PR link: https://github.com/${{ github.repository }}/pull/${{ github.event.number }}" >> /tmp/commit-message
echo "" >> /tmp/commit-message
echo "${{ github.repository }} commit message:" >> /tmp/commit-message
git log -1 >> /tmp/commit-message
Expand All @@ -35,9 +34,6 @@ jobs:
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/short-sha@v1.1
id: short-sha
with:
Expand Down

0 comments on commit 79bd697

Please sign in to comment.