24 Commits

Author SHA1 Message Date
226456ccd2 absolute pathes
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/tag/woodpecker Pipeline was successful
2025-06-10 17:18:34 +02:00
227ef294d3 custom ca, 14
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/tag/woodpecker Pipeline was successful
2025-06-04 16:14:16 +02:00
a14e0ab2c5 custom ca, 13
Some checks are pending
ci/woodpecker/tag/woodpecker Pipeline is pending
2025-06-04 16:13:14 +02:00
471fcb2177 custom ca, 12
Some checks are pending
ci/woodpecker/tag/woodpecker Pipeline is pending
2025-06-04 16:01:37 +02:00
0d4ac4022a custom ca, 11
Some checks are pending
ci/woodpecker/tag/woodpecker Pipeline is pending
2025-06-04 15:56:55 +02:00
405d66cdcb custom ca, 10
Some checks are pending
ci/woodpecker/tag/woodpecker Pipeline is pending
2025-06-04 15:53:49 +02:00
a32d9fd643 custom ca, 9
Some checks are pending
ci/woodpecker/tag/woodpecker Pipeline is pending
2025-06-04 15:51:21 +02:00
7f394f82ee custom ca, 8 2025-06-04 15:49:42 +02:00
c8577edf0c custom ca, 7
Some checks failed
ci/woodpecker/tag/woodpecker Pipeline failed
2025-06-04 15:45:06 +02:00
02aba34391 custom ca, 6
Some checks failed
ci/woodpecker/tag/woodpecker Pipeline failed
2025-06-04 15:42:15 +02:00
1fb4c387a7 custom ca, 5
Some checks are pending
ci/woodpecker/tag/woodpecker Pipeline is pending
2025-06-04 15:37:48 +02:00
92b61fdae0 custom ca, 4
Some checks are pending
ci/woodpecker/tag/woodpecker Pipeline is pending
2025-06-04 15:35:23 +02:00
4ddb6cfd30 custom ca, 3
Some checks are pending
ci/woodpecker/tag/woodpecker Pipeline is pending
2025-06-04 15:33:14 +02:00
0eb761db27 custom ca, 2
Some checks are pending
ci/woodpecker/tag/woodpecker Pipeline is pending
2025-06-04 15:31:14 +02:00
9cc81373dc custom ca
Some checks are pending
ci/woodpecker/tag/woodpecker Pipeline is pending
2025-06-04 15:24:15 +02:00
b856424640 factorize stages
Some checks are pending
ci/woodpecker/tag/woodpecker Pipeline is pending
2025-06-04 15:08:00 +02:00
d6a8f5f436 urls in variables 2025-06-04 15:01:52 +02:00
4cc4e5cec6 dockerize goal, 8
Some checks are pending
ci/woodpecker/tag/woodpecker Pipeline is pending
2025-06-04 14:56:11 +02:00
aec0e3fb0e dockerize goal, 7
Some checks are pending
ci/woodpecker/tag/woodpecker Pipeline is pending
2025-06-04 14:03:39 +02:00
05c5c49cd5 dockerize goal, 6
All checks were successful
ci/woodpecker/tag/woodpecker Pipeline was successful
2025-06-04 14:00:46 +02:00
9156b594e3 dockerize goal, 5
Some checks are pending
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/tag/woodpecker Pipeline is pending
2025-06-04 13:48:19 +02:00
4fbda91e15 dockerize goal, 4
Some checks are pending
ci/woodpecker/tag/woodpecker Pipeline is pending
2025-06-04 13:46:16 +02:00
50248acefb dockerize goal, 3
Some checks are pending
ci/woodpecker/tag/woodpecker Pipeline is pending
2025-06-04 13:40:05 +02:00
c9c57445b9 dockerize goal, 2
Some checks are pending
ci/woodpecker/tag/woodpecker Pipeline is pending
2025-06-04 13:37:56 +02:00
3 changed files with 49 additions and 25 deletions

View File

