Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exposes docker env variables to gradle steps #47

Merged
merged 1 commit into from
Dec 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions .github/workflows/merge-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,9 @@ jobs:
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: branch name tag
run: |
BRANCH="${GITHUB_REF#refs/heads/}"
echo "BRANCH=${BRANCH}" >> $GITHUB_ENV

- name: push docker image
run: ./gradlew dockerPushImages
run: ./gradlew dockerPushImages
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still docker login after adding env here? If, not, we can remove that in follow-up PR.

env:
DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }}
3 changes: 3 additions & 0 deletions .github/workflows/pr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ jobs:

- name: Build with Gradle
run: ./gradlew build dockerBuildImages
env:
DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }}

validate-helm-charts:
runs-on: ubuntu-20.04
Expand Down
15 changes: 4 additions & 11 deletions .github/workflows/pr-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
run: ./gradlew jacocoTestReport

- name: Copy unit test reports
run: ./gradlew copyAllReports --output-dir=/tmp/unit-test-reports
run: ./gradlew copyAllReports --output-dir=/tmp/test-reports
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this can be omitted, it's being run later


- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
Expand All @@ -42,19 +42,12 @@ jobs:
fail_ci_if_error: true
verbose: true
flags: unit

- name: Archive unit test report
uses: actions/upload-artifact@v1
with:
name: unit-test
path: /tmp/unit-test-reports
if: ${{ always() }}

- name: Integration test
run: ./gradlew jacocoIntegrationTestReport

- name: Copy integration test reports
run: ./gradlew copyAllReports --output-dir=/tmp/integration-test-reports
run: ./gradlew copyAllReports --output-dir=/tmp/test-reports

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
Expand All @@ -67,6 +60,6 @@ jobs:
- name: Archive integration test report
uses: actions/upload-artifact@v1
with:
name: integration-test
path: /tmp/integration-test-reports
name: test-reports
Copy link
Contributor

@kotharironak kotharironak Dec 22, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious (not a blocker): Why are we uploading as artifacts when we are uploading to codecov?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

codecov gives us test coverage but not test results

path: /tmp/test-reports
if: ${{ always() }}
5 changes: 4 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ jobs:

- name: Publish docker image
run: ./gradlew publish dockerPushImages
env:
DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

write credentials should be kept distinct from read credentials (this will be a read-only token once dockerhub allows assigning permission to tokens)

DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }}

publish-helm-charts:
runs-on: ubuntu-20.04
Expand All @@ -48,7 +51,7 @@ jobs:
steps:
# Set fetch-depth: 0 to fetch commit history and tags for use in version calculation
- name: Checkout Repository
uses: actions/checkout@v2
uses: actions/checkout@v2.3.4
with:
fetch-depth: 0

Expand Down