Refactors directory structure
This commit is contained in:
parent
d8c82736ad
commit
4beb94f5ec
8 changed files with 25 additions and 20 deletions
Binary file not shown.
|
@ -1,6 +0,0 @@
|
|||
#!/bin/bash -eux
|
||||
|
||||
if [ ! -d "/data/domains/$DOMAIN/mysql/data" ]; then
|
||||
mkdir -p /data/domains/$DOMAIN/mysql/data
|
||||
echo MYSQL_PASS=`echo $RANDOM ${date} | md5sum | base64 | cut -c-10` > /data/domains/$DOMAIN/mysql/.env
|
||||
fi
|
|
@ -1,8 +0,0 @@
|
|||
#!/bin/bash -eux
|
||||
|
||||
if [ ! -d "/data/domains/$DOMAIN/wordpress/data" ]; then
|
||||
cd /data/domains/$DOMAIN/
|
||||
tar xvzf /data/indiehosters/blueprints/wordpress.tgz
|
||||
fi
|
||||
|
||||
cat /data/domains/$DOMAIN/mysql/.env | sed s/MYSQL_PASS/DB_PASS/ > /data/domains/$DOMAIN/wordpress/.env
|
|
@ -10,8 +10,14 @@ BindsTo=mysql@%i.service
|
|||
[Service]
|
||||
Type=oneshot
|
||||
RemainAfterExit=yes
|
||||
Environment=DOMAIN=%i
|
||||
ExecStart=/data/indiehosters/importers/mysql.sh
|
||||
ExecStart=/bin/bash -euxc ' \
|
||||
folder=/data/domains/%i/mysql; \
|
||||
if [ ! -d $folder ]; then \
|
||||
mkdir -p $folder; \
|
||||
pass=`echo $RANDOM ${date} | md5sum | base64 | cut -c-10`; \
|
||||
echo MYSQL_PASS=$pass > $folder/.env; \
|
||||
fi; \
|
||||
mkdir -p /data/runtime/domains/%i/mysql/db_files'
|
||||
|
||||
[Install]
|
||||
WantedBy=mysql@%i.service
|
||||
|
|
|
@ -15,7 +15,7 @@ ExecStartPre=-/usr/bin/docker kill %p-%i
|
|||
ExecStartPre=-/usr/bin/docker rm %p-%i
|
||||
ExecStart=/usr/bin/docker run \
|
||||
--name %p-%i \
|
||||
-v /data/domains/%i/%p/data:/var/lib/mysql \
|
||||
-v /data/runtime/domains/%i/%p/db_files:/var/lib/mysql \
|
||||
--env-file /data/domains/%i/%p/.env \
|
||||
indiehosters/mysql
|
||||
ExecReload=/usr/bin/docker restart %p-%i
|
||||
|
|
|
@ -8,11 +8,13 @@ Before=static-git@%i.service
|
|||
Type=oneshot
|
||||
RemainAfterExit=yes
|
||||
ExecStart=/bin/bash -euxc ' \
|
||||
domain_folder=/data/domains/%i; \
|
||||
cp $domain_folder/TLS/%i.pem /data/runtime/haproxy/approved-certs/%i.pem; \
|
||||
runtime_folder=/data/runtime/domains/%i/static-git; \
|
||||
mkdir -p $runtime_folder; \
|
||||
git_folder=$runtime_folder/www-content; \
|
||||
if [ ! -d $git_folder/.git ]; then \
|
||||
git clone `cat /data/domains/%i/static-git/GITURL` $git_folder; \
|
||||
git clone `cat $domain_folder/static-git/GITURL` $git_folder; \
|
||||
fi;'
|
||||
|
||||
[Install]
|
||||
|
|
|
@ -8,7 +8,9 @@ Before=static@%i.service
|
|||
Type=oneshot
|
||||
RemainAfterExit=yes
|
||||
ExecStart=/bin/bash -euxc ' \
|
||||
folder=/data/domains/%i/static/www-content; \
|
||||
domain_folder=/data/domains/%i; \
|
||||
cp $domain_folder/TLS/%i.pem /data/runtime/haproxy/approved-certs/%i.pem; \
|
||||
folder=$domain_folder/static/www-content; \
|
||||
mkdir -p $folder; \
|
||||
if [ ! -f $folder/index.html ]; then \
|
||||
echo Hello %i > $folder/index.html; \
|
||||
|
|
|
@ -12,7 +12,16 @@ BindsTo=wordpress@%i.service
|
|||
Type=oneshot
|
||||
RemainAfterExit=yes
|
||||
Environment=DOMAIN=%i
|
||||
ExecStart=/data/indiehosters/importers/wordpress.sh
|
||||
ExecStart=/bin/bash -euxc ' \
|
||||
domain_folder=/data/domains/%i; \
|
||||
cp $domain_folder/TLS/%i.pem /data/runtime/haproxy/approved-certs/%i.pem; \
|
||||
if [ ! -d $domain_folder/wordpress/wp-content ]; then \
|
||||
mkdir -p $domain_folder/wordpress/; \
|
||||
cd $domain_folder/wordpress/; \
|
||||
tar xvzf /data/indiehosters/blueprints/wordpress.tgz; \
|
||||
fi; \
|
||||
cat $domain_folder/mysql/.env | sed s/MYSQL_PASS/DB_PASS/ > $domain_folder/wordpress/.env'
|
||||
|
||||
|
||||
[Install]
|
||||
WantedBy=wordpress@%i.service
|
||||
|
|
Loading…
Reference in a new issue