Skip to content

Commit

Permalink
Merge branch 'main' into wagtailcharts-test
Browse files Browse the repository at this point in the history
  • Loading branch information
csebianlander authored Sep 22, 2022
2 parents f4580d5 + 88c013b commit a5dd2c9
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 14 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
!.yarnrc
!babel.config.js
!docker-entrypoint.sh
!dump-data.sh
!Dockerfile
!frontend.sh
!initial-data.sh
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ RUN mkdir -p /var/www/.local && chown -R apache:apache ${APP_HOME} /var/www/.loc

# Copy the cfgov directory form the build image
COPY --from=cfgov-frontend-builder --chown=apache:apache ${CFGOV_PATH}/cfgov ${CFGOV_PATH}/cfgov
COPY --from=cfgov-frontend-builder --chown=apache:apache ${CFGOV_PATH}/docker-entrypoint.sh ${CFGOV_PATH}/refresh-data.sh ${CFGOV_PATH}/initial-data.sh ${CFGOV_PATH}/
COPY --from=cfgov-frontend-builder --chown=apache:apache ${CFGOV_PATH}/docker-entrypoint.sh ${CFGOV_PATH}/refresh-data.sh ${CFGOV_PATH}/initial-data.sh ${CFGOV_PATH}/dump-data.sh ${CFGOV_PATH}/
COPY --from=cfgov-frontend-builder --chown=apache:apache ${CFGOV_PATH}/static.in ${CFGOV_PATH}/static.in

RUN ln -s /usr/lib/apache2 cfgov/apache/modules
Expand Down
12 changes: 10 additions & 2 deletions dump-data.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh

# ==========================================================================
# Dump the contents of the Database into a gzipped SQL file.
Expand All @@ -15,8 +15,16 @@ fi
dump_data() {
# This preamble will drop the existing 'cfpb' schema if it exists.
DROP_PREAMBLE=$(cat << EOF
--
-- We add this DROP to ensure that a database dump can be loaded to generate
-- a state that exactly matches the one that was dumped. Without this, objects
-- in the schema before the dump happens may exist and conflict with the
-- dumped data being loaded.
--
SET client_min_messages = WARNING;
DROP SCHEMA IF EXISTS cfpb CASCADE;
DROP SCHEMA IF EXISTS ${PGUSER:-cfpb} CASCADE;
EOF
)

Expand Down
2 changes: 1 addition & 1 deletion helm/cfgov/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.2
version: 0.1.3

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
8 changes: 2 additions & 6 deletions helm/cfgov/templates/cronjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,9 @@ spec:
imagePullPolicy: {{ $.Values.image.pullPolicy }}
{{- end }}
command:
{{- range $values.command }}
- {{ . | quote }}
{{- end }}
{{- toYaml $values.command | nindent 16 }}
args:
{{- range $values.args }}
- {{ . | quote }}
{{- end }}
{{- toYaml $values.args | nindent 16 }}
volumeMounts:
{{- if or $values.includeEnv (not (hasKey $values "includeEnv")) }}
# Add in main container volumes
Expand Down
9 changes: 5 additions & 4 deletions helm/cfgov/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -226,10 +226,11 @@ cronJobs:
- "bash"
args:
- "-c"
- >-
pg_dump --no-owner --no-privileges | \
gzip > test.sql.gz | \
aws s3 cp test.sql.gz s3://$S3_BUCKET/
- |
./dump-data.sh "${DB_DUMP_FILE:-test.sql.gz}" && \
if [ ! -z $S3_BUCKET ]; then \
aws s3 cp "${DB_DUMP_FILE:-test.sql.gz}" \
s3://$S3_BUCKET/; fi
suspend: true

publish-scheduled-pages:
Expand Down
Binary file modified test.sql.gz
Binary file not shown.

0 comments on commit a5dd2c9

Please sign in to comment.