Skip to content

Commit

Permalink
Update common CI files to latest version from networkservicemesh/cmd-…
Browse files Browse the repository at this point in the history
…template@master networkservicemesh/cmd-template#41

networkservicemesh/cmd-template PR link: networkservicemesh/cmd-template#41

networkservicemesh/cmd-template commit message:
commit 2ab8f7384540fe10d255449bff518bd7a07b9749
Author: Denis Tingaikin <49399980+denis-tingajkin@users.noreply.github.com>
Date:   Tue Nov 10 22:33:06 2020 +0700

    make docker image build steps separately (#41)

    Signed-off-by: Denis Tingajkin <denis.tingajkin@xored.com>

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
  • Loading branch information
NSMBot committed Nov 10, 2020
1 parent 0996a0f commit b84b934
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@ jobs:
CGO_ENABLED: 0
NAME: ${{ github.event.repository.name }}
needs:
- automerge
- build
- docker
if: github.actor == 'nsmbot' && github.base_ref == 'master' && github.event_name == 'pull_request' && github.repository != 'networkservicemesh/cmd-template'
steps:
- uses: actions/checkout@v2
Expand All @@ -189,8 +190,7 @@ jobs:
name: automerge
runs-on: ubuntu-latest
needs:
- build
- docker
- update-integration-k8s-kind
if: github.actor == 'nsmbot' && github.base_ref == 'master' && github.event_name == 'pull_request'
steps:
- name: Check out the code
Expand All @@ -209,7 +209,7 @@ jobs:

update-integration-k8s-kind:
needs:
- automerge
- pushImage
name: Update integration-k8s-kind
runs-on: ubuntu-latest
if: github.repository != 'networkservicemesh/cmd-template' && github.actor == 'nsmbot' && github.base_ref == 'master' && github.event_name == 'pull_request'
Expand All @@ -223,7 +223,7 @@ jobs:
- name: Create commit message
working-directory: ${{ github.repository }}
run: |
echo "Update application version to latest version from ${{ github.repository }}@master ${{ github.repository }}#${{ github.event.number }}" >> /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/${{ github.event.number }}" >> /tmp/commit-message
echo "" >> /tmp/commit-message
Expand Down Expand Up @@ -257,7 +257,7 @@ jobs:
fi
diff=$(git diff --name-only)
branchName="${{ github.event.repository.name }}"
if [ $(grep "go.mod" <<< "${diff}") && $(grep "" -c <<< "${diff}") == 1 ]; then
if [[ $(grep "go.mod" <<< "${diff}") && $(grep "" -c <<< "${diff}") == 2 ]]; then
sdkPattern="github.com\/networkservicemesh\/sdk "
sdkVersion=$(grep --regexp "${sdkPattern}" go.mod)
branchName="${sdkVersion:${#sdkPattern}}"
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/docker-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@ jobs:
- uses: actions/setup-go@v1
with:
go-version: 1.15
- name: Build ${NAME} image
- name: Build ${NAME}:${GITHUB_SHA::8} image
run: docker build . -t "${ORG}/${NAME}:${GITHUB_SHA::8}" --target runtime
- name: Push ${NAME} image
- name: Build ${NAME}:latest image
run: docker build . -t "${ORG}/${NAME}" --target runtime
- name: Push ${NAME} images
run: |
docker login -u $DOCKER_USER -p $DOCKER_PASSWORD
docker push "${ORG}/${NAME}:${GITHUB_SHA::8}"
docker image rm "${ORG}/${NAME}:${GITHUB_SHA::8}"
docker push "${ORG}/${NAME}:latest"
docker image rm "${ORG}/${NAME}:latest"
docker push "${ORG}/${NAME}"
docker image rm "${ORG}/${NAME}"
5 changes: 2 additions & 3 deletions .github/workflows/update-integration-k8s-kind.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Create commit message
working-directory: ${{ github.repository }}
run: |
echo "Update application version to latest version from ${{ github.repository }}@master ${{ github.repository }}#${{ github.event.number }}" >> /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/${{ github.event.number }}" >> /tmp/commit-message
echo "" >> /tmp/commit-message
Expand Down Expand Up @@ -54,7 +54,7 @@ jobs:
fi
diff=$(git diff --name-only)
branchName="${{ github.event.repository.name }}"
if [ $(grep "go.mod" <<< "${diff}") && $(grep "" -c <<< "${diff}") == 1 ]; then
if [[ $(grep "go.mod" <<< "${diff}") && $(grep "" -c <<< "${diff}") == 2 ]]; then
sdkPattern="github.com\/networkservicemesh\/sdk "
sdkVersion=$(grep --regexp "${sdkPattern}" go.mod)
branchName="${sdkVersion:${#sdkPattern}}"
Expand All @@ -65,7 +65,6 @@ jobs:
echo Branch update/"${branchName}" is already deleted
}
fi;
fi;
git config --global user.email "nsmbot@networkservicmesh.io"
git config --global user.name "NSMBot"
git commit -s -F /tmp/commit-message
Expand Down

0 comments on commit b84b934

Please sign in to comment.