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

added codefresh template #40

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

added codefresh template #40

wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented Apr 15, 2022

No description provided.

Copy link
Collaborator

@sebsnyk sebsnyk left a comment

Choose a reason for hiding this comment

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

Looking good, nice to see codefresh joining the group.

Left some comments to simplify things.

stages:
- "prepare"
- "verify"
- "deploy"
Copy link
Collaborator

Choose a reason for hiding this comment

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

this stage is declared but not used below, I suggest to remove it

revision: "${{CF_REVISION}}"
stage: "prepare"

run_unit_tests:
Copy link
Collaborator

Choose a reason for hiding this comment

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

we don't need to run unit tests for these examples, let's focus solely on the steps required for getting snyk tests to work (also, the mvn invocation does not run tests, but calls package - which compiles the app)


version: "1.0"
# Stages can help you organize your steps in stages
stages:
Copy link
Collaborator

Choose a reason for hiding this comment

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

consider setting up a "security" stage and showcase the 4 snyk products in a task each, so code, open source, container+image, iac

https://codefresh.io/docs/docs/codefresh-yaml/stages/

stage: verify
image: 'snyk/snyk-cli:maven-3.6.3_java11'
commands:
- snyk monitor
Copy link
Collaborator

Choose a reason for hiding this comment

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

this command needs a token & authentication - where is it handled?

image: 'maven:3.5.2-jdk-8-alpine'
commands:
- mvn -Dmaven.repo.local=/codefresh/volume/m2_repository package
build_app_image:
Copy link
Collaborator

Choose a reason for hiding this comment

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

after the docker image is built, it is not used in the below stages

  1. either we skip this step
  2. or we pass the built image name to the security.container step, for example (security stage to be done)

@@ -0,0 +1,42 @@
# More examples of Codefresh YAML can be found at
# https://codefresh.io/docs/docs/yaml-examples/examples/
Copy link
Collaborator

Choose a reason for hiding this comment

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

At the moment, no report artefacts are generated. I suggest we go without first and setup a GH issue on this repo to showcase static HTML reports like these https://codefresh.io/docs/docs/testing/test-reports/ (via snyk-to-html)

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