Merge pull request #402 from dod-ccpo/crl-cron-job

cronjob config for syncing CRLs
This commit is contained in:
dandds 2018-10-25 10:33:30 -04:00 committed by GitHub
commit 7f2442a24f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 6 deletions

View File

@ -86,7 +86,7 @@ jobs:
name: "Load Cache: CRLs"
keys:
- disa-crls-v2
- run:
- run:
name: "Update CRLs"
command: ./script/sync-crls
- save_cache:
@ -163,7 +163,7 @@ jobs:
--change="ENV APP_GROUP \"${APP_GROUP}\"" \
--change="ENV APP_DIR \"${APP_DIR}\"" \
--change='ENTRYPOINT ["/usr/bin/dumb-init", "--"]' \
--change="CMD [\"bash\", \"-c\", \"${APP_DIR}/script/uwsgi_server\"]" \
--change="CMD [\"bash\", \"-c\", \"crond -b && ${APP_DIR}/script/uwsgi_server\"]" \
--change="WORKDIR ${APP_DIR}" \
--change="USER \"${APP_USER}\"" \
${CONTAINER_NAME} \

View File

@ -12,5 +12,8 @@ APP_UID="8010"
# Add additional packages required by app dependencies
ADDITIONAL_PACKAGES="postgresql-libs python3 rsync uwsgi uwsgi-python3"
# add sync-crl cronjob for atst user
echo "1 */6 * * * /opt/atat/atst/script/sync-crls tests/crl-tmp" >> /etc/crontabs/atst
# Run the shared alpine setup script
source ./script/include/run_alpine_setup

View File

@ -4,11 +4,17 @@
set -e
cd "$(dirname "$0")/.."
mkdir -p crl-tmp
pipenv run python ./atst/domain/authnid/crl/util.py crl-tmp crl
if [[ $# -eq 0 ]]; then
TMP_DIR=crl-tmp
else
TMP_DIR=$1
fi
mkdir -p $TMP_DIR
pipenv run python ./atst/domain/authnid/crl/util.py $TMP_DIR crl
mkdir -p crl
rsync -rq --min-size 400 crl-tmp/. crl/.
rm -rf crl-tmp
rsync -rq --min-size 400 $TMP_DIR/. crl/.
rm -rf $TMP_DIR
if [[ $FLASK_ENV != "prod" ]]; then
# place our test CRL there