Skip to content

Commit

Permalink
[cloudbuild] Build a patched defectdojo image
Browse files Browse the repository at this point in the history
  • Loading branch information
dinvlad committed Mar 6, 2020
1 parent 069d2f6 commit 65111f9
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 2 deletions.
17 changes: 15 additions & 2 deletions cloudbuild.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
options:
env:
- terraform_bucket=${PROJECT_ID}-terraform
- defectdojo_image=gcr.io/${PROJECT_ID}/defectdojo-django

steps:
- id: tf-bucket
- id: terraform-bucket
name: gcr.io/cloud-builders/gsutil
entrypoint: sh
args:
- -c
- gsutil mb gs://${terraform_bucket} &&
gsutil versioning set on gs://${terraform_bucket} || true

- id: tf
- id: terraform
name: hashicorp/terraform
entrypoint: sh
dir: cluster
Expand Down Expand Up @@ -48,3 +49,15 @@ steps:
--destination=gcr.io/${PROJECT_ID}/kubectl-sdk
--context=dir:///workspace/kubectl-sdk
--cache=true

# build patched DefectDojo image
- id: defectdojo-docker
name: *kaniko
waitFor: ['-']
entrypoint: sh
args:
- -c
- executor
--destination=${defectdojo_image}
--context=dir:///workspace/defectdojo
--cache=true
5 changes: 5 additions & 0 deletions defectdojo/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM defectdojo/defectdojo-django

COPY *.patch /tmp

RUN git apply /tmp/*.patch
11 changes: 11 additions & 0 deletions defectdojo/postgress_table_name.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/dojo/management/commands/import_surveys.py
+++ b/dojo/management/commands/import_surveys.py
@@ -22,7 +22,7 @@ class Command(BaseCommand):
created_question = TextQuestion.objects.create(optional=False, order=1, text='What is love?')
# Get the ID used in this system
with connection.cursor() as cursor:
- cursor.execute("select polymorphic_ctype_id from defectDojo_engagement_survey_question;")
+ cursor.execute('select polymorphic_ctype_id from "defectDojo_engagement_survey_question";')
row = cursor.fetchone()
ctype_id = row[0]
# Find the current id in the surveys file

0 comments on commit 65111f9

Please sign in to comment.