Skip to content

Commit 0e79070

Browse files
committed
Merge branch 'release/1.0.0'
2 parents 78b8415 + 87b0b05 commit 0e79070

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+556
-3199
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ redcap/
77
build
88
*.pyc
99
.idea
10+
settings/*.ini
11+
v

AUTHORS.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Contributors
2+
3+
The REDCap Deployment project would not be possible without generous contributions from our authors and funders.
4+
5+
David R Nelson, Director of the University of Florida Clinical Translational Science Institute, provides funding support for the UF CTSI REDCap team via UF CTSA Award and matching funds from the UF Office of Research.
6+
7+
Matthew McConnell provided excellent examples of Fabric API tools in his work on the [Quality Improvement Registry](https://github.com/ctsit/qipr_approver).
8+
9+
Philip Chase ([email protected]) was the principle designer on the project. The development team includes Philip Chase, Sreeja Kannagundla, Stewart Wehmeyer, Taryn Stoffs, and Erik C. Schmidt.
10+
11+
Taryn Stoffs, Amber L. Allen, Christopher P. Barnes, Matthew McConnell, Patrick F. White, Kevin S. Hanson, and Taryn Stoffs provided valuable contributions to documentation and publications.
12+

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,19 @@
22
All notable changes to the REDCap Deployment project will be documented in this file.
33
This project adheres to [Semantic Versioning](http://semver.org/).
44

5+
## [1.0.0] - 2017-05-19
6+
### Changed
7+
- Replace Vagrant-based REDCap deployment with Fabric-based deployment (Philip Chase)
8+
- Clean up files on the root of the project (Philip Chase)
9+
- Add test_plugin task to fabfile to test a plugin under development in the host OS (Philip Chase)
10+
- Moved settings/*.ini files to *.example
11+
12+
### Added
13+
- Add Authors file (Philip Chase)
14+
15+
### Removed
16+
- Remove old hooks, plugins, and config files (Philip Chase)
17+
518

619
## [0.9.1] - 2017-04-21
720
### Added

Makefile

Lines changed: 0 additions & 15 deletions
This file was deleted.

README.md

Lines changed: 41 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Overview
44

5-
This project provides tools for scripted deployments and upgrades of REDCap instances and the extensions installed within them. The toolset achieves this through scripted building of packages of the REDCap with extensions as well as the scripted deployment of those packages to hosts. The goal of the project is to provide a tool set that can build packages rapidly and consistently across REDCap version numbers and deploy those packages to new and existing REDCap instances. This will reduce the variability between development, testing, and production environments. This in turn will reduce the error rates, the cost of testing, and the costs of upgrading REDCap instances.
5+
This project provides tools for scripted deployments and upgrades of REDCap instances and the extensions installed within them. The toolset achieves this through scripted building of packages of the REDCap with extensions as well as the scripted deployment of those packages to hosts. The goal of the project is to provide a tool set that can build packages rapidly and consistently across REDCap version numbers and deploy those packages to new and existing REDCap instances. This reduces the variability between development, testing, and production environments. This in turn reduces the error rates, the cost of testing, and the costs of upgrading REDCap instances.
66

77
Ancillary to this goal, this project provides a local REDCap instance that can be used as an educational REDCap tool and/or a software development test bed. You can use this project for any or all of these goals.
88

@@ -17,11 +17,11 @@ root folder of this project. It should not be renamed.
1717

1818
### Virtual Machine
1919

20-
This project provides a virtual machine wherein it hosts the local REDCap instance. Creating the virtual machine (VM) the software packages Vagrant, VirtualBox, the vagrant-hostsupdater plugin and the vagrant-env plugin be installed on the host system.
20+
This project provides a virtual machine wherein it hosts the local REDCap instance. Creating the virtual machine (VM) required the software packages Vagrant, VirtualBox, the vagrant-hostsupdater plugin and the vagrant-env plugin be installed on the host system.
2121

2222
### Packaging and Deployment
2323

24-
The packaging and deployment tools are designed to deploy REDCap to Debian Linux hosts. They may or may not work with non-Debian REDCap hosts and cannot deploy REDCap to Windows hosts. The packaging and deployment tools written using the [Fabric](http://www.fabfile.org/) system. Fabric is written in Python, so both Python 2.7 and Fabric must be installed to do packaging and deployment.
24+
The packaging and deployment tools are designed to deploy REDCap to Debian Linux hosts. They may or may not work with non-Debian REDCap hosts. They cannot deploy REDCap to Windows hosts. The packaging and deployment tools are written using the [Fabric](http://www.fabfile.org/) system. Fabric is written in Python, so both Python 2.7 and Fabric must be installed to do packaging and deployment.
2525

2626

2727
## Installing dependencies
@@ -41,8 +41,8 @@ On a Mac OSX machine:
4141
On Mac OSX users using [Homebrew](http://brew.sh/) can install these packages
4242
using the _brew_ command. Run these commands at a shell:
4343

44-
brew install virtualbox
45-
brew install vagrant
44+
brew cask install virtualbox
45+
brew cask install vagrant
4646

4747

4848
### Install Vagrant plugins
@@ -52,7 +52,7 @@ Vagrant will need a few plugins for this VM. On any platform, run these commands
5252
vagrant plugin install vagrant-hostsupdater
5353
vagrant plugin install vagrant-env
5454

55-
Mac OSX users might enjoy the functionality of the vagrant-triggers plugin. CTS-IT used it to open the Chrome browser to the just -deployed REDCap instance. Run this command at a shell to install it.
55+
Mac OSX users might enjoy the functionality of the vagrant-triggers plugin. CTS-IT uses it to open the Chrome browser to the root of the web site. Run this command at a shell to install it.
5656

5757
vagrant plugin install vagrant-triggers
5858

@@ -61,9 +61,7 @@ For more details about Vagrant software you can go to [why-vagrant](https://docs
6161

6262
### Get your REDCap zip file
6363

64-
You must provide a copy of the REDCap software from https://projectredcap.org/. Save the .zip file with its default name to the root of this repository. This ensures the packaging and provisioning scripts can locate the REDCap code when needed.
65-
66-
If you put multiple redcap\*.zip files in the root folder, the provisioning script will default to using the one with the highest version number.
64+
You must provide a copy of the REDCap software from <https://projectredcap.org/>. Save the .zip file with its default name to the root of this repository. This ensures the packaging and provisioning scripts can locate the REDCap code when needed.
6765

6866

6967
## Configure the Virtual Machine
@@ -81,17 +79,48 @@ With the above requirements and configuration completed, start the VM with the c
8179

8280
vagrant up
8381

84-
After about two minutes, the VM should be accessible at the value you set for _URL\_OF\_DEPLOYED\_APP_ is set to in _.env_ By default this is [http://redcap.dev/redcap/](http://redcap.dev/redcap/)
82+
The vagrant-hostsupdater plugin will make modifications to your hosts file as the VM starts. If it prompts you for a password, provide the password you use to login to your computer.
83+
84+
After about two minutes, the VM should be accessible at the value of the variable _URL\_OF\_DEPLOYED\_APP_ set in _.env_ By default this is [http://redcap.dev/redcap/](http://redcap.dev/redcap/)
8585

8686

8787
## (Re)deploying REDCap with Fabric Tools
8888

89-
In addition to the REDCap deployed by the Vagrant provisioning scripts, this repository includes a suite of deployment and upgrade tools that can configure a host for deployment, package REDCap with numerous extensions, deploy a new REDCap instance and upgrade an existing one. You can use these commands any host where you have sufficient privileges or against this vagrant-deployed VM. If you had a REDCap zip file, say redcap7.2.2.zip, you could deploy it to the local Vagrant REDCap instance with these commands:
89+
In addition to the REDCap deployed by the Vagrant provisioning scripts, this repository includes a suite of deployment and upgrade tools that can configure a host for deployment, package REDCap with numerous extensions, deploy a new REDCap instance and upgrade an existing one. You can use these commands any host where you have sufficient privileges or against this vagrant-deployed VM.
90+
91+
### Fabric Prerequisites
92+
93+
The Fabric tools require a few python libraries that might not be installed on your computer. To install them run these commands:
94+
95+
pip install fabric
96+
pip install configparser
97+
pip install pycurl
98+
pip install cryptography
99+
100+
If you have problems install or using these libraries, you might be well-served to setup a Python _virtual environment_. For more information on that see [Virtual Environment Notes](docs/virtual_env_notes.md)
101+
102+
103+
### Configure Fabric for the Virtual Machine
90104

91-
fab vagrant setup_server
105+
The Fabric tools need to be configured for the Vagrant VM before they can be used.
106+
Copy the file settings/example.vagrant.ini to the name settings/vagrant.ini customize it to your needs.
107+
108+
cp settings/example.vagrant.ini settings/vagrant.ini
109+
110+
Customization is not _required_ but it is useful to add patches and language modules.
111+
112+
113+
### REDCap Deployment
114+
115+
If you have a REDCap zip file, say redcap7.2.2.zip, you can deploy it to the local Vagrant REDCap instance with these commands:
116+
117+
fab vagrant server_setup
92118
fab vagrant package:redcap7.2.2.zip
93119
fab vagrant delete_all_tables deploy:redcap-7.2.2.tgz
94120

121+
122+
### REDCap upgrade
123+
95124
Any upgrade to 7.3.0 would be as simple as
96125

97126
fab vagrant package:redcap7.3.0_upgrade.zip

aliases

Lines changed: 0 additions & 31 deletions
This file was deleted.

bootstrap.sh

Lines changed: 4 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,8 @@ echo "Import environment variables from /vagrant/.env"
2626
# Indicate where the vagrant folder is mounted in the guest file system
2727
SHARED_FOLDER=/vagrant
2828

29-
# Use the latest redcap*.zip file in $SHARED_FOLDER
30-
REDCAP_ZIP=`ls $SHARED_FOLDER/redcap*.zip | grep "redcap[0-9]\{1,2\}\.[0-9]\{1,2\}\.[0-9]\{1,2\}\.zip" | sort -n | tail -n 1`
31-
3229
# import helper functions
3330
. $SHARED_FOLDER/bootstrap_functions.sh
34-
. $SHARED_FOLDER/redcap_deployment_functions.sh
3531

3632
# Pick a fast mirror...or at least one that works
3733
log "Picking a fast mirror in the US..."
@@ -61,39 +57,14 @@ if [ -L /var/www/redcap ]; then
6157
rm /var/www/redcap
6258
fi
6359

64-
# extract a standard REDCap zip file as downloaded from Vanderbilt.
65-
unzip -o -q $REDCAP_ZIP -d /var/www/
66-
67-
# adjust ownership so apache can write to the temp folders
68-
chown -R www-data.root $PATH_TO_APP_IN_GUEST_FILESYSTEM/edocs/
69-
chown -R www-data.root $PATH_TO_APP_IN_GUEST_FILESYSTEM/temp/
60+
mkdir /var/www/redcap
61+
cp /vagrant/files/prompt_to_install.html /var/www/redcap/index.html
7062

71-
REDCAP_VERSION_DETECTED=`ls $PATH_TO_APP_IN_GUEST_FILESYSTEM | grep redcap_v | cut -d 'v' -f2 | sort -n | tail -n 1`
72-
log "$REDCAP_ZIP content indicates REDCap version: $REDCAP_VERSION_DETECTED"
73-
74-
# create the empty databases and update the cake configuration
63+
# create the empty databases
7564
create_database $DB $DB_APP_USER $DB_APP_PASSWORD $DB_HOST $DB_ROOT_PASS
7665

77-
# Configure REDCap to use this database
78-
update_redcap_connection_settings $PATH_TO_APP_IN_GUEST_FILESYSTEM $DB $DB_APP_USER $DB_APP_PASSWORD $DB_HOST $SALT
79-
8066
# make a config file for the mysql clients
8167
write_dot_mysql_dot_cnf $DB $DB_APP_USER $DB_APP_PASSWORD $DB_ROOT_PASS
8268

83-
create_redcap_tables $DB $DB_APP_USER $DB_APP_PASSWORD $PATH_TO_APP_IN_GUEST_FILESYSTEM $REDCAP_VERSION_DETECTED
84-
85-
configure_redcap
86-
configure_php_for_redcap
87-
configure_redcap_cron
88-
move_edocs_folder
89-
set_hook_functions_file
90-
make_twilio_features_visible
69+
# configure the mail server
9170
configure_exim4
92-
check_redcap_status
93-
94-
# deploy extensions with developer settings
95-
96-
export PATH_TO_APP_IN_GUEST_FILESYSTEM
97-
98-
/vagrant/deploy_hooks.sh
99-
/vagrant/deploy_plugins.sh

bootstrap_functions.sh

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,7 @@ function install_utils() {
2525
apt-get install -y git vim ack-grep unzip \
2626
tree colordiff libxml2-utils xmlstarlet nmap
2727

28-
cp /vagrant/dot_files/bash_aliases /home/vagrant/.bash_aliases
29-
cp /vagrant/dot_files/bashrc /home/vagrant/.bashrc
30-
cp /vagrant/dot_files/vimrc /home/vagrant/.vimrc
3128
chown -R vagrant.vagrant /home/vagrant
32-
33-
cp /vagrant/dot_files/bash_aliases /root/.bash_aliases
34-
cp /vagrant/dot_files/bashrc /root/.bashrc
35-
cp /vagrant/dot_files/vimrc /root/.vimrc
3629
}
3730

3831
function install_prereqs() {
@@ -96,7 +89,7 @@ END
9689

9790
log "Link config files for apache port 443"
9891
find /etc/apache2/sites-* | xargs -i ls -l {}
99-
cp /vagrant/apache-ssl.conf /etc/apache2/sites-available/default-ssl.conf
92+
cp /vagrant/files/apache-ssl.conf /etc/apache2/sites-available/default-ssl.conf
10093
ln -sfv /etc/apache2/sites-available/default-ssl.conf /etc/apache2/sites-enabled/apache-ssl.conf
10194

10295
log "Link config files for apache port 80"
@@ -106,7 +99,7 @@ END
10699
OLD_APACHE_DEFAULT=/etc/apache2/sites-available/000-default.conf
107100
if [ -e $OLD_APACHE_DEFAULT ]; then rm $OLD_APACHE_DEFAULT; fi
108101

109-
cp /vagrant/apache-default.conf /etc/apache2/sites-available/000-default.conf
102+
cp /vagrant/files/apache-default.conf /etc/apache2/sites-available/000-default.conf
110103
ln -sfv /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-enabled/000-default.conf
111104

112105
log "Enable apache modules"
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
set -e
3+
4+
export MYTARGETDIR=$1
5+
6+
# determine the directory where this script resides
7+
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
8+
9+
# get source files
10+
TEMPDIR=`mktemp -d`
11+
git clone ssh://[email protected]/form_render_skip_logic.git $TEMPDIR
12+
13+
# If you need to checkout code from another branch, uncomment and adjust this line
14+
# git --git-dir=$TEMPDIR/.git --work-tree=$TEMPDIR checkout develop
15+
16+
# copy files to the correct target locations
17+
mkdir -p $MYTARGETDIR
18+
cp $TEMPDIR/frsl_data_collection_instruments.php $MYTARGETDIR
19+
cp $TEMPDIR/frsl_record_home_page.php $MYTARGETDIR
20+
cp $TEMPDIR/frsl_dashboard.php $MYTARGETDIR
21+
22+
rm -rf $TEMPDIR

deploy_hooks.sh

Lines changed: 0 additions & 45 deletions
This file was deleted.

0 commit comments

Comments
 (0)