Skip to content
Snippets Groups Projects
Commit 1ce513bc authored by Iain Bryson's avatar Iain Bryson
Browse files

Reorganize the filesystem.

parent c6de65c5
Branches feature/folder-reorg
No related tags found
No related merge requests found
gen/
src/
tmp/
vol/
#!/bin/bash
set -a
DTU_ENOTE_ROOT=`pwd`
DTU_ENOTE_SRC=$DTU_ENOTE_ROOT/src
DTU_ENOTE_VOL=$DTU_ENOTE_ROOT/vol
DTU_ENOTE_GEN=$DTU_ENOTE_ROOT/gen
branch=$(git symbolic-ref --short HEAD)
if [ -n "$1" ]; then
branch=$1
fi
echo "Setting environment for dtu-enote for branch ${branch}"
cd src/dtu-enote
source ./setup_env.sh
...@@ -13,14 +13,19 @@ function pull_or_clone { ...@@ -13,14 +13,19 @@ function pull_or_clone {
git clone -b $3 https://github.com/dtu-compute/$1 $2 git clone -b $3 https://github.com/dtu-compute/$1 $2
fi fi
} }
DTU_ENOTE_ROOT=`pwd`
DTU_ENOTE_SRC=$DTU_ENOTE_ROOT/src
DTU_ENOTE_VOL=$DTU_ENOTE_ROOT/vol
DTU_ENOTE_GEN=$DTU_ENOTE_ROOT/gen
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
if ! grep -q "CentOS Linux release 7" /etc/redhat-release; then if ! grep -q "CentOS Linux release 7" /etc/redhat-release; then
echo "CentOS 7 is required. Exiting..." echo "CentOS 7 is required. Exiting..."
exit 1 exit 1
fi fi
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
if ! [[ -d /vol ]]; then if ! [[ -d $DTU_ENOTE_VOL ]]; then
echo "For the 2016 version the existance of /vol from the staging host is required." echo "For the 2018+ version the existance of $DTU_ENOTE_VOL from the staging host is required."
echo "Exiting..." echo "Exiting..."
exit 1 exit 1
fi fi
...@@ -126,33 +131,23 @@ git clone -b $branch https://github.com/dtu-compute/dtu-enote ...@@ -126,33 +131,23 @@ git clone -b $branch https://github.com/dtu-compute/dtu-enote
cd dtu-enote cd dtu-enote
pushd components pushd components
pull_or_clone dtu-enote-askbot askbot $branch pull_or_clone dtu-enote-cndumper dtu-enote-cndumper $branch
pull_or_clone dtu-enote-cndumper cndumper $branch
pull_or_clone dtu-enote-core dtu-core $branch pull_or_clone dtu-enote-core dtu-core $branch
pull_or_clone dtu-enote-getpdf get-pdf $branch pull_or_clone dtu-enote-getpdf dtu-enote-getpdf $branch
pull_or_clone dtu-enote-letsencrypt letsencrypt $branch pull_or_clone dtu-enote-mongodb sharelatex-db $branch/sharelatex-db
pull_or_clone dtu-enote-mongodb mongodb $branch pull_or_clone dtu-enote-mongodb quiz-db $branch/quiz-db
pull_or_clone dtu-enote-sharelatex sharelatex $branch pull_or_clone dtu-enote-sharelatex dtu-enote-sharelatex $branch
pull_or_clone dtu-enote-website course-website $branch pull_or_clone dtu-enote-website dtu-enote-website $branch
pull_or_clone dtu-quiz dtu-quiz $branch pull_or_clone dtu-quiz dtu-quiz $branch
pull_or_clone dtu-quiz-nginx dtu-quiz-nginx $branch
popd popd
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
mkdir -p /vol/log/couchdb
chmod -R 777 /vol/log
#-------------------------------------------------------------------------------
docker build components/cndumper -t cndumper docker build components/cndumper -t cndumper
/docker/dtu-enote/run-campus-dumper.sh >> /vol/log/campus-dumper-cron.log 2>&1 /docker/dtu-enote/run-campus-dumper.sh >> /vol/log/campus-dumper-cron.log 2>&1
insert_cron '45 23 * * * /docker/dtu-enote/run-campus-dumper.sh >> /vol/log/campus-dumper-cron.log 2>&1' insert_cron '45 23 * * * /docker/dtu-enote/run-campus-dumper.sh >> /vol/log/campus-dumper-cron.log 2>&1'
insert_cron '45 23 * * * /docker/dtu-enote/run-cert-renewal.sh >> /vol/log/cert-renewal-cron.log 2>&1'
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
docker network create revproxynet docker network create revproxynet
docker-compose -f docker-compose-letsencrypt-request.yml build
docker-compose -f docker-compose-letsencrypt-request.yml up -d
./make-certs.sh $url_suffix
docker-compose -f docker-compose-letsencrypt-request.yml stop
#-------------------------------------------------------------------------------
openssl dhparam -out /vol/certs/couchdb${url_suffix}/dhparams.pem 1024
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
pushd ./src/dtu-enote
bundle install
./sync-all.sh ./sync-all.sh
./run.sh bundle exec rake deploy:all
FROM redis
COPY redis.conf /usr/local/etc/redis/redis.conf
CMD [ "redis-server", "/usr/local/etc/redis/redis.conf" ]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment