straight_line 0.1.2.0 → 0.1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -1
- data/README.md +49 -7
- data/VERSION +1 -1
- data/lib/straight_line/common/configure.rb +5 -0
- data/lib/straight_line.rb +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7b7b20a511c0c75d8151c5903893b045e7686c95
|
4
|
+
data.tar.gz: e8fa94dc76745fe215755d62c751c9af92965ca1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7c58193d3a264b3d0d6c0dac795d8fa747572d57055f05e74356d2a4572b496c5ee26001bb68c1ba17f6b4aee448c0c8eb9f1402e319feefafa553429a77bb66
|
7
|
+
data.tar.gz: 2aa5271353bdd34122444c37a5b9533854fd14aaa68cf83ac904bd4699b5aa289a8261202d41652598a27ee2aefb36c72239b4c74a6b46cd6dc830603a1e7982
|
data/.rubocop.yml
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,12 @@
|
|
1
1
|
# StraightLine
|
2
2
|
|
3
|
-
StraightLine
|
3
|
+
StraightLine helps achieve a good DevOps practise with minimal effort. It provides a mechanism for creating an managing tasks, is easily distributed (through rubygems), and provides a revision control process which follows the Github workflow.
|
4
|
+
|
5
|
+
Why does revision control and task management need to be combined? StraightLine's aim is to allow developers to focus on coding without compromising on a good CI process. In the near future StraightLine will allow tasks to be executed before any revision control action is done. For example, before a feature is pushed, the lint and test tasks could be run. This is bringing the errors closer to the developer which has been proven to increase efficiency.
|
6
|
+
|
7
|
+
StraightLine is **not** only for Ruby based projects. StraightLine can be used to manage tasks and workflow of *any* type of project.
|
8
|
+
|
9
|
+
Feel free to submit any bugs or questions as github issues [here](https://github.com/chrisUsick/straight_line/issues).
|
4
10
|
|
5
11
|
## Installation
|
6
12
|
|
@@ -12,12 +18,14 @@ gem 'straight_line'
|
|
12
18
|
|
13
19
|
And then execute:
|
14
20
|
|
15
|
-
|
21
|
+
```
|
22
|
+
$ bundle install
|
23
|
+
```
|
16
24
|
|
17
25
|
Next, add these lines to your Rakefile:
|
18
26
|
|
19
27
|
```ruby
|
20
|
-
require 'straight_line
|
28
|
+
require 'straight_line'
|
21
29
|
```
|
22
30
|
|
23
31
|
Generate a github api token by following [these instructions](https://help.github.com/articles/creating-an-access-token-for-command-line-use/).
|
@@ -37,8 +45,8 @@ Note `~/.netrc` needs to have `600` permissions. Do this with the following comm
|
|
37
45
|
```bash
|
38
46
|
chmod 600 ~/.netrc
|
39
47
|
```
|
40
|
-
|
41
|
-
|
48
|
+
## Revision Control
|
49
|
+
### Usage
|
42
50
|
|
43
51
|
The basic workflow of StraightLine is:
|
44
52
|
|
@@ -53,11 +61,45 @@ Note: the quotation marks are important!
|
|
53
61
|
- creates a branch named `feature-name`
|
54
62
|
2. `rake "feature:diff[<title>, <body>]"`
|
55
63
|
- Creates a pull request
|
56
|
-
- This command manages
|
57
|
-
- If a pull request has already been made this command simply pushes you code to the remote
|
64
|
+
- This command manages rebasing and/or merging with remote when it is appropriate
|
65
|
+
- If a pull request has already been made this command simply pushes you code to the remote branch
|
58
66
|
3. `rake "feature:land"`
|
59
67
|
- This command merges the feature branch to master
|
60
68
|
|
69
|
+
## Tasks
|
70
|
+
|
71
|
+
Straightline extends [Rake](https://github.com/ruby/rake), a simple yet powerful task running tool, to allow for quick definition of build and deploy pipelines. It allows tasks to be defined as rake tasks, shell commands, or bash scripts and lets you manage them from one place.
|
72
|
+
StraightLine injects rake tasks at runtime. In other words, you configure straightline tasks in a Rakefile (or elsewhere) and execute them by running rake tasks.
|
73
|
+
|
74
|
+
### Usage
|
75
|
+
|
76
|
+
In you rake file add a config block like so:
|
77
|
+
|
78
|
+
```ruby
|
79
|
+
StraightLine.configure do |config|
|
80
|
+
config.add 'provision', :shell, './scripts/provision.sh'
|
81
|
+
config.add 'deploy', :shell, './scripts/deploy.sh'
|
82
|
+
end
|
83
|
+
```
|
84
|
+
|
85
|
+
#### `config.add` options
|
86
|
+
|
87
|
+
These are the parameters that can be passed to `config.add`, in order:
|
88
|
+
|
89
|
+
- name: Required Name of the task
|
90
|
+
- type: Required Type of command, either `:shell` or `:rake`
|
91
|
+
- command: Required The command to run. If `type` is `:shell` then this should point to a shell script or be a shell command. If `type` is `:rake` then it should be the namespaced name of a rake task
|
92
|
+
- options: Optional The options can be passed to further modify a task. `opts[:before]` and `opts[:after]` should be array of straightline tasks to run before/after the given task executes.
|
93
|
+
|
94
|
+
Example of defining before tasks:
|
95
|
+
|
96
|
+
```ruby
|
97
|
+
StraightLine.configure do |config|
|
98
|
+
config.add 'build', :shell, './scripts/build.sh'
|
99
|
+
config.add 'deploy', :shell, './scripts/deploy.sh', before: 'build'
|
100
|
+
end
|
101
|
+
```
|
102
|
+
|
61
103
|
## Contributing
|
62
104
|
|
63
105
|
Bug reports and pull requests are welcome on GitHub at [https://github.com/chrisUsick/straight_line](). This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.3.0
|
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'rake'
|
2
2
|
require 'straight_line/common/command'
|
3
|
+
require 'straight_line/common/util'
|
3
4
|
|
4
5
|
# Configuration class to add tasks to the straightline rake config
|
5
6
|
class Configure
|
@@ -8,8 +9,12 @@ class Configure
|
|
8
9
|
Rake::Task.define_task name => opts[:before] do
|
9
10
|
if type == :shell
|
10
11
|
cmd = Command.new command
|
12
|
+
Util.logger.puts "executing command #{command}. Error results will be
|
13
|
+
displayed if any ocur"
|
11
14
|
cmd.run
|
12
15
|
elsif !name.nil?
|
16
|
+
Util.logger.puts "executing task #{command}. Error results will be
|
17
|
+
displayed if any ocur"
|
13
18
|
Rake::Task[command].invoke
|
14
19
|
end
|
15
20
|
run_after_commands(opts)
|
data/lib/straight_line.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: straight_line
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Usick
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-05-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|