Skip to content

Commit

Permalink
Add docker-compose file to the drive (getumbrel#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
nolim1t authored Jul 27, 2020
1 parent f262b04 commit 7327d3b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions contrib/partitioner/partitioner.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ def main():
os.system('/bin/cp -fr ' + homedirpath + '/lnd /mnt/data')
os.system('/bin/cp -fr ' + homedirpath + '/tor /mnt/data')
os.system('/bin/cp -fr ' + homedirpath + '/nginx /mnt/data')
os.system('/bin/cp -fr ' + homedirpath + '/docker-compose.yml /mnt/data')

if not os.path.exists('/mnt/data/swap'):
print('Add swap to partition')
Expand Down Expand Up @@ -231,6 +232,11 @@ def main():
if not os.path.exists('/mnt/data/nginx'):
print('nginx folder does\'nt exist!')
os.system('/bin/cp -fr ' + homedirpath + '/nginx /mnt/data')

# Check for existing docker.compose
if not os.path.exists('/mnt/data/docker-compose.yml'):
print('docker-compose.yml doesn\'t exist on the drive, creating from the generated install');
os.system('/bin/cp -fr ' + homedirpath + '/docker-compose.yml /mnt/data')


print('Unmounting partition')
Expand Down Expand Up @@ -267,13 +273,15 @@ def main():
os.system('/bin/rm -fr ' + homedirpath + '/lnd')
os.system('/bin/rm -fr ' + homedirpath + '/tor')
os.system('/bin/rm -fr ' + homedirpath + '/nginx')
os.system('/bin/rm -fr ' + homedirpath + '/docker-compose.yml')
print('Set up symlinks')
os.system('/bin/ln -s /mnt/data/secrets ' + homedirpath + '/secrets')
os.system('/bin/ln -s /mnt/data/db ' + homedirpath + '/db')
os.system('/bin/ln -s /mnt/data/bitcoin ' + homedirpath + '/bitcoin')
os.system('/bin/ln -s /mnt/data/lnd ' + homedirpath + '/lnd')
os.system('/bin/ln -s /mnt/data/tor ' + homedirpath + '/tor')
os.system('/bin/ln -s /mnt/data/nginx ' + homedirpath + '/nginx')
os.system('/bin/ln -s /mnt/data/docker-compose.yml ' + homedirpath + '/docker-compose.yml')

'''
Actual entrypoint
Expand Down

0 comments on commit 7327d3b

Please sign in to comment.