Skip to content

Commit 98c7082

Browse files
committed
Merge branch 'release/1.1.0'
2 parents 0982d43 + ba28ae1 commit 98c7082

File tree

6 files changed

+40
-19
lines changed

6 files changed

+40
-19
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
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.1.0] - 2017-05-31
6+
### Added
7+
- Add documentation for language configuration (marlycormar)
8+
- Modify deploy_language_to_build_space function to allow either a list or a folder as a language configuration (marlycormar)
9+
10+
### Changed
11+
- Don't load any database upgrade scripts with a version number higher than the version you are upgrading to (Philip Chase)
512

613
## [1.0.2] - 2017-05-25
714
### Added

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,9 @@ If you have problems install or using these libraries, you might be well-served
105105
### Configure Fabric for the Virtual Machine
106106

107107
The Fabric tools need to be configured for the Vagrant VM before they can be used.
108-
Copy the file settings/example.vagrant.ini to the name settings/vagrant.ini customize it to your needs.
108+
Copy the file settings/vagrant.ini.example to the name settings/vagrant.ini customize it to your needs.
109109

110-
cp settings/example.vagrant.ini settings/vagrant.ini
110+
cp settings/vagrant.ini.example settings/vagrant.ini
111111

112112
Customization is not _required_ but it is useful to add patches and language modules.
113113

@@ -132,6 +132,12 @@ If the tests fail and the server is offline, you can put it back online with
132132

133133
fab vagrant online
134134

135+
## Language Configuration
136+
137+
REDCap languages can be provided by modifying the _languages_ variable accordingly:
138+
as a json list, e.g., languages = ["Chinese.6.4.3.ini", "German.ini"], or
139+
as a file, i.e., languages = <languageFolder>, in which case the language files *.ini must be located inside the specified folder
140+
135141

136142
## Contributions
137143

package.py

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -128,14 +128,21 @@ def deploy_extension_to_build_space(source_dir="", build_target=""):
128128

129129

130130
def deploy_language_to_build_space():
131-
target_dir = env.builddir + "/redcap/languages/"
132-
for language in json.loads(env.languages):
133-
if os.path.exists(language):
134-
local("mkdir -p %s" % target_dir)
135-
local('cp %s %s' % (language, target_dir))
136-
else:
137-
abort("the language file %s does not exist" % language)
138-
131+
source_dir = env.languages
132+
target_dir = env.builddir + "/redcap/languages"
133+
134+
if re.match(r'^\[.+\]$', source_dir) is not None:
135+
for language in json.loads(env.languages):
136+
if os.path.exists(language):
137+
local("mkdir -p %s" % target_dir)
138+
local('cp %s %s' % (language, target_dir))
139+
else:
140+
abort("the language file %s does not exist" % language)
141+
elif local('find %s/*.ini -maxdepth 1 -type f | wc -l' % source_dir, capture = True) != '0':
142+
if os.path.exists(source_dir) and os.path.exists(target_dir):
143+
local('find %s/*.ini -maxdepth 1 -type f -exec rsync {} %s \;' %(source_dir, target_dir))
144+
else:
145+
print("Warning: The languages where not provided. English will be used by default.")
139146

140147
def apply_patches():
141148
for repo in json.loads(env.patch_repos):

settings/vagrant.ini.example

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ deploy_redcap_cron = True
5151
# Each repo needs files BASH script named deploy.sh at the root that will install the patch into a unzipped REDCap installation
5252
patch_repos = [ ]
5353

54-
55-
# List REDCap language file names as quoted strings. Separate multiple language files with commas. e.g.
56-
# languages = [ "Chinese.6.4.3.ini", "German.ini" ]
57-
languages = [ ]
54+
# REDCap languages can be provided by modifying the 'languages' variable accordingly:
55+
# as a json list, e.g., languages = ["Chinese.6.4.3.ini", "German.ini"], or
56+
# as a file, i.e., languages = <language_folder>, in which case the language files *.ini must be located inside the specified folder
57+
languages = languages

settings/vagrant.ini.uf.example

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ deploy_redcap_cron = True
5151
# Each repo needs files BASH script named deploy.sh at the root that will install the patch into a unzipped REDCap installation
5252
patch_repos = [ "[email protected]:redcap_security_settings.git" ]
5353

54-
55-
# List REDCap language file names as quoted strings. Separate multiple language files with commas. e.g.
56-
# languages = [ "Chinese.6.4.3.ini", "German.ini" ]
57-
languages = [ "Chinese.6.4.3.ini" ]
54+
# REDCap languages can be provided by modifying the 'languages' variable accordingly:
55+
# as a json list, e.g., languages = ["Chinese.6.4.3.ini", "German.ini"], or
56+
# as a file, i.e., languages = <language_folder>, in which case the language files *.ini must be located inside the specified folder
57+
languages = languages

upgrade.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ def apply_incremental_db_changes(old, new):
5454
files in sequence. The arguments old and new must be version numbers (i.e., 6.11.5)
5555
"""
5656
old = utility.convert_version_to_int(old)
57+
new_as_an_int = utility.convert_version_to_int(new)
5758
redcap_sql_dir = '/'.join([env.live_pre_path, env.project_path, 'redcap_v' + new, 'Resources/sql'])
5859
with settings(user=env.deploy_user):
5960
with hide('output'):
@@ -63,7 +64,7 @@ def apply_incremental_db_changes(old, new):
6364
match = re.search(r"(upgrade_)(\d+.\d+.\d+)(.)(php|sql)", file)
6465
version = match.group(2)
6566
version = utility.convert_version_to_int(version)
66-
if version > old:
67+
if version > old and version <= new_as_an_int:
6768
if fnmatch.fnmatch(file, "*.php"):
6869
print (file + " is a php file!\n")
6970
with settings(user=env.deploy_user):

0 commit comments

Comments
 (0)