Skip to content

Commit cf64f61

Browse files
committed
Initial commit
0 parents  commit cf64f61

26 files changed

+55560
-0
lines changed

.github/FUNDING.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
github: oxplot
2+
patreon: oxplot
3+
open_collective: oxplot
4+
ko_fi: oxplot
5+
issuehunt: oxplot

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
test.db
2+
config.*
3+
runsheet-*-*
4+
data/prod_static.go
5+
license_file.txt

Readme.md

Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
Welcome to Runsheet V2 (RsV2). This guide will help you understand how
2+
to setup this software and how it works under the hood.
3+
4+
## What is RsV2?
5+
6+
RsV2 is a second iteration, re-written from scratch, of an original
7+
runsheet script which given a set of tasks and their dependencies,
8+
scheduled them in the most time optimized arrangement and provided a UI
9+
to help tracking the progress of those tasks. You can think of it as a
10+
simpler, collaborative and more focused Gantt chart with live task
11+
status updates.
12+
13+
![GitHub Logo](example.gif)
14+
15+
## What can I use it for?
16+
17+
RsV2 can be used to track a weekend roll out for instance. You have a
18+
bunch of tasks that must be done in a certain order, such as putting up
19+
a maintenance notice, taking systems down, upgrading and testing. RsV2’s
20+
real advantage comes into play when multiple people are involved and
21+
prompt starting and finishing of tasks is of importance.
22+
23+
## Features
24+
25+
* RDBMS backed storage for tasks and runsheets
26+
* Multiple runsheets per server
27+
* Lax requirements on how the tasks and runsheets are stored
28+
* Completely reactive UI with live collaborative features.
29+
* Automatic time divisions based on total run time
30+
* Support for variety of database backends
31+
* Start time and “Behind Schedule” notifications
32+
* Single Go binary for ease of deployment (not static yet!)
33+
* Multi-platform support
34+
35+
## Build & Install
36+
37+
```
38+
go generate
39+
go install -tags prod
40+
```
41+
42+
## Quick Demo
43+
44+
Run `runsheet -config example-config.json` and open your browser at
45+
http://localhost:8080
46+
47+
## Setup
48+
49+
### Config
50+
51+
RsV2 is configured using a file named `config.yaml` which must be placed
52+
in either: same directory as the executable; `/etc/runsheet`;
53+
`$HOME/.runsheet` or their equivalent locations on other platforms.
54+
55+
`config.yaml` has the following format:
56+
57+
```yaml
58+
# Optional
59+
Listen: :8080
60+
61+
# A comment starting with hash character
62+
ConnectionUrl: dbdriver://…
63+
RunsheetsSql: select * from …
64+
```
65+
66+
`Listen` specifies which interface and port number to listen for
67+
connections to serve the UI. `:8080` is the default and means: serve on
68+
port `8080` on all interfaces. To limit to localhost for instance, you
69+
can use `127.0.0.1:8080`.
70+
71+
`ConnectionUrl` specifies which DB driver to use and what parameters to
72+
pass, such as username, password, host and others. Following are
73+
examples of `ConnectionUrl`s for various supported databases:
74+
75+
```yaml
76+
-# Oracle - Oracle Instant Client Basic is required
77+
-ConnectionUrl: goracle://username/password@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=tcp)(HOST=host.name.com)(PORT=1530)))(CONNECT_DATA=(SERVICE_NAME=MY_SERVICE_NAME)))
78+
79+
# Microsoft SQL
80+
ConnectionUrl: sqlserver://username:password@host.name.com?database=my_db
81+
82+
# SQLite
83+
ConnectionUrl: sqlite3://./relative/path/to/test.db
84+
```
85+
86+
`RunsheetsSql` is a query or otherwise any valid SQL for the given
87+
database that retrieves the list of runsheets.
88+
89+
### Runsheet
90+
91+
A **runsheet** is simply a list of tasks and their dependencies.
92+
`RunsheetsSql` must return the following columns (some optional):
93+
94+
* `id` (string): ID of the runsheet
95+
* `name` (string)(optional): name or title of the runsheet — supports
96+
markdown
97+
* `description` (string)(optional): runsheet description — supports
98+
markdown
99+
* `connection_url` (string): Same format as `ConnectionUrl` above but
100+
for this runsheet
101+
* `tasks_sql` (string): SQL to get the list of tasks
102+
* `update_sql` (string): SQL to update status of a task
103+
* `start_time` (string)(optional): start time and date of the first task
104+
105+
All column names are case sensitive and `RunsheetsSql` must not retrieve
106+
any column that is not specified above.
107+
108+
`tasks_sql` is a query or otherwise any valid SQL for the given database
109+
that retrieves the list of tasks for the corresponding runsheet.
110+
111+
### Task
112+
113+
A **task** is an undertaking assigned to a specific resource (person)
114+
and has defined duration in minutes. It may also have dependencies on
115+
other tasks. `tasks_sql` must return the following columns (some
116+
optional):
117+
118+
* `id` (string): Task ID
119+
* `name` (string)(optional): Task name — supports markdown
120+
* `description` (string)(optional): Task description — supports markdown
121+
* `assignee` (string): Name of assignee
122+
* `duration` (number): Task duration in minutes
123+
* `status` (string): Task status which must be one of `idle`, `ongoing`
124+
or `done`
125+
* `dependees` (string): List of task IDs this task depends on, each
126+
separated by `|`
127+
128+
All column names are case sensitive and `tasks_sql` must not retrieve
129+
any column that is not specified above.
130+
131+
As an example of `dependees`: say we have three tasks with IDs of `A`,
132+
`B` and `C`. If `C` depends on `A` and `B`, then `C`’s record will have
133+
`A|B` in the `dependees` column.
134+
135+
`update_sql` is a valid SQL for the given database which updates status
136+
for a given task. All occurrences of `{{task}}` inside `update_sql` will
137+
be replaced with ID of the task whose status is being updated. All
138+
occurences of `{{status}}` inside `update_sql` will be replaced with the
139+
new status of the task. Below is an example:
140+
141+
```
142+
update tasks set "status" = '{{status}}' where "id" = '{{task}}'
143+
```
144+
145+
Note that no DB aware substitutions are done. Thus you’re required to
146+
quote literal string values in your SQL.
147+
148+
`start_time` is a string representation of the start time and date the
149+
earliest task in the runsheet is to be stamped with. Regular interval
150+
timestamps are shown on the left side of a runsheet UI. You may use any
151+
format supported by Javascript. Following is recommended: `2018-10-25
152+
18:10:00 EST` where `EST` defines the time zone, in this case Australian
153+
Eastern Standard Time. You may use an offset instead, such as `+11:00`
154+
or [other abbreviations](https://www.timeanddate.com/time/zones/).

assets_generate.go

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// +build ignore
2+
3+
package main
4+
5+
import (
6+
"log"
7+
8+
"github.com/shurcooL/vfsgen"
9+
10+
"github.com/oxplot/runsheet/data"
11+
)
12+
13+
func main() {
14+
err := vfsgen.Generate(data.StaticAssets, vfsgen.Options{
15+
Filename: "data/prod_static.go",
16+
PackageName: "data",
17+
BuildTags: "prod",
18+
VariableName: "StaticAssets",
19+
})
20+
if err != nil {
21+
log.Fatalln(err)
22+
}
23+
}

contrib/Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
FROM debian:experimental
2+
3+
RUN apt-get update -y && apt-get -y install golang-1.12 mingw-w64
4+
5+
ENV GOPATH=/go
6+
ENV PATH=/usr/lib/go-1.12/bin:$PATH

contrib/build

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
3+
docker build -t go-win .

data/dev_static.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// +build !prod
2+
3+
package data
4+
5+
import (
6+
"net/http"
7+
)
8+
9+
var StaticAssets = http.Dir("static")

data/spa.go

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package data
2+
3+
var SpaHtml = []byte(`<!doctype html>
4+
<html>
5+
<head>
6+
<link href='https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Material+Icons' rel="stylesheet">
7+
<link href="/static/vuetify.min.css" rel="stylesheet">
8+
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, minimal-ui">
9+
</head>
10+
<link href="/static/main.css" rel="stylesheet">
11+
<body>
12+
13+
<div id="app" v-cloak><router-view></router-view></div>
14+
15+
<script src="/static/vue.js"></script>
16+
<script src="/static/vue-router.js"></script>
17+
<script src="/static/vue-meta.js"></script>
18+
<script src="/static/vue-markdown.js"></script>
19+
<script src="/static/vuetify.js"></script>
20+
<script src="/static/main.js"></script>
21+
22+
</body>
23+
</html>`)

example-config.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"Listen": ":8080",
3+
"ConnectionUrl": "sqlite3://./example-db",
4+
"RunsheetsSql": "select id, connection_url, tasks_sql, update_sql from sheets"
5+
}

example-db

16 KB
Binary file not shown.

0 commit comments

Comments
 (0)