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#32

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

networkservicemesh/cmd-template commit message:
commit 220aa9a891bc5b8961b5791ddaddb44f8b7ae1a1
Author: Denis Tingaikin <49399980+denis-tingajkin@users.noreply.github.com>
Date:   Fri Nov 6 00:34:45 2020 +0700

    Simplify scripts and review comments (#32)

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

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
  • Loading branch information
NSMBot committed Nov 5, 2020
1 parent 5b55743 commit dfc77cc
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 26 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ 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 }}
Expand All @@ -177,12 +176,12 @@ jobs:
with:
go-version: 1.15
- name: Build ${NAME} image
run: docker build . -t "${ORG}/${NAME}:${TAG}" --target runtime
run: docker build . -t "${ORG}/${NAME}:${GITHUB_SHA::8}" --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}:${GITHUB_SHA::8}"
docker image rm "${ORG}/${NAME}:${GITHUB_SHA::8}"
docker push "${ORG}/${NAME}:latest"
docker image rm "${ORG}/${NAME}:latest"
Expand Down
10 changes: 3 additions & 7 deletions .github/workflows/docker-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,15 @@ jobs:
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}:${{ steps.short-sha.outputs.sha }}" --target runtime
run: docker build . -t "${ORG}/${NAME}:${GITHUB_SHA::8}" --target runtime
- name: Push ${NAME} image
run: |
docker login -u $DOCKER_USER -p $DOCKER_PASSWORD
docker push "${ORG}/${NAME}:${{ steps.short-sha.outputs.sha }}"
docker image rm "${ORG}/${NAME}:${{ steps.short-sha.outputs.sha }}"
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"
15 changes: 5 additions & 10 deletions .github/workflows/update-cmd-repositories.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,22 +53,17 @@ jobs:
git config --global user.name "NSMBot"
git remote add cmd_template https://github.com/networkservicemesh/cmd-template.git
git fetch cmd_template
if [ ! -f .templateignore ]; then
touch .templateignore
git add .templateignore
fi
git diff cmd_template/master -R | git apply
git add $(git ls-tree --name-only -r cmd_template/master | grep ".*\.yml\|.*\.yaml\|.*\.md\|.*\.txt\|.*.\.conf")
{
git restore --staged -- .templateignore &&
git restore -- .templateignore
} || {
rm .templateignore &&
touch .templateignore &&
git add .templateignore
}
git restore -- .templateignore
while read -r line || [[ -n "$line" ]]; do
git restore --staged -- $line
git restore -- $line
done < .templateignore
git restore --staged -- $(cat .templateignore)
git restore -- $(cat .templateignore)
if ! [ -n "$(git diff --cached --exit-code)" ]; then
exit 0;
fi
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/update-integration-k8s-kind.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,8 @@ jobs:
runs-on: ubuntu-latest
if: github.repository != 'networkservicemesh/cmd-template'
steps:
- name: Checkout ${{ github.repository }}
- name: Checkout ${{ github.repository }} code
uses: actions/checkout@v2
with:
path: ${{ github.repository }}S
ref: master
fetch-depth: '0'
- name: Create commit message
working-directory: ${{ github.repository }}
run: |
Expand Down

0 comments on commit dfc77cc

Please sign in to comment.