diff --git a/images/makeproject/Dockerfile b/images/makeproject/Dockerfile index b80aad5..d3a34c7 100644 --- a/images/makeproject/Dockerfile +++ b/images/makeproject/Dockerfile @@ -86,7 +86,8 @@ FROM base$TAG AS makeproject # everything which depends on build-args is done as ONBUILD in this stage, so # the user can customize it -ONBUILD ARG TAG +ARG TAG +ENV TAG=$TAG ONBUILD ARG BOINC_USER ONBUILD ARG PROJECT_ROOT ONBUILD ENV BOINC_USER=$BOINC_USER \ diff --git a/images/makeproject/makeproject-step2.sh b/images/makeproject/makeproject-step2.sh index 2319280..761cf3c 100755 --- a/images/makeproject/makeproject-step2.sh +++ b/images/makeproject/makeproject-step2.sh @@ -5,12 +5,14 @@ set -e source /run/secrets/secrets.env PROJECT_ROOT_DEST=$PROJECT_ROOT.dst +cd $PROJECT_ROOT echo "Updating project files in data volume..." -cd $PROJECT_ROOT + # do variable substitution in files for file in config.xml html/user/schedulers.txt *.httpd.conf html/project/project.inc; do sed -i -e "s|\${PROJECT}|$PROJECT|gI" \ + -e "s|REPLACE WITH PROJECT NAME|$PROJECT|gI" \ -e "s|\${PROJECT_ROOT}|$PROJECT_ROOT|gI" \ -e "s|\${URL_BASE}|$URL_BASE|gI" \ -e "s|\${DB_PASSWD}|$DB_PASSWD|gI" \ @@ -44,7 +46,7 @@ fi # 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 # the project database -if mysql -u root -e ""; then +if mysql -u root -e "" &> /dev/null ; then echo "Creating database..." mysqladmin -h mysql -u root password $DB_PASSWD PYTHONPATH=/usr/local/boinc/py python -c """if 1: