Skip to content

Commit

Permalink
minor script cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
marius311 committed Aug 2, 2018
1 parent 92f7d92 commit af3e59e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion images/makeproject/Dockerfile
Expand Up @@ -86,7 +86,8 @@ FROM base$TAG AS makeproject
# everything which depends on build-args is done as ONBUILD in this stage, so # everything which depends on build-args is done as ONBUILD in this stage, so
# the user can customize it # the user can customize it


ONBUILD ARG TAG ARG TAG
ENV TAG=$TAG
ONBUILD ARG BOINC_USER ONBUILD ARG BOINC_USER
ONBUILD ARG PROJECT_ROOT ONBUILD ARG PROJECT_ROOT
ONBUILD ENV BOINC_USER=$BOINC_USER \ ONBUILD ENV BOINC_USER=$BOINC_USER \
Expand Down
6 changes: 4 additions & 2 deletions images/makeproject/makeproject-step2.sh
Expand Up @@ -5,12 +5,14 @@ set -e
source /run/secrets/secrets.env source /run/secrets/secrets.env


PROJECT_ROOT_DEST=$PROJECT_ROOT.dst PROJECT_ROOT_DEST=$PROJECT_ROOT.dst
cd $PROJECT_ROOT


echo "Updating project files in data volume..." echo "Updating project files in data volume..."
cd $PROJECT_ROOT
# do variable substitution in files # do variable substitution in files
for file in config.xml html/user/schedulers.txt *.httpd.conf html/project/project.inc; do for file in config.xml html/user/schedulers.txt *.httpd.conf html/project/project.inc; do
sed -i -e "s|\${PROJECT}|$PROJECT|gI" \ sed -i -e "s|\${PROJECT}|$PROJECT|gI" \
-e "s|REPLACE WITH PROJECT NAME|$PROJECT|gI" \
-e "s|\${PROJECT_ROOT}|$PROJECT_ROOT|gI" \ -e "s|\${PROJECT_ROOT}|$PROJECT_ROOT|gI" \
-e "s|\${URL_BASE}|$URL_BASE|gI" \ -e "s|\${URL_BASE}|$URL_BASE|gI" \
-e "s|\${DB_PASSWD}|$DB_PASSWD|gI" \ -e "s|\${DB_PASSWD}|$DB_PASSWD|gI" \
Expand Down Expand Up @@ -44,7 +46,7 @@ fi
# if we can get in the root MySQL account without password, it means this is the # if we can get in the root MySQL account without password, it means this is the
# first run after project creation, in which case set the password, and create # first run after project creation, in which case set the password, and create
# the project database # the project database
if mysql -u root -e ""; then if mysql -u root -e "" &> /dev/null ; then
echo "Creating database..." echo "Creating database..."
mysqladmin -h mysql -u root password $DB_PASSWD mysqladmin -h mysql -u root password $DB_PASSWD
PYTHONPATH=/usr/local/boinc/py python -c """if 1: PYTHONPATH=/usr/local/boinc/py python -c """if 1:
Expand Down

0 comments on commit af3e59e

Please sign in to comment.