Skip to content
Snippets Groups Projects
Commit e1318673 authored by Pierre Smeyers's avatar Pierre Smeyers
Browse files

Merge branch 'fix/display-subjects' into 'master'

fix: display subject of jobs

See merge request to-be-continuous/docker!115
parents 3b3ebdd1 b10cb509
No related branches found
No related tags found
No related merge requests found
...@@ -725,6 +725,7 @@ docker-hadolint: ...@@ -725,6 +725,7 @@ docker-hadolint:
script: script:
- autoconfig_hadolint - autoconfig_hadolint
- mkdir -p -m 777 reports - mkdir -p -m 777 reports
- log_info "Scanning ${DOCKER_FILE}..."
- dockerfile_hash=$(echo "$DOCKER_FILE" | md5sum | cut -d" " -f1) - dockerfile_hash=$(echo "$DOCKER_FILE" | md5sum | cut -d" " -f1)
# Output in Code Climate format (GitLab integration) # Output in Code Climate format (GitLab integration)
- hadolint --no-fail -f gitlab_codeclimate $DOCKER_HADOLINT_ARGS $hadolint_config_opts "$DOCKER_FILE" > "reports/docker-hadolint-${dockerfile_hash}.codeclimate.json" - hadolint --no-fail -f gitlab_codeclimate $DOCKER_HADOLINT_ARGS $hadolint_config_opts "$DOCKER_FILE" > "reports/docker-hadolint-${dockerfile_hash}.codeclimate.json"
...@@ -862,7 +863,9 @@ docker-healthcheck: ...@@ -862,7 +863,9 @@ docker-healthcheck:
variables: variables:
GIT_STRATEGY: none GIT_STRATEGY: none
stage: package-test stage: package-test
script: | script:
- log_info "Healthchecking ${DOCKER_SNAPSHOT_IMAGE}..."
- |
# Test by internal health_check (Recommended way, more info https://docs.docker.com/engine/reference/builder/#healthcheck) # Test by internal health_check (Recommended way, more info https://docs.docker.com/engine/reference/builder/#healthcheck)
# This looks complicated but you normally don't have to touch this... # This looks complicated but you normally don't have to touch this...
function unexpected_error() { function unexpected_error() {
...@@ -928,7 +931,9 @@ docker-trivy: ...@@ -928,7 +931,9 @@ docker-trivy:
stage: package-test stage: package-test
variables: variables:
TRIVY_CACHE_DIR: ".trivycache/" TRIVY_CACHE_DIR: ".trivycache/"
script: | script:
- log_info "Scanning vulnerabilities from ${DOCKER_SNAPSHOT_IMAGE}..."
- |
# cache cleanup is needed when scanning images with the same tags, it does not remove the database # cache cleanup is needed when scanning images with the same tags, it does not remove the database
trivy clean --scan-cache || trivy image --clear-cache trivy clean --scan-cache || trivy image --clear-cache
export TRIVY_USERNAME=${DOCKER_REGISTRY_SNAPSHOT_USER:-${DOCKER_REGISTRY_USER:-$CI_REGISTRY_USER}} export TRIVY_USERNAME=${DOCKER_REGISTRY_SNAPSHOT_USER:-${DOCKER_REGISTRY_USER:-$CI_REGISTRY_USER}}
...@@ -976,6 +981,7 @@ docker-sbom: ...@@ -976,6 +981,7 @@ docker-sbom:
name: $DOCKER_SBOM_IMAGE name: $DOCKER_SBOM_IMAGE
entrypoint: [""] entrypoint: [""]
script: script:
- log_info "Extracting SBOM from ${DOCKER_SNAPSHOT_IMAGE}..."
- mkdir -p -m 777 reports - mkdir -p -m 777 reports
- basename=$(echo "${DOCKER_SNAPSHOT_IMAGE}" | sed 's|[/:]|_|g') - basename=$(echo "${DOCKER_SNAPSHOT_IMAGE}" | sed 's|[/:]|_|g')
- /syft scan ${TRACE+-vv} $DOCKER_SNAPSHOT_IMAGE $DOCKER_SBOM_OPTS -o cyclonedx-json=reports/docker-sbom-${basename}.cyclonedx.json - /syft scan ${TRACE+-vv} $DOCKER_SNAPSHOT_IMAGE $DOCKER_SBOM_OPTS -o cyclonedx-json=reports/docker-sbom-${basename}.cyclonedx.json
...@@ -1030,6 +1036,7 @@ docker-publish: ...@@ -1030,6 +1036,7 @@ docker-publish:
fi fi
- BUILDTOOL_HOME=${BUILDTOOL_HOME:-$HOME} - BUILDTOOL_HOME=${BUILDTOOL_HOME:-$HOME}
# 1: push main image # 1: push main image
- log_info "Copying ${DOCKER_SNAPSHOT_IMAGE} to ${DOCKER_RELEASE_IMAGE}..."
- skopeo copy --src-authfile "$BUILDTOOL_HOME/skopeo/.docker/src-config.json" --dest-authfile "$BUILDTOOL_HOME/skopeo/.docker/dest-config.json" ${DOCKER_PUBLISH_ARGS} "docker://$DOCKER_SNAPSHOT_IMAGE" "docker://$DOCKER_RELEASE_IMAGE" - skopeo copy --src-authfile "$BUILDTOOL_HOME/skopeo/.docker/src-config.json" --dest-authfile "$BUILDTOOL_HOME/skopeo/.docker/dest-config.json" ${DOCKER_PUBLISH_ARGS} "docker://$DOCKER_SNAPSHOT_IMAGE" "docker://$DOCKER_RELEASE_IMAGE"
- | - |
log_info "Well done your image is pushed and can be pulled with: docker pull $DOCKER_RELEASE_IMAGE" log_info "Well done your image is pushed and can be pulled with: docker pull $DOCKER_RELEASE_IMAGE"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment