Break up build steps into seperate directories
This commit is contained in:
parent
ff81c79f35
commit
caf5578516
9 changed files with 45 additions and 109 deletions
|
@ -1,31 +0,0 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
import time
|
||||
from scripts.install_dotfiles import *
|
||||
|
||||
EXEC_ORDER = [
|
||||
update,
|
||||
apt_upgrade,
|
||||
apt_install_core,
|
||||
add_apt_keys,
|
||||
add_apt_sources,
|
||||
add_apt_repos,
|
||||
update,
|
||||
run_custom_installs,
|
||||
update,
|
||||
apt_install_extras,
|
||||
source,
|
||||
install_atom_packages,
|
||||
export_atom_config,
|
||||
install_configs
|
||||
]
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
t0 = time.time()
|
||||
for script in EXEC_ORDER:
|
||||
script()
|
||||
print("\n>> {} Exescuted.\n".format(script.__name__))
|
||||
t1 = time.time()
|
||||
print("Execution Complete")
|
||||
print("Took {} seconds.".format(int(t1 - t0)))
|
25
apt/export.py
Normal file
25
apt/export.py
Normal file
|
@ -0,0 +1,25 @@
|
|||
#!/usr/bin/env python3
|
||||
import json, os
|
||||
|
||||
os.system('sudo apt-get update -y')
|
||||
os.system('sudo apt-get upgrade -y')
|
||||
os.system('sudo apt-get dist-upgrade -y')
|
||||
|
||||
|
||||
packages = " ".join(json.load(open('apt-installs-core.json')))
|
||||
os.system("sudo apt-get install {} -y".format(packages))
|
||||
|
||||
for key in json.load(open('apt-keys.json')):
|
||||
os.system("wget -O - {} | sudo apt-key add -".format(key))
|
||||
|
||||
os.system('sudo apt/add-apt-sources.sh')
|
||||
|
||||
for repo in json.load(open('apt-repos.json')):
|
||||
os.system("sudo add-apt-repository {} -y".format(repo))
|
||||
|
||||
os.system('sudo apt-get update -y')
|
||||
|
||||
packages = " ".join(json.load(open('apt-installs-extra.json')))
|
||||
os.system("sudo apt-get install {} -y".format(packages))
|
||||
|
||||
os.system('apt/custom-installs.sh')
|
7
atom/export.sh
Normal file
7
atom/export.sh
Normal file
|
@ -0,0 +1,7 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
mkdir ~/.atom
|
||||
|
||||
cp * ~/.atom
|
5
bash/export.sh
Normal file
5
bash/export.sh
Normal file
|
@ -0,0 +1,5 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
cp .bash_aliases ~/
|
5
config/export.sh
Normal file
5
config/export.sh
Normal file
|
@ -0,0 +1,5 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
cp terminator.conf ~/.config/terminator/config
|
|
@ -1,5 +0,0 @@
|
|||
# Scripts
|
||||
|
||||
Custom Scripts
|
||||
|
||||
Includes `install_dotfiles.py`, which installs this project
|
|
@ -1,72 +0,0 @@
|
|||
#!/usr/bin/env python3
|
||||
import json, os, shutil
|
||||
|
||||
|
||||
DIR = os.getcwd()
|
||||
HOME = os.path.expanduser('~')
|
||||
|
||||
|
||||
def _get_json(path):
|
||||
return json.load(open(DIR + path))
|
||||
|
||||
|
||||
def update():
|
||||
os.system('sudo apt-get update -y')
|
||||
|
||||
|
||||
def apt_upgrade():
|
||||
os.system('sudo apt-get upgrade -y')
|
||||
os.system('sudo apt-get dist-upgrade -y')
|
||||
|
||||
|
||||
def apt_install_core():
|
||||
packages = " ".join(_get_json('/apt/apt-installs-core.json'))
|
||||
os.system("sudo apt-get install {} -y".format(packages))
|
||||
|
||||
|
||||
def add_apt_keys():
|
||||
for key in _get_json('/apt/apt-keys.json'):
|
||||
os.system("wget -O - {} | sudo apt-key add -".format(key))
|
||||
|
||||
|
||||
def add_apt_sources():
|
||||
os.system('sudo apt/add-apt-sources.sh')
|
||||
|
||||
|
||||
def add_apt_repos():
|
||||
for repo in _get_json('/apt/apt-repos.json'):
|
||||
os.system("sudo add-apt-repository {} -y".format(repo))
|
||||
|
||||
|
||||
def apt_install_extras():
|
||||
packages = " ".join(_get_json('/apt/apt-installs-extra.json'))
|
||||
os.system("sudo apt-get install {} -y".format(packages))
|
||||
|
||||
|
||||
def run_custom_installs():
|
||||
os.system('apt/custom-installs.sh')
|
||||
|
||||
|
||||
def install_atom_packages():
|
||||
packages = " ".join(_get_json('/atom/packages.json'))
|
||||
os.system("apm install {}".format(packages))
|
||||
|
||||
|
||||
def export_atom_config():
|
||||
os.makedirs("~/.atom", exist_ok=True)
|
||||
os.system("cp -R atom/* ~/.atom/")
|
||||
|
||||
|
||||
def install_configs():
|
||||
os.makedirs("~/.config/terminator/", exist_ok=True)
|
||||
shutil.copyfile(os.path.join(DIR, "config/terminator.conf"), os.path.expanduser("~/.config/terminator/config"))
|
||||
shutil.copyfile(os.path.join(DIR, "bash/.bash_aliases"), os.path.expanduser("~/.bash_aliases"))
|
||||
|
||||
|
||||
def source():
|
||||
os.system(". ~/.bashrc")
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
print("Please run this file using the install script, not directly.")
|
||||
exit(1)
|
|
@ -14,5 +14,7 @@ jsonlint -q atom/packages.json
|
|||
echo ">> Validating Python..."
|
||||
pip install flake8
|
||||
|
||||
flake8 scripts/install_dotfiles.py --ignore=E128,E501,E401,F403
|
||||
flake8 atom/exports.py --ignore=E128,E501,E401,F403
|
||||
flake8 scripts/installers.py --ignore=E128,E501,E401,F403
|
||||
flake8 yaourt/exports.py --ignore=E128,E501,E401,F403
|
||||
flake8 INSTALL_ALL_THE_THINGS --ignore=E128,E501,E401,F403
|
||||
|
|
Loading…
Reference in a new issue