katar 2.0.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +19 -18
- data/Gemfile +4 -4
- data/LICENSE.txt +22 -22
- data/README.md +166 -148
- data/Rakefile +2 -2
- data/Vagrantfile +39 -39
- data/bin/katar +5 -5
- data/katar.gemspec +26 -26
- data/lib/katar.rb +5 -5
- data/lib/katar/cli.rb +2 -2
- data/lib/katar/commands/application.rb +87 -87
- data/lib/katar/commands/edit_command.rb +27 -27
- data/lib/katar/commands/init_command.rb +27 -27
- data/lib/katar/globals.rb +2 -2
- data/lib/katar/vagrant.rb +149 -144
- data/lib/katar/version.rb +2 -2
- data/lib/scripts/clear-variables.sh +3 -3
- data/lib/stubs/Katar.yaml +39 -39
- data/lib/stubs/after.sh +4 -4
- data/lib/stubs/aliases +7 -7
- data/lib/stubs/sshconfig +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 828f31435879a0d4ecc0074f69bd7d9d345e751e
|
4
|
+
data.tar.gz: 25cf117b9a960f2bc591493c0843d35f1726c265
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b079973aa3279bd79d8da9976be5fd677fcfd817ac6f72fc85ab820bcb93b4b296ac14f1dcc36d9fe23b80e322508f60f0fa0da64267bf7a83f26a30b8f08097
|
7
|
+
data.tar.gz: 8bb5176ff7fea11a907db25f3f67ccce42b4618962b9e983dbaa1b8fd748a3b4025f414a246d99096a1d580317df902a2836f8d884b173697be2a859cb913e2b
|
data/.gitignore
CHANGED
@@ -1,18 +1,19 @@
|
|
1
|
-
.vagrant
|
2
|
-
*.sublime-project
|
3
|
-
*.sublime-workspace
|
4
|
-
*.gem
|
5
|
-
/.bundle/
|
6
|
-
/.yardoc
|
7
|
-
/Gemfile.lock
|
8
|
-
/_yardoc/
|
9
|
-
/coverage/
|
10
|
-
/doc/
|
11
|
-
/pkg/
|
12
|
-
/spec/reports/
|
13
|
-
/tmp/
|
14
|
-
*.bundle
|
15
|
-
*.so
|
16
|
-
*.o
|
17
|
-
*.a
|
18
|
-
mkmf.log
|
1
|
+
.vagrant
|
2
|
+
*.sublime-project
|
3
|
+
*.sublime-workspace
|
4
|
+
*.gem
|
5
|
+
/.bundle/
|
6
|
+
/.yardoc
|
7
|
+
/Gemfile.lock
|
8
|
+
/_yardoc/
|
9
|
+
/coverage/
|
10
|
+
/doc/
|
11
|
+
/pkg/
|
12
|
+
/spec/reports/
|
13
|
+
/tmp/
|
14
|
+
*.bundle
|
15
|
+
*.so
|
16
|
+
*.o
|
17
|
+
*.a
|
18
|
+
mkmf.log
|
19
|
+
.idea/*
|
data/Gemfile
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
source 'https://rubygems.org'
|
2
|
-
|
3
|
-
# Specify your gem's dependencies in liqueur.gemspec
|
4
|
-
gemspec
|
1
|
+
source 'https://rubygems.org'
|
2
|
+
|
3
|
+
# Specify your gem's dependencies in liqueur.gemspec
|
4
|
+
gemspec
|
data/LICENSE.txt
CHANGED
@@ -1,22 +1,22 @@
|
|
1
|
-
Copyright (c) 2016 AcMitch
|
2
|
-
|
3
|
-
MIT License
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
-
a copy of this software and associated documentation files (the
|
7
|
-
"Software"), to deal in the Software without restriction, including
|
8
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
-
permit persons to whom the Software is furnished to do so, subject to
|
11
|
-
the following conditions:
|
12
|
-
|
13
|
-
The above copyright notice and this permission notice shall be
|
14
|
-
included in all copies or substantial portions of the Software.
|
15
|
-
|
16
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
1
|
+
Copyright (c) 2016 AcMitch
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
CHANGED
@@ -1,148 +1,166 @@
|
|
1
|
-
Katar provides a simple, elegant way to manage and provision a Vagrant box on your local machine! Vagrant boxes are completely disposable. If something goes wrong, you can destroy and re-create the box in seconds!
|
2
|
-
|
3
|
-
**Note: Katar is inspired by PHP's [Laravel Homestead](https://laravel.com/docs/5.2/homestead) but with broader scope and without PHP dependencies
|
4
|
-
|
5
|
-
Katar runs on any Windows, Mac, or Linux system, and by default uses a Vagrant box with almost everything you need to develop most applications.
|
6
|
-
|
7
|
-
### Installing VirtualBox & Vagrant
|
8
|
-
|
9
|
-
Before launching your Katar environment, you must install VirtualBox and Vagrant. Both of these software packages provide easy-to-use visual installers for all popular operating systems.
|
10
|
-
|
11
|
-
**Note: If you are using Windows, you may need to enable hardware virtualization (VT-x). It can usually be enabled via your BIOS.**
|
12
|
-
|
13
|
-
### Installing Katar
|
14
|
-
|
15
|
-
Katar is a Ruby Gem, therefore, Ruby must be installed on your local machine. Once Ruby is installed simply run the following command to install Katar:
|
16
|
-
|
17
|
-
```
|
18
|
-
gem install katar
|
19
|
-
```
|
20
|
-
|
21
|
-
Once you have installed the Katar Gem, run the `init command` to create the Katar.yaml configuration file:
|
22
|
-
|
23
|
-
```
|
24
|
-
katar init
|
25
|
-
```
|
26
|
-
|
27
|
-
The Katar.yaml file will be placed in the ~/.katar directory. If you're using a Mac or Linux system, you may edit Katar.yaml file by running the `katar edit` command in your terminal:
|
28
|
-
|
29
|
-
```
|
30
|
-
katar edit
|
31
|
-
```
|
32
|
-
|
33
|
-
If you would like to do some extra provisioning you may add any commands you wish to the `after.sh` file within the ~/.katar directory and they will be run after the Katar machine is provisioned.
|
34
|
-
|
35
|
-
### Setting Your Box
|
36
|
-
|
37
|
-
The `box` property of the Katar.yaml file is the Vagrant box that will be utilized by your Katar environment.
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
-
|
45
|
-
-
|
46
|
-
-
|
47
|
-
-
|
48
|
-
-
|
49
|
-
- Python 2.7.10
|
50
|
-
- Ruby 2.2.3 (RVM)
|
51
|
-
-
|
52
|
-
-
|
53
|
-
|
54
|
-
|
55
|
-
-
|
56
|
-
-
|
57
|
-
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
-
|
63
|
-
-
|
64
|
-
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
katar
|
102
|
-
katar
|
103
|
-
katar
|
104
|
-
katar
|
105
|
-
katar
|
106
|
-
katar provision #
|
107
|
-
katar
|
108
|
-
katar
|
109
|
-
katar
|
110
|
-
katar
|
111
|
-
katar
|
112
|
-
katar
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
1
|
+
Katar provides a simple, elegant way to manage and provision a Vagrant box on your local machine! Vagrant boxes are completely disposable. If something goes wrong, you can destroy and re-create the box in seconds!
|
2
|
+
|
3
|
+
**Note: Katar is inspired by PHP's [Laravel Homestead](https://laravel.com/docs/5.2/homestead) but with broader scope, Docker containers and without PHP dependencies.**
|
4
|
+
|
5
|
+
Katar runs on any Windows, Mac, or Linux system, and by default uses a Vagrant box with almost everything you need to develop most applications.
|
6
|
+
|
7
|
+
### Installing VirtualBox & Vagrant
|
8
|
+
|
9
|
+
Before launching your Katar environment, you must install VirtualBox and Vagrant. Both of these software packages provide easy-to-use visual installers for all popular operating systems.
|
10
|
+
|
11
|
+
**Note: If you are using Windows, you may need to enable hardware virtualization (VT-x). It can usually be enabled via your BIOS.**
|
12
|
+
|
13
|
+
### Installing Katar
|
14
|
+
|
15
|
+
Katar is a Ruby Gem, therefore, Ruby must be installed on your local machine. Once Ruby is installed simply run the following command to install Katar:
|
16
|
+
|
17
|
+
```
|
18
|
+
gem install katar
|
19
|
+
```
|
20
|
+
|
21
|
+
Once you have installed the Katar Gem, run the `init command` to create the Katar.yaml configuration file:
|
22
|
+
|
23
|
+
```
|
24
|
+
katar init
|
25
|
+
```
|
26
|
+
|
27
|
+
The Katar.yaml file will be placed in the ~/.katar directory. If you're using a Mac or Linux system, you may edit Katar.yaml file by running the `katar edit` command in your terminal:
|
28
|
+
|
29
|
+
```
|
30
|
+
katar edit
|
31
|
+
```
|
32
|
+
|
33
|
+
If you would like to do some extra provisioning you may add any commands you wish to the `after.sh` file within the ~/.katar directory and they will be run after the Katar machine is provisioned.
|
34
|
+
|
35
|
+
### Setting Your Box
|
36
|
+
|
37
|
+
The `box` property of the Katar.yaml file is the Vagrant box that will be utilized by your Katar environment.
|
38
|
+
|
39
|
+
By default the `box` property is set to `acmitch/katar-box`. Included with that box is the following:
|
40
|
+
|
41
|
+
#### Included Software
|
42
|
+
- Ubuntu 15.10
|
43
|
+
- Git
|
44
|
+
- Docker
|
45
|
+
- Java 8
|
46
|
+
- Sqlite3
|
47
|
+
- Memcached
|
48
|
+
- Subversion
|
49
|
+
- Python 2.7.10
|
50
|
+
- Ruby 2.2.3 (RVM)
|
51
|
+
- NodeJs(With PM2, Browserify, Bower, Babel, Webpack, and Gulp)
|
52
|
+
- R
|
53
|
+
|
54
|
+
#### Docker Containers
|
55
|
+
- MySQL
|
56
|
+
- Postgres
|
57
|
+
- MongoDB
|
58
|
+
- Redis
|
59
|
+
- Elasticsearch
|
60
|
+
|
61
|
+
#### Included Applications
|
62
|
+
- Xfce4 Desktop
|
63
|
+
- Sublime Text 3
|
64
|
+
- Terminator
|
65
|
+
- Emacs
|
66
|
+
|
67
|
+
**Note: If wishing to contribute clone `acmitch/katar-box` on GitHub.**
|
68
|
+
|
69
|
+
### Configuring Shared Folders
|
70
|
+
|
71
|
+
The folders property of the Katar.yaml file lists all of the folders you wish to share with your Katar environment. As files within these folders are changed, they will be kept in sync between your local machine and the Katar environment. You may configure as many shared folders as necessary:
|
72
|
+
|
73
|
+
```
|
74
|
+
folders:
|
75
|
+
- map: ~/Workspace
|
76
|
+
to: /home/vagrant/Workspace
|
77
|
+
```
|
78
|
+
|
79
|
+
### Set Your SSH Key
|
80
|
+
|
81
|
+
Next, you should edit the Katar.yaml file. In this file, you can configure the path to your public SSH key, as well as the folders you wish to be shared between your main machine and the Katar virtual machine.
|
82
|
+
|
83
|
+
**Don't have an SSH key? On Mac and Linux, you can generally create an SSH key pair using the following command:**
|
84
|
+
|
85
|
+
```
|
86
|
+
ssh-keygen -t rsa -C "you@katar"
|
87
|
+
```
|
88
|
+
|
89
|
+
On Windows, you may install Git and use the Git Bash shell included with Git to issue the command above. Alternatively, you may use PuTTY and PuTTYgen.
|
90
|
+
|
91
|
+
Once you have created a SSH key, specify the key's path in the authorize property of your Katar.yaml file.
|
92
|
+
|
93
|
+
### Launch The Vagrant Box
|
94
|
+
|
95
|
+
Once you have edited the Katar.yaml to your liking, run the `katar up` command in your terminal.
|
96
|
+
|
97
|
+
Vagrant will boot the virtual machine, and configure your shared folders! To destroy the machine, you may use the `katar destroy` command. For a complete list of available Katar commands, run `katar help`.
|
98
|
+
|
99
|
+
```
|
100
|
+
Commands:
|
101
|
+
katar destroy # Destroy the Katar machine
|
102
|
+
katar edit # Edit the Katar.yaml file
|
103
|
+
katar halt # Halt the Katar machine
|
104
|
+
katar help [COMMAND] # D``escribe available commands or one specific command
|
105
|
+
katar init # Create a stub Katar.yaml file
|
106
|
+
katar provision # Re-provisions the Katar machine
|
107
|
+
katar provision # Update the Katar machine image
|
108
|
+
katar resume # Resume the suspended Katar machine
|
109
|
+
katar ssh # Login to the Katar machine via SSH
|
110
|
+
katar status # Get the status of the Katar machine
|
111
|
+
katar suspend # Suspend the Katar machine
|
112
|
+
katar up # Start the Katar machine
|
113
|
+
katar version # Show Katar version number
|
114
|
+
```
|
115
|
+
|
116
|
+
### Ports
|
117
|
+
|
118
|
+
By default, the following ports are forwarded to your Katar environment:
|
119
|
+
|
120
|
+
```
|
121
|
+
SSH: 2222 → Forwards To 22
|
122
|
+
HTTP: 8000 → Forwards To 80
|
123
|
+
HTTPS: 44300 → Forwards To 443
|
124
|
+
MySQL: 33060 → Forwards To 3306
|
125
|
+
Postgres: 54320 → Forwards To 5432
|
126
|
+
Forwarding Additional Ports
|
127
|
+
```
|
128
|
+
|
129
|
+
If you wish, you may forward additional ports to the Vagrant box, as well as specify their protocol:
|
130
|
+
|
131
|
+
```
|
132
|
+
ports:
|
133
|
+
- send: 93000
|
134
|
+
to: 9300
|
135
|
+
- send: 7777
|
136
|
+
to: 777
|
137
|
+
protocol: udp
|
138
|
+
```
|
139
|
+
### Desktop Mode
|
140
|
+
|
141
|
+
By default, VirtualBox machines are started in headless mode, meaning there is no UI for the machines visible on the host machine. To utilize the UI set the `desktop` property to true in the Katar.yaml file. During the boot process VirtualBox will open prompting login. When the boot processes finishes, simply login using the credentials `vagrant`/`vagrant`. Once logged in start the GUI by typing into the prompt:
|
142
|
+
|
143
|
+
```bash
|
144
|
+
# Start the VM desktop
|
145
|
+
xfce4-desktop
|
146
|
+
|
147
|
+
# Turn on bidirectional clipboard
|
148
|
+
clipboard-on
|
149
|
+
```
|
150
|
+
|
151
|
+
### Docker Containers
|
152
|
+
Docker containers are used to support multiple services within Katar by default.
|
153
|
+
|
154
|
+
```bash
|
155
|
+
# Display all containers
|
156
|
+
docker ps -a
|
157
|
+
|
158
|
+
# Start a Docker MongoDB container
|
159
|
+
docker start mongo-db
|
160
|
+
```
|
161
|
+
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
|
data/Rakefile
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
require "bundler/gem_tasks"
|
2
|
-
|
1
|
+
require "bundler/gem_tasks"
|
2
|
+
|
data/Vagrantfile
CHANGED
@@ -1,40 +1,40 @@
|
|
1
|
-
require 'json'
|
2
|
-
require 'yaml'
|
3
|
-
|
4
|
-
VAGRANTFILE_API_VERSION = "2"
|
5
|
-
confDir = $confDir ||= File.expand_path("~/.katar")
|
6
|
-
|
7
|
-
katarYamlPath = confDir + "/Katar.yaml"
|
8
|
-
katarJsonPath = confDir + "/Katar.json"
|
9
|
-
afterScriptPath = confDir + "/after.sh"
|
10
|
-
sshconfigPath = confDir + "/sshconfig"
|
11
|
-
aliasesPath = confDir + "/aliases"
|
12
|
-
|
13
|
-
require File.expand_path(File.dirname(__FILE__) + '/lib/katar/vagrant.rb')
|
14
|
-
|
15
|
-
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
16
|
-
|
17
|
-
if File.exists? aliasesPath then
|
18
|
-
config.vm.provision "file", source: aliasesPath, destination: "~/.bash_aliases"
|
19
|
-
end
|
20
|
-
|
21
|
-
if File.exists? sshconfigPath then
|
22
|
-
config.vm.provision "file", source: sshconfigPath, destination: "~/.ssh/config"
|
23
|
-
end
|
24
|
-
|
25
|
-
# Read configuration
|
26
|
-
if File.exists? katarYamlPath then
|
27
|
-
settings = YAML::load(File.read(katarYamlPath))
|
28
|
-
elsif File.exists? katarJsonPath then
|
29
|
-
settings = JSON.parse(File.read(katarJsonPath))
|
30
|
-
end
|
31
|
-
|
32
|
-
# Setup/Start up VM
|
33
|
-
Katar.configure(config, settings)
|
34
|
-
|
35
|
-
# Provision using custom shell script
|
36
|
-
if File.exists? afterScriptPath then
|
37
|
-
config.vm.provision "shell", path: afterScriptPath
|
38
|
-
end
|
39
|
-
|
1
|
+
require 'json'
|
2
|
+
require 'yaml'
|
3
|
+
|
4
|
+
VAGRANTFILE_API_VERSION = "2"
|
5
|
+
confDir = $confDir ||= File.expand_path("~/.katar")
|
6
|
+
|
7
|
+
katarYamlPath = confDir + "/Katar.yaml"
|
8
|
+
katarJsonPath = confDir + "/Katar.json"
|
9
|
+
afterScriptPath = confDir + "/after.sh"
|
10
|
+
sshconfigPath = confDir + "/sshconfig"
|
11
|
+
aliasesPath = confDir + "/aliases"
|
12
|
+
|
13
|
+
require File.expand_path(File.dirname(__FILE__) + '/lib/katar/vagrant.rb')
|
14
|
+
|
15
|
+
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
16
|
+
|
17
|
+
if File.exists? aliasesPath then
|
18
|
+
config.vm.provision "file", source: aliasesPath, destination: "~/.bash_aliases"
|
19
|
+
end
|
20
|
+
|
21
|
+
if File.exists? sshconfigPath then
|
22
|
+
config.vm.provision "file", source: sshconfigPath, destination: "~/.ssh/config"
|
23
|
+
end
|
24
|
+
|
25
|
+
# Read configuration
|
26
|
+
if File.exists? katarYamlPath then
|
27
|
+
settings = YAML::load(File.read(katarYamlPath))
|
28
|
+
elsif File.exists? katarJsonPath then
|
29
|
+
settings = JSON.parse(File.read(katarJsonPath))
|
30
|
+
end
|
31
|
+
|
32
|
+
# Setup/Start up VM
|
33
|
+
Katar.configure(config, settings)
|
34
|
+
|
35
|
+
# Provision using custom shell script
|
36
|
+
if File.exists? afterScriptPath then
|
37
|
+
config.vm.provision "shell", path: afterScriptPath
|
38
|
+
end
|
39
|
+
|
40
40
|
end
|