-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Updates embargo scripts. * Use ENVIRONMENT variable in embargo scripts. --------- Co-authored-by: Thomas Scherz <[email protected]>
- Loading branch information
Showing
2 changed files
with
52 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/sh | ||
|
||
# Notify editors that a work has been released | ||
# script/embargo_notify.sh [production|development] | ||
|
||
ENVIRONMENT=$1 | ||
|
||
APP_DIRECTORY="$(dirname "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" )" | ||
|
||
|
||
if [ $# -eq 0 ]; then | ||
echo -e "ERROR: no environment argument [production|development] provided" | ||
exit 1 | ||
fi | ||
|
||
if [ $ENVIRONMENT != "production" ] && [ $ENVIRONMENT != "development" ]; then | ||
echo -e "ERROR: environment argument must be either [production|development] most likely this will be development for local machines and production otherwise" | ||
exit 1 | ||
fi | ||
|
||
if [[ $ENVIRONMENT == "production" ]]; then | ||
export PATH=$PATH:/srv/apps/.gem/ruby/2.7.0/bin | ||
fi | ||
|
||
banner "Notify Embargoe Editors" | ||
|
||
cd $APP_DIRECTORY | ||
|
||
RAILS_ENV=$ENVIRONMENT bundle exec rake embargo_notify |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,27 @@ | ||
#!/bin/bash | ||
#!/bin/sh | ||
|
||
# Change and expired embargoed objects to open access | ||
# Runs as a cron job daily just after midnight | ||
# script/release_embargo.sh [production|development] | ||
|
||
cd "$(dirname "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" )" | ||
export RELEASE_DATE=`date -v +1d "+%Y-\%m-\%d"` | ||
bundle exec rake embargo_release["$RELEASE_DATE"] | ||
ENVIRONMENT=$1 | ||
|
||
APP_DIRECTORY="$(dirname "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" )" | ||
|
||
if [ $# -eq 0 ]; then | ||
echo -e "ERROR: no environment argument [production|development] provided" | ||
exit 1 | ||
fi | ||
|
||
if [ $ENVIRONMENT != "production" ] && [ $ENVIRONMENT != "development" ]; then | ||
echo -e "ERROR: environment argument must be either [production|development] most likely this will be development for local machines and production otherwise" | ||
exit 1 | ||
fi | ||
|
||
if [[ $ENVIRONMENT == "production" ]]; then | ||
export PATH=$PATH:/srv/apps/.gem/ruby/2.7.0/bin | ||
fi | ||
|
||
cd $APP_DIRECTORY | ||
export RELEASE_DATE=`date +\%Y-\%m-\%d -d "+1 day"` | ||
RAILS_ENV=$ENVIRONMENT bundle exec rake embargo_release["$RELEASE_DATE"] |