85 lines
		
	
	
		
			2.2 KiB
		
	
	
	
		
			Markdown
		
	
	
	
	
	
		
		
			
		
	
	
			85 lines
		
	
	
		
			2.2 KiB
		
	
	
	
		
			Markdown
		
	
	
	
	
	
|  | curl-bash-template.sh | |||
|  | ===================== | |||
|  | 
 | |||
|  | So you've got a neat project and you want to be able to have others get it up and running quickly, eh? | |||
|  | 
 | |||
|  | You'd like them to be able to do something like this and have your service installed, eh? | |||
|  | 
 | |||
|  | ```bash | |||
|  | curl -L install.example.io | bash | |||
|  | ``` | |||
|  | 
 | |||
|  | Well, this is a collection of scripts that you can include in your repo to do just that. | |||
|  | 
 | |||
|  | Just modify `get.sh` to point to your repo (you could host this on `install.my-project.io`, for example) | |||
|  | and modify `local.sh` for your specific project. | |||
|  | 
 | |||
|  | Currently supports: | |||
|  | 
 | |||
|  | 	* macOS's launchd | |||
|  | 	* Linux's systemd | |||
|  | 
 | |||
|  | Make Your Project Layout Like This | |||
|  | ---------------------------------- | |||
|  | 
 | |||
|  | ``` | |||
|  | /Users/me/git.example.com/me/awesome.js/ | |||
|  | ├── CHANGELOG | |||
|  | ├── LICENSE | |||
|  | ├── README.md | |||
|  | ├── dist | |||
|  | │   ├── Library | |||
|  | │   │   └── LaunchDaemons | |||
|  | │   │       └── com.example.awesome.plist | |||
|  | │   └── etc | |||
|  | │       ├── awesome | |||
|  | │       │   └── awesome.example.yml | |||
|  | │       ├── systemd | |||
|  | │       │   └── system | |||
|  | │       │       └── awesome.service | |||
|  | │       └── tmpfiles.d | |||
|  | │           └── awesome.conf | |||
|  | ├── installer | |||
|  | │   ├── get.sh | |||
|  | │   └── local.sh | |||
|  | ├── lib | |||
|  | └── package.json | |||
|  | ``` | |||
|  | 
 | |||
|  | Let Your Followers Install Your Project Like This | |||
|  | ---------------------------------- | |||
|  | 
 | |||
|  | ```bash | |||
|  | curl -L https://git.example.com/example/project.git/raw/master/installer/get.sh | bash | |||
|  | ``` | |||
|  | 
 | |||
|  | The installed system looks like this: | |||
|  | 
 | |||
|  | ``` | |||
|  | / | |||
|  | ├── etc | |||
|  | │   ├── systemd | |||
|  | │   │   └── system | |||
|  | │   │       └── awesome.service | |||
|  | │   └── tmpfiles.d | |||
|  | │       └── awesome.conf | |||
|  | ├── opt | |||
|  | │   └── awesome | |||
|  | │       ├── etc | |||
|  | │       ├── lib | |||
|  | │       └── var | |||
|  | └── Library | |||
|  |     └── LaunchDaemons | |||
|  |         └── com.example.awesome.plist | |||
|  | ``` | |||
|  | 
 | |||
|  | Available Helpers | |||
|  | ----------------- | |||
|  | 
 | |||
|  | ``` | |||
|  | $my_root                    typically /, but could have a prefix on android | |||
|  | $sudo_cmd                   'sudo' if not root and sudo is installed, otherwise empty | |||
|  | http_get <url> <filepath>   uses curl or wget to download a file | |||
|  | http_bash <url>             downloads file to a temporary location and runs it with bash | |||
|  | ``` |