@ -5,9 +5,12 @@ stages:
variables:
REGISTRY: devnexus.krohne.com:18079/repository/docker-krohne
IMAGE_NAME: $REGISTRY/$CI_PROJECT_NAME
DTRACK_API_URL: https://dtrack-api-rd.krohne.com
DEFECTDOJO_API_URL: https://defectdojo-rd.krohne.com
KROHNE_CA_URL: https://devwiki.krohnegroup.com/lib/exe/fetch.php?media=krohne-ca.crt
KROHNE_CA_CHECKSUM: a921e440a742f1e67c7714306e2c0d76
generate-dtrack-api:
.generate-api:
stage: generate-api-clients
image: openapitools/openapi-generator-cli:v7.12.0
tags:
@ -16,12 +19,22 @@ generate-dtrack-api:
- bash
rules:
- if: '$CI_COMMIT_BRANCH == "main"'
- if: '$CI_COMMIT_TAG'
before_script:
- curl --insecure $KROHNE_CA_URL -o krohne-ca.crt
- echo "$KROHNE_CA_CHECKSUM krohne-ca.crt" | md5sum -c
- mv krohne-ca.crt /usr/local/share/ca-certificates
- update-ca-certificates
generate-dtrack-api:
extends: .generate-api
artifacts:
paths:
- dtrack-api-client.tgz
expire_in: 1 week
script:
- curl https://dtrack-api.hottis.de/api/openapi.json > dependencytrack-openapi.json
- curl ${DTRACK_API_URL}/api/openapi.json > dependencytrack-openapi.json
- |
docker-entrypoint.sh \
author template \
@ -41,20 +54,13 @@ generate-dtrack-api:
generate-defectdojo-api:
stage: generate-api-clients
image: openapitools/openapi-generator-cli:v7.12.0
tags:
- linux
- docker
- bash
rules:
- if: '$CI_COMMIT_BRANCH == "main"'
extends: .generate-api
artifacts:
paths:
- defectdojo-api-client.tgz
expire_in: 1 week
script:
- curl https://defectdojo.hottis.de/api/v2/oa3/schema/?format=json > defectdojo-openapi.json
- curl ${DEFECTDOJO_API_URL}/api/v2/oa3/schema/?format=json > defectdojo-openapi.json
- |
docker-entrypoint.sh \
generate \
@ -74,7 +80,11 @@ dockerize:
rules:
- if: '$CI_COMMIT_TAG'
script:
- docker build --tag $IMAGE_NAME:latest
- tar -xzf defectdojo-api-client.tgz
- tar -xzf dtrack-api-client.tgz
- docker build --build-arg ADDITIONAL_CA_URL="$KROHNE_CA_URL"
--build-arg ADDITIONAL_CA_CHECKSUM=$KROHNE_CA_CHECKSUM
--tag $IMAGE_NAME:latest
--tag $IMAGE_NAME:$CI_COMMIT_SHA
--tag $IMAGE_NAME:$CI_COMMIT_TAG
.

View File

@ -6,12 +6,26 @@ ENV DEFECTDOJO_URL=""
ENV DEFECTDOJO_TOKEN=""
ARG APP_DIR=/opt/app
ARG ADDITIONAL_CA_URL="x"
ARG ADDITIONAL_CA_CHECKSUM="y"
RUN \
set -e &&\
apk add --no-cache syft &&\
adduser -s /bin/sh -D user &&\
mkdir -p $APP_DIR &&\
chown user:user $APP_DIR
chown user:user $APP_DIR &&\
echo $ADDITIONAL_CA_URL &&\
echo $ADDITIONAL_CA_CHECKSUM &&\
if [ "$ADDITIONAL_CA_URL" != "x" ]; then \
cd /usr/share/ca-certificates; \
wget --no-check-certificate -O custom-ca.crt $ADDITIONAL_CA_URL; \
echo "$ADDITIONAL_CA_CHECKSUM custom-ca.crt" | md5sum -c; \
/usr/sbin/update-ca-certificates; \
echo "custom ca added"; \
else \
echo "no additional ca"; \
fi
USER user
WORKDIR $APP_DIR

View File

@ -1,11 +1,11 @@
#!/bin/sh
# entrypoint.sh
source ./.venv/bin/activate
source /opt/app/.venv/bin/activate
PYTHONPATH="$PYTHONPATH:./dependencytrack-client"
PYTHONPATH="$PYTHONPATH:./defectdojo-client"
PYTHONPATH="$PYTHONPATH:/opt/app/dependencytrack-client"
PYTHONPATH="$PYTHONPATH:/opt/app/defectdojo-client"
export PYTHONPATH
exec python sbom-dt-dd.py "$@"
exec python /opt/app/sbom-dt-dd.py "$@"