|
1 | 1 | # ubuntu-setup
|
2 |
| -Quick Debian-family Linux setup |
3 |
| - |
4 |
| -## setup.py |
5 |
| -Tool to quickly put a Debian-family install into a usable, handy state. |
6 |
| - |
7 |
| -## Setup procedure |
8 |
| -1. Execute setup.py |
9 |
| - * Provide as command line arguments the name of each pkg folder that you wish to install |
10 |
| - * ex: ./setup.py default dev |
11 |
| - * This will install all the packages in both pkgs/default and pkgs/dev |
12 |
| - * WARNING!: Don't run this script as root! This will give root permission to every repo you clone |
13 |
| -1. This script may require user input |
14 |
| - * You may have to provide sudo credentials |
15 |
| - * If one of the repos in setup.json is slated to install to an existing directory, then it will prompt you to confirm |
16 |
| - |
17 |
| -## Customize |
18 |
| -* setup.json |
19 |
| - * List of git repos to install |
20 |
| - * Each repo has the following attributes. [] indicates required. |
21 |
| - * [name]: the name of the git repo |
22 |
| - * [repo]: the URL for the git repo |
23 |
| - * [location]: the location on the local machine to clone the repo |
24 |
| - * script: the path to a script (relative to the repo root) that should be executed after the repo is cloned |
25 |
| - * enabled: whether this repo should be installed |
26 |
| - * Notes |
27 |
| - * Any repos listed in setup.json will recursively install all submodules and check out the master branch |
28 |
| - * If any git errors occur, the error will simply print to stdout and the script will skip to the next repo |
29 |
| -* pkgs |
30 |
| - * The pkgs directory is split into folders, each one representing a set of packages that can be installed individually or in combination with other pkg folders |
31 |
| - * Each folder contains the following files: |
32 |
| - * pkgs: List of apt packages to be installed |
33 |
| - * ignore_pkgs: List of apt packages to ignore, even if it appears in pkgs |
34 |
| - * python_pkgs: List of pip3 packages to install |
35 |
| - * Notes |
36 |
| - * The package install list is: set(pkgs) - set(ignore_pkgs) |
37 |
| - * You may use the convenience script below to edit the contents of these files, or you can do it by hand. |
38 |
| -* current_pkg_files |
39 |
| - * writes files installed using apt or apt-get to stdout |
40 |
| -* replace_pkgs.py [-h] [--dry-run] {available folders} |
41 |
| - * Arguments/options: |
42 |
| - * folder: this argument gives the folder that we should update the pkgs file for |
43 |
| - * Must be one of the available folders in the pkgs directory |
44 |
| - * modify the contents of pkgs to reflect exactly the packages installed on your computer |
45 |
| - * --dry-run: This option will print the list of packages to set, rather than write to file |
46 |
| - * Notes |
47 |
| - * If you want to add packages to multiple folders, you have to run this script once for each folder |
48 |
| -* update_pkgs.py [-h] [--dry-run | --new] {available folders} |
49 |
| - * update the contents of pkgs to reflect the union of what was already there and the set of packages returned by current_pkgs_files |
50 |
| - * Arguments/options: |
51 |
| - * folder: this argument gives the folder that we should update the pkgs file for |
52 |
| - * Must be one of the available folders in the pkgs directory |
53 |
| - * --dry-run: print the list of *all* packages that will be set in the folder's pkgs file, rather than write to file |
54 |
| - * --new: print only the currently installed packages that will be *added* to the folder's pkgs file |
55 |
| - * Notes |
56 |
| - * If you want to add packages to multiple folders, you have to run this script once for each folder |
57 |
| -* status.py |
58 |
| - * Gives a nice summary of all installed repos. |
59 |
| - * Prints out filesystem location and clean/dirty status |
60 |
| - * This lets you easily see if there's any local changes you need to resolve (whether by committing, merging, resetting, etc...) |
61 |
| - |
62 |
| -## Typical Workflows |
63 |
| -1. Add from current install |
64 |
| - 1. While using your install, you add a couple packages. |
65 |
| - 1. You decide that some of those pacakges would be nice to add to install when setting up a dev station |
66 |
| - 1. Navigate to ubuntu-settings |
67 |
| - 1. Run `update_packages.py dev --new` to get a list of packages that you have installed locally that are not in the dev folder's pkgs file |
68 |
| - * If you decide to add all the new packages: |
69 |
| - * Run `update_packages.py dev --dry-run` to see the final list of packages that will be written to the dev folder's pkgs folder |
70 |
| - * Run `update_packages.py dev` to overwrite the dev folder's pkgs folder with the updated list |
71 |
| - * If you decide to only add some packages: |
72 |
| - * Manually edit the dev folder's pkgs file to include the desired package |
73 |
| - * Use the output from the `--new` command as reference if you like |
74 |
| - 1. Add the changed pkgs files to git |
75 |
| - 1. Commit and push changes |
| 2 | +Tool to quickly put a Debian-family Linux install into a usable, handy state. |
| 3 | + |
| 4 | +If you can't throw your laptop off a bridge and have your new workstation fully |
| 5 | +configured by the time the laptop hits the water, then you need this tool. |
| 6 | + |
| 7 | + |
| 8 | +## Getting Started |
| 9 | + |
| 10 | +### Pre-reqs |
| 11 | +In order to run this tool, you will need a machine with the following |
| 12 | +characteristics: |
| 13 | +- Uses `apt` and `snap` for package management |
| 14 | +- Has `bash` installed |
| 15 | +- The ability to clone from Github over SSH |
| 16 | + |
| 17 | + |
| 18 | +### Installation |
| 19 | +Clone this repository: |
| 20 | + |
| 21 | +`git clone [email protected]:bclarkx2/ubuntu-setup` |
| 22 | + |
| 23 | + |
| 24 | +## Usage |
| 25 | +See the help menu for a description of the command line flags: |
| 26 | + |
| 27 | +`./setup --help` |
| 28 | + |
| 29 | +Edit the files in the various subdirectories if you want to customize what is |
| 30 | +available to be installed. |
| 31 | + |
| 32 | +Execute the setup script. Here is a sample command: |
| 33 | + |
| 34 | +`./setup --interactive` |
| 35 | + |
| 36 | + |
| 37 | + |
| 38 | +## Built With |
| 39 | +Version 2 of this tool is written in bash (version 1 was a clunky Python |
| 40 | +mess). |
| 41 | + |
| 42 | + |
| 43 | +## Versioning |
| 44 | +Versioning strategy: [SemVer](http://semver.org/) |
| 45 | + |
| 46 | +For the versions available, see the [tags on this repository](https://github.com/bclarkx2/ubuntu-setup/tags). |
| 47 | + |
| 48 | + |
| 49 | +## Authors |
| 50 | +* **Brian Clark** - Primary author |
| 51 | + |
| 52 | + |
| 53 | +## License |
| 54 | +This project is licensed under the MIT license - see the |
| 55 | +[LICENSE.md](LICENSE.md) for details. |
| 56 | + |
| 57 | + |
| 58 | +## Acknowledgements |
| 59 | +Shout out to the [Google shell |
| 60 | +guide](https://google.github.io/styleguide/shellguide.html)! |
| 61 | + |
0 commit comments