Skip to content

Commit

Permalink
Merge pull request #22 from Police-Data-Accessibility-Project/mc_meta…
Browse files Browse the repository at this point in the history
…_issue_225_setup_jenkins_and_docker_file

Created Dockerfile and Jenkinsfile for running Automatic Archive with Python 3.11 and health monitoring actions.
  • Loading branch information
josh-chamberlain authored Jul 1, 2024
2 parents f2a7d46 + ce61fa9 commit 626f422
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
8 changes: 8 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM python:3.11

WORKDIR /usr/src/app

COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt

COPY . .
24 changes: 24 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env groovy

/*
This script runs all health monitoring actions
*/

pipeline {

agent {
dockerfile {
filename 'Dockerfile'
args '-e VUE_APP_PDAP_API_KEY=$VUE_APP_PDAP_API_KEY -e VITE_VUE_APP_BASE_URL=$VITE_VUE_APP_BASE_URL'
}
}

stages {
stage('Run Automatic Archive') {
steps {
echo 'Running Automatic Archive...'
sh 'python cache_url.py'
}
}
}
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ This tool uses the [PDAP API](https://docs.pdap.io/api/endpoints/data-sources-da

Then, it uses the PDAP API to update the Data Sources' `last_cached` and `url_status` properties.

The script is set up to run with a GitHub Actions workflow.
This script runs from the Automation Manager on a daily basis, with the Jenkinsfile and the Dockerfile utilized to ensure the script runs in a consistent environment and manner.

Requires the following environment variables to be set:

Expand Down

0 comments on commit 626f422

Please sign in to comment.