From 065bc3e8cc5c5f7b71164e46f9ccf6e91ef9fc76 Mon Sep 17 00:00:00 2001 From: Nathan Moore Date: Thu, 16 Nov 2023 11:20:02 -0500 Subject: [PATCH] Adding a POST request to run analytics daily (#267) * Adding a POST request to run analytics every day at 7am * Adding GDRIVE enviornment variables * Removing supercronic bin * Needs to be HOST * Adding Gdrive network policy * Gdrive isnt in the public space * Dont need the space parameter --- .github/workflows/deploy-cron.yaml | 1 + cron/crontab | 2 ++ cron/manifest.yaml | 3 +++ 3 files changed, 6 insertions(+) diff --git a/.github/workflows/deploy-cron.yaml b/.github/workflows/deploy-cron.yaml index 1267744..1752584 100644 --- a/.github/workflows/deploy-cron.yaml +++ b/.github/workflows/deploy-cron.yaml @@ -39,3 +39,4 @@ jobs: - name: Add network policies run: | cf add-network-policy cron outbound-proxy -s ${{ steps.cf-setup.outputs.target-environment }}-public --protocol tcp --port 8080 + cf add-network-policy cron gdrive --protocol tcp --port 8080 diff --git a/cron/crontab b/cron/crontab index 2415530..d6f811c 100644 --- a/cron/crontab +++ b/cron/crontab @@ -1,3 +1,5 @@ @hourly echo "Testing cron runner" @hourly cf run-task cron --command 'echo "Test CF Task"' --name "test-cron-task" + +@daily curl -XPOST "http://$GDRIVE_APP_HOST:$GDRIVE_APP_PORT/analytics" \ No newline at end of file diff --git a/cron/manifest.yaml b/cron/manifest.yaml index 02a8b15..853f723 100644 --- a/cron/manifest.yaml +++ b/cron/manifest.yaml @@ -12,3 +12,6 @@ applications: services: - cron-service-account - outbound-proxy + env: + GDRIVE_APP_HOST: "idva-gdrive-((ENVIRONMENT_NAME)).apps.internal" + GDRIVE_APP_PORT: 8080 \ No newline at end of file