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

feat: Update alternative run examples to be interactive #1529

Merged
merged 1 commit into from
Nov 29, 2022

Conversation

nicklem
Copy link
Contributor

@nicklem nicklem commented Nov 29, 2022

See codacy/codacy-coverage-reporter#419

👀 Live preview

https://feat-interactive-alternative-run-ex--docs-codacy.netlify.app/coverage-reporter/alternative-ways-of-running-coverage-reporter/#bash-script

❗Important

Reply to and close codacy/codacy-coverage-reporter#419 after deploying this.

To build a Docker image and test the command

  1. Create a directory, say mkdir /path/to/dir, and place in it the 2 files below (Dockerfile and test-upload.sh). You'll also need a sample coverage file (not included here).
  2. In Dockerfile, update the WORKDIR /path/to/dir line with the actual path to your new directory.
  3. In test-upload.sh, update the ./coverage.xml path with the actual path to a test coverage file.
  4. Navigate to the new directory cd /path/to/dir.
  5. Build the test-upload image: docker build -t test-upload ..
  6. Using your project's CODACY_PROJECT_TOKEN, run the new image docker run --env CODACY_PROJECT_TOKEN=<your-token> test-upload

Dockerfile

FROM alpine:latest

WORKDIR /path/to/dir
COPY . .

ENTRYPOINT ["./test-upload.sh"]

test-upload.sh

#!/bin/sh

wget -qO - https://coverage.codacy.com/get.sh | sh -s -- report -r ./coverage.xml

For more context:
https://github.com/codacy-docs/sandbox/blob/nico-onboarding/Dockerfile
https://github.com/codacy-docs/sandbox/blob/nico-onboarding/test-upload.sh

@nicklem nicklem requested a review from a team as a code owner November 29, 2022 13:35
@github-actions github-actions bot temporarily deployed to Netlify November 29, 2022 13:36 Inactive
@nicklem nicklem requested a review from prcr November 29, 2022 13:39
@nicklem nicklem added the don't merge Don't merge this pull request yet label Nov 29, 2022
@nicklem nicklem removed the don't merge Don't merge this pull request yet label Nov 29, 2022
@nicklem nicklem force-pushed the feat/interactive-alternative-run-examples branch from de3e723 to 7c0e978 Compare November 29, 2022 16:12
@nicklem nicklem enabled auto-merge (squash) November 29, 2022 16:12
@github-actions github-actions bot temporarily deployed to Netlify November 29, 2022 16:14 Inactive
@nicklem nicklem merged commit 3685b64 into master Nov 29, 2022
@nicklem nicklem deleted the feat/interactive-alternative-run-examples branch November 29, 2022 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants