generated from meshery/meshery-istio
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #43 from sayantan1413/sayantan1413/workflow/app-mesh
Added the CI workflow
- Loading branch information
Showing
4 changed files
with
233 additions
and
110 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 |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: Meshery-App-Mesh Build and Releaser | ||
on: | ||
push: | ||
branches: | ||
- 'master' | ||
tags: | ||
- 'v*' | ||
|
||
jobs: | ||
build: | ||
name: Build check | ||
runs-on: ubuntu-latest | ||
# needs: [lint, error_check, static_check, vet, sec_check, tests] | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@master | ||
with: | ||
fetch-depth: 1 | ||
- name: Setup Go | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: ${{ secrets.GO_VERSION }} | ||
- run: GOPROXY=direct GOSUMDB=off GO111MODULE=on go build . | ||
docker: | ||
name: Docker build and push | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@master | ||
with: | ||
fetch-depth: 1 | ||
- name: Docker login | ||
uses: azure/docker-login@v1 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
- name: Docker edge build & tag | ||
if: startsWith(github.ref, 'refs/tags/') != true && success() | ||
run: | | ||
DOCKER_BUILDKIT=1 docker build --no-cache -t ${{ secrets.IMAGE_NAME }}:edge-latest --build-arg TOKEN=${{ secrets.GLOBAL_TOKEN }} --build-arg GIT_COMMITSHA=${GITHUB_SHA::7} --build-arg VERSION="edge-latest" . | ||
docker tag ${{ secrets.IMAGE_NAME }}:edge-latest ${{ secrets.IMAGE_NAME }}:edge-${GITHUB_SHA::7} | ||
- name: Docker edge push | ||
if: startsWith(github.ref, 'refs/tags/') != true && success() | ||
run: | | ||
docker push ${{ secrets.IMAGE_NAME }}:edge-latest | ||
docker push ${{ secrets.IMAGE_NAME }}:edge-${GITHUB_SHA::7} | ||
- name: Docker stable build & tag | ||
if: github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') && success() | ||
run: | | ||
DOCKER_BUILDKIT=1 docker build --no-cache -t ${{ secrets.IMAGE_NAME }}:stable-latest --build-arg GIT_COMMITSHA=${GITHUB_SHA::7} --build-arg VERSION=${GITHUB_REF/refs\/tags\//} . | ||
docker tag ${{ secrets.IMAGE_NAME }}:stable-latest ${{ secrets.IMAGE_NAME }}:stable-${GITHUB_REF/refs\/tags\//} | ||
docker tag ${{ secrets.IMAGE_NAME }}:stable-latest ${{ secrets.IMAGE_NAME }}:stable-${GITHUB_SHA::7} | ||
- name: Docker stable push | ||
if: github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') && success() | ||
run: | | ||
docker push ${{ secrets.IMAGE_NAME }}:stable-latest | ||
docker push ${{ secrets.IMAGE_NAME }}:stable-${GITHUB_REF/refs\/tags\//} | ||
docker push ${{ secrets.IMAGE_NAME }}:stable-${GITHUB_SHA::7} | ||
- name: Docker Hub Description | ||
if: github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') && success() | ||
uses: peter-evans/dockerhub-description@v2.0.0 | ||
env: | ||
DOCKERHUB_USERNAME: ${{ secrets.DOCKER_USERNAME }} | ||
DOCKERHUB_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | ||
DOCKERHUB_REPOSITORY: ${{ secrets.IMAGE_NAME }} |
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,63 @@ | ||
name: Meshkit Error Codes Utility Runner | ||
on: | ||
push: | ||
branches: | ||
- 'master' | ||
paths: | ||
- '**.go' | ||
|
||
jobs: | ||
Update-error-codes: | ||
name: Error codes utility | ||
if: github.repository == 'meshery/meshery-app-mesh' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
# token here with write access to meshery-app-mesh repo | ||
with: | ||
token: ${{ secrets.GH_ACCESS_TOKEN }} | ||
ref: 'master' | ||
|
||
- name: Setup Go | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: ${{ secrets.GO_VERSION }} | ||
|
||
- name: Run utility | ||
run: | | ||
go get github.com/layer5io/meshkit/cmd/errorutil | ||
go run github.com/layer5io/meshkit/cmd/errorutil -d . update --skip-dirs meshery -i ./helpers -o ./helpers | ||
# to update errorutil* files in meshery-app-mesh repo | ||
- name: Commit changes | ||
uses: stefanzweifel/git-auto-commit-action@v4 | ||
with: | ||
commit_user_name: l5io | ||
commit_user_email: ci@layer5.io | ||
commit_author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com> | ||
commit_options: '--signoff' | ||
commit_message: 'run error codes utility' | ||
file_pattern: helpers/ **/error.go | ||
|
||
# to push changes to meshery docs | ||
- name: Checkout meshery | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: 'meshery/meshery' | ||
# token with write access to meshery repository | ||
token: ${{ secrets.GH_ACCESS_TOKEN }} | ||
path: 'meshery' | ||
ref: 'master' | ||
|
||
- name: Update docs | ||
run: | | ||
echo '{ "errors_export": "" }' | jq --slurpfile export ./helpers/errorutil_errors_export.json '.errors_export = $export[0]' > ./meshery/docs/_data/errorref/app-mesh_errors_export.json | ||
- name: Commit changes | ||
uses: stefanzweifel/git-auto-commit-action@v4 | ||
with: | ||
repository: ./meshery | ||
commit_user_name: l5io | ||
commit_user_email: ci@layer5.io | ||
commit_author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com> | ||
commit_options: '--signoff' | ||
commit_message: '[Docs] Error Code Reference: Updated codes for App-Mesh adapter' | ||
file_pattern: docs/ |
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,19 @@ | ||
name: Release Drafter | ||
|
||
on: | ||
push: | ||
# our release branch | ||
branches: | ||
- master | ||
|
||
jobs: | ||
update_release_draft: | ||
runs-on: ubuntu-latest | ||
steps: | ||
# Drafts your next Release notes as Pull Requests are merged into "master" | ||
- uses: release-drafter/release-drafter@v5 | ||
with: | ||
config-name: release-drafter.yml | ||
disable-autolabeler: true | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.RELEASEDRAFTER_PAT }} |