forked from apache/atlas
-
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.
- Loading branch information
Showing
2 changed files
with
25 additions
and
15 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 |
---|---|---|
|
@@ -36,12 +36,12 @@ jobs: | |
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up JDK 1.8 | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 1.8 | ||
|
||
- name: Cache Maven packages | ||
uses: actions/cache@v2 | ||
with: | ||
|
@@ -51,9 +51,8 @@ jobs: | |
|
||
- name: Get branch name | ||
run: | | ||
echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" | ||
echo "##[set-output name=branch_lower;]$(echo ${GITHUB_REF#refs/heads/} | awk '{gsub("/", "-"); print tolower($0)}')" | ||
id: get_branch | ||
echo "BRANCH_NAME=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV | ||
echo BRANCH_NAME=${GITHUB_REF#refs/heads/} | ||
- name: Create Maven Settings | ||
uses: s4u/[email protected] | ||
|
@@ -67,8 +66,8 @@ jobs: | |
- name: Build with Maven | ||
run: | | ||
branch_name=${{ steps.get_branch.outputs.branch }} | ||
if [[ $branch_name == 'main' || $branch_name == 'master' || $branch_name == 'revert3773dg1924' || $branch_name == 'dg1908' ]] | ||
branch_name=${{ env.BRANCH_NAME }} | ||
if [[ $branch_name == 'main' || $branch_name == 'master' || $branch_name == 'lineageondemand' ]] | ||
then | ||
echo "build without dashboard" | ||
chmod +x ./build.sh && ./build.sh build_without_dashboard | ||
|
@@ -77,19 +76,26 @@ jobs: | |
chmod +x ./build.sh && ./build.sh | ||
fi | ||
- run: echo "REPOSITORY_NAME=`echo "$GITHUB_REPOSITORY" | awk -F / '{print $2}' | sed -e "s/:refs//"`" >> $GITHUB_ENV | ||
- name: Get Repository Name | ||
run: echo "REPOSITORY_NAME=`echo "$GITHUB_REPOSITORY" | awk -F / '{print $2}' | sed -e "s/:refs//"`" >> $GITHUB_ENV | ||
shell: bash | ||
|
||
- name: Get version tag | ||
run: echo "##[set-output name=version;]$(echo `git ls-remote https://${{ secrets.ORG_PAT_GITHUB }}@github.com/atlanhq/${REPOSITORY_NAME}.git refs/heads/${{ steps.get_branch.outputs.branch }} | awk '{ print $1}' | cut -c1-7`)abcd" | ||
id: get_version | ||
# run: echo "##[set-output name=version;]$(echo `git ls-remote https://${{ secrets.ORG_PAT_GITHUB }}@github.com/atlanhq/${REPOSITORY_NAME}.git ${{ env.BRANCH_NAME }} | awk '{ print $1}' | cut -c1-7`)abcd" | ||
run: | | ||
echo "VERSION=$(git ls-remote https://${{ secrets.ORG_PAT_GITHUB }}@github.com/atlanhq/${REPOSITORY_NAME}.git ${{ env.BRANCH_NAME }} | awk '{ print $1}' | cut -c1-7 | head -n 1)abcd" | ||
echo "VERSION=$(git ls-remote https://${{ secrets.ORG_PAT_GITHUB }}@github.com/atlanhq/${REPOSITORY_NAME}.git ${{ env.BRANCH_NAME }} | awk '{ print $1}' | cut -c1-7 | tr -d '[:space:]')abcd" | ||
echo "VERSION=$(git ls-remote https://${{ secrets.ORG_PAT_GITHUB }}@github.com/atlanhq/${REPOSITORY_NAME}.git ${{ env.BRANCH_NAME }} | awk '{ print $1}' | cut -c1-7 | tr -d '[:space:]')abcd" >> $GITHUB_ENV | ||
- name: Get commit ID | ||
run: echo "COMMIT_ID=$(echo ${GITHUB_SHA} | cut -c1-7)abcd" >> $GITHUB_ENV | ||
|
||
- name: Set up Buildx | ||
- name: Set up Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Login to GitHub Registry | ||
uses: docker/login-action@v1 | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: $GITHUB_ACTOR | ||
|
@@ -106,8 +112,8 @@ jobs: | |
provenance: true | ||
push: true | ||
tags: | | ||
ghcr.io/atlanhq/${{ github.event.repository.name }}-${{ steps.get_branch.outputs.branch_lower }}:latest | ||
ghcr.io/atlanhq/${{ github.event.repository.name }}-${{ steps.get_branch.outputs.branch_lower }}:${{ steps.get_version.outputs.version }} | ||
ghcr.io/atlanhq/${{ github.event.repository.name }}-${{ env.BRANCH_NAME }}:latest | ||
ghcr.io/atlanhq/${{ github.event.repository.name }}-${{ env.BRANCH_NAME }}:${{ env.COMMIT_ID }} | ||
- name: Scan Image | ||
uses: aquasecurity/trivy-action@master | ||
|
@@ -120,4 +126,4 @@ jobs: | |
- name: Upload Trivy scan results to GitHub Security tab | ||
uses: github/codeql-action/[email protected] | ||
with: | ||
sarif_file: 'trivy-image-results.sarif' | ||
sarif_file: 'trivy-image-results.sarif' |
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