Skip to content

Commit

Permalink
Merge branch 'release/1.3.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
pbchase committed Aug 30, 2022
2 parents dc3aee2 + aaf8962 commit a559cba
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 62 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: redcapcustodian
Type: Package
Title: System data cleaning for REDCap
Version: 1.3.0
Version: 1.3.1
Authors@R: c(
person("Philip", "Chase",
email = "[email protected]",
Expand Down
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ All notable changes to the redcapcustodian package and its contained scripts wil
This project adheres to [Semantic Versioning](http://semver.org/).


## [1.3.1] - 2022-08-30
### Added
- Remove remants of the site concept (Philip Chase)


## [1.3.0] - 2022-08-29
### Added
- Add get_bad_emails_from_individual_emails function (Kyle Chesney)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ To build upon that foundation, this repository also provides a folder, [`study_t

In such an automated environment, each ETL job in this system is an Rscript run via Docker. Each report is an RMarkdown file again run via Docker. The design assumes the Docker containers are hosted on a Linux host with API access to one or more REDCap systems, a mail server, a MySQL database, and, optionally, the REDCap database itself.

For sites without container infrastructure, each image can be instantiated into a container via a cron job as documented in the files in [`examples/crons/`](examples/crons/). Each file in that folder runs a single job. To run a job, its cron script must be copied to the `/etc/cron.d/` folder on the Linux host. The `build.sh` script builds the containers and optionally deploys the environment files and cron scripts.
For sites without container infrastructure, each image can be instantiated into a container via a cron job as documented in the files in [`examples/crons/`](examples/crons/). Each file in that folder runs a single job. To run a job, its cron script must be copied to the `/etc/cron.d/` folder on the Linux host. The `build.sh` script builds the redcapcustodian container upon which containers built by the study template would depend.


# How to use this project
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.3.0
1.3.1
61 changes: 2 additions & 59 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,21 +1,13 @@
#!/bin/sh
# build.sh - a script to construct and optionally deploy a redcapcustodian
# container

# This script requires a single parameter that names the host for which
# the container will be built. The parameter can be either full or
# relative path to the host folder or the name of the host folder itself.
# In the latter case, "./site/" will be prepended to the parameter
# given in an attempt to locate the host folder
# build.sh - a script to construct a redcapcustodian Docker image

# Parse options to the `build.sh` command
while getopts ":hd" opt; do
case ${opt} in
h )
echo "Usage:"
echo " build.sh -h Display this help message."
echo " build.sh Build the redcapcustodian and rcc.site Docker images."
echo " build.sh -d Build the images and deploy all configuration files"
echo " build.sh Build the redcapcustodian Docker image"
exit 0
;;
d )
Expand All @@ -29,55 +21,6 @@ while getopts ":hd" opt; do
done
shift $((OPTIND -1))

sitepath='./site'
image_name=rcc.site

if [ $deploy ]; then
echo Deploying redcapcustodian
TARGET_CRON_FOLDER=/etc/cron.d/
if [ -d $TARGET_CRON_FOLDER ]; then
echo Copying cron files
old_pwd=$(pwd)
cd $sitepath
find . -type d -iname cron -exec ls -d {} \; | \
xargs -i find {} -type f | sed "s/.\{2\}//;" | \
perl -n -e 'chop(); $src=$_; $target=$_; $target =~ s/\//-/g; $cmd = "cp $src /etc/cron.d/rcc-$target\n"; print $cmd; system($cmd);'
ls -ltr /etc/cron.d/rcc-*
cd $old_pwd
fi

# Deploy environment files
# Specify the target folder for environment files
ENV_FILES_FOLDER=/rcc
if [ -e $sitepath/.env ]; then
. $sitepath/.env
fi
# make the target folder for env files if it does not exist
if [ ! -d $ENV_FILES_FOLDER ]; then
mkdir -p $ENV_FILES_FOLDER
fi

# Copy all of the env files from the site project to the config folder.
if [ -e $sitepath/.env ]; then
cp $sitepath/.env $ENV_FILES_FOLDER
fi

# Deploy all env folders
old_pwd=$(pwd)
cd $sitepath
find . -type d -iname "env" | xargs -i mkdir -p ${ENV_FILES_FOLDER}/{}
find . -type d -iname "env" | xargs -i rsync -arcv {}/ ${ENV_FILES_FOLDER}/{}
cd $old_pwd

fi

shared_image=redcapcustodian
echo "Building $shared_image image"
docker build -t $shared_image . && docker tag $shared_image:latest $shared_image:`cat VERSION` && docker image ls $shared_image | head -n 5

site_image=rcc.site
echo "Building site-specific redcapcustodian image $site_image"
old_pwd=$(pwd)
cd site
docker build -t $site_image . && docker tag $site_image:latest $site_image:`cat VERSION` && docker image ls $site_image | head -n 5
cd $old_pwd

0 comments on commit a559cba

Please sign in to comment.