lazylead 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +5 -3
- data/.circleci/release_image.sh +6 -3
- data/.docker/Dockerfile +6 -6
- data/.docker/docker-compose.yml +3 -3
- data/.docker/readme.md +24 -21
- data/.rultor.yml +13 -14
- data/Rakefile +38 -1
- data/lazylead.gemspec +4 -3
- data/lib/lazylead/task/fix_version.rb +1 -1
- data/lib/lazylead/version.rb +1 -1
- data/readme.md +65 -58
- data/upgrades/sqlite/001-install-main-lazylead-tables.sql +3 -3
- metadata +17 -4
- data/deploy.sh +0 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b3406ba1a6961d5be8547e8c8b9791bfacdeac1fd8f886964469baf4508a5129
|
4
|
+
data.tar.gz: c3401bf20c25f5496a3a2f99ddac4dd64cef7a7249e2ad488cd32d67d0d021b1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5c1c52b3ac90af6227419af7599ef576eafaade4f1d9cbdace293d1a7c9f6f17bce5e09f6ffafcfae4dc3ab12cc819d9106060c271e49248bf1eeb2687123a34
|
7
|
+
data.tar.gz: b13c9f451e782e248096f0bbfc65882e61eb6118fcf87a34309be4bcba9d25cf55eec177f04605047c898fb6161629ca35b387af208d9675371bb4fb502d4555
|
data/.circleci/config.yml
CHANGED
@@ -11,7 +11,7 @@ jobs:
|
|
11
11
|
- run: |
|
12
12
|
apk add libc-dev gcc make git sqlite sqlite-dev sqlite-libs
|
13
13
|
bundler install
|
14
|
-
- run: rake test rubocop xcop
|
14
|
+
- run: bundle exec rake test rubocop sqlint xcop
|
15
15
|
deploy:
|
16
16
|
machine: true
|
17
17
|
steps:
|
@@ -21,10 +21,12 @@ jobs:
|
|
21
21
|
name: "Build docker image"
|
22
22
|
command: |
|
23
23
|
set -e
|
24
|
-
COMMIT_URL="https://github.com/dgroup/
|
25
|
-
docker build --build-arg release_tags="${CIRCLE_SHA1}, ${CIRCLE_BRANCH}, ${COMMIT_URL}" \
|
24
|
+
COMMIT_URL="https://github.com/dgroup/lazylead/commit/${CIRCLE_SHA1}"
|
25
|
+
docker build --build-arg release_tags="${CIRCLE_SHA1}, ${CIRCLE_BRANCH}, ${COMMIT_URL}" --build-arg version="${DOCKER_RELEASE_TAGS:7}" \
|
26
26
|
-t dgroup/lazylead:$CIRCLE_BRANCH . \
|
27
27
|
-f .docker/Dockerfile
|
28
|
+
echo "Available LL images:"
|
29
|
+
docker images | grep lazylead
|
28
30
|
docker run --rm dgroup/lazylead:${CIRCLE_BRANCH} bin/lazylead --verbose > trace.log
|
29
31
|
cat trace.log
|
30
32
|
expected="No tasks found"
|
data/.circleci/release_image.sh
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
#!/bin/bash
|
2
|
-
|
2
|
+
set -e
|
3
|
+
echo "Release tags: ${DOCKER_RELEASE_TAGS}"
|
3
4
|
docker login --username "${DOCKER_USER}" --password "${DOCKER_TOKEN}"
|
4
5
|
if [ "${CIRCLE_BRANCH}" == "master" ]; then
|
5
|
-
for tag in ${
|
6
|
+
for tag in ${DOCKER_RELEASE_TAGS// / } ; do
|
6
7
|
docker tag "dgroup/lazylead:${CIRCLE_BRANCH}" "dgroup/lazylead:${tag}"
|
7
8
|
docker push "dgroup/lazylead:${tag}"
|
8
9
|
echo "dgroup/lazylead:${tag} released"
|
@@ -10,4 +11,6 @@ if [ "${CIRCLE_BRANCH}" == "master" ]; then
|
|
10
11
|
else
|
11
12
|
docker push "dgroup/lazylead:${CIRCLE_BRANCH}"
|
12
13
|
echo "dgroup/lazylead:${CIRCLE_BRANCH} released"
|
13
|
-
fi
|
14
|
+
fi
|
15
|
+
echo "Available LL images:"
|
16
|
+
docker images | grep lazylead
|
data/.docker/Dockerfile
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
FROM ruby:2.6.5-alpine
|
2
2
|
|
3
3
|
ARG release_tags
|
4
|
+
ARG version
|
4
5
|
|
5
6
|
LABEL about="https://github.com/dgroup/lazylead" \
|
6
7
|
ci.contact="yurii.dubinka@gmail.com" \
|
7
8
|
ci.release.tag="${release_tags}" \
|
8
9
|
ll.docker.issues="https://github.com/dgroup/lazylead/issues?utf8=✓&q=label%3Adocker"
|
9
10
|
|
10
|
-
ENV APP_HOME=/lazylead
|
11
|
-
version=${release_tags}
|
11
|
+
ENV APP_HOME=/lazylead
|
12
12
|
|
13
13
|
WORKDIR $APP_HOME
|
14
14
|
|
@@ -23,9 +23,9 @@ COPY Gemfile lazylead.gemspec ./
|
|
23
23
|
RUN bundler install
|
24
24
|
|
25
25
|
COPY bin/lazylead ./bin/lazylead
|
26
|
-
|
27
|
-
|
26
|
+
COPY lib ./lib
|
27
|
+
COPY upgrades ./upgrades
|
28
28
|
|
29
|
-
|
29
|
+
RUN sed -i "s/0\.0\.0/${version}/g" lib/lazylead/version.rb
|
30
30
|
|
31
|
-
|
31
|
+
CMD ["bin/lazylead", "--trace", "--verbose", "--memory-dump"]
|
data/.docker/docker-compose.yml
CHANGED
@@ -10,9 +10,9 @@ services:
|
|
10
10
|
build:
|
11
11
|
context: ../
|
12
12
|
dockerfile: .docker/Dockerfile
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
args:
|
14
|
+
release_tags: "latest 0.1.0"
|
15
|
+
version: "0.1.0"
|
16
16
|
ports:
|
17
17
|
- 82:8080
|
18
18
|
- 1082:1082 # remote debug
|
data/.docker/readme.md
CHANGED
@@ -1,21 +1,24 @@
|
|
1
|
-
#### Docker
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
1
|
+
#### Docker FAQ
|
2
|
+
- Prepare environment
|
3
|
+
````bash
|
4
|
+
docker start <container_name> # start particular container
|
5
|
+
docker start -i <container_name> # start particular container in interactive mode
|
6
|
+
docker stop <container_name> # stop particular container
|
7
|
+
docker ps # display all running containers
|
8
|
+
docker ps -a # display all existing containers (stopped)
|
9
|
+
docker exec -it <container_name> /bin/bash # join to the container via bash
|
10
|
+
docker rm <container_name> # remove particular container
|
11
|
+
docker rmi <image_name> # remove particular image
|
12
|
+
docker pull <image_name> # download particular image from the remote repository (NC Artifactory, dockerhub, etc)
|
13
|
+
````
|
14
|
+
|
15
|
+
- Monitoring
|
16
|
+
```bash
|
17
|
+
# Display on-line information regarding system usage (CPU,RAM,IO) per container
|
18
|
+
docker stats $(docker ps --format '{{.Names}}')
|
19
|
+
docker stats $(docker ps | awk '{if(NR>1) print $NF}')
|
20
|
+
```
|
21
|
+
|
22
|
+
- [Cheat sheet](https://gist.github.com/dgroup/5046bac5531fae11242dd03201626f5b)
|
23
|
+
|
24
|
+
- [Basics](https://github.com/wsargent/docker-cheat-sheet)
|
data/.rultor.yml
CHANGED
@@ -1,31 +1,30 @@
|
|
1
|
+
architect:
|
2
|
+
- dgroup
|
1
3
|
assets:
|
2
|
-
rubygems.yml: dgroup/
|
4
|
+
rubygems.yml: dgroup/home#rubygems.yml
|
5
|
+
circleci.header: dgroup/home#circleci.header
|
3
6
|
install: |
|
4
7
|
export GEM_HOME=~/.ruby
|
5
8
|
export GEM_PATH=$GEM_HOME:$GEM_PATH
|
6
|
-
|
7
|
-
|
8
|
-
sudo gem install pdd -v 0.20.5
|
9
|
+
docker:
|
10
|
+
image: ruby:2.6.5
|
9
11
|
release:
|
10
12
|
script: |-
|
13
|
+
set -e
|
11
14
|
export RUBYOPT="-W0"
|
12
15
|
[[ "${tag}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] || exit -1
|
13
16
|
sed -i "s/0\.0\.0/${tag}/g" lib/lazylead/version.rb
|
17
|
+
sed -i "s/0\.0\.0/${tag}/g" lazylead.gemspec
|
14
18
|
bundle install --no-color
|
15
|
-
rake
|
16
|
-
git add lib/lazylead/version.rb
|
19
|
+
bundle exec rake test rubocop sqlint xcop
|
20
|
+
git add lib/lazylead/version.rb lazylead.gemspec
|
17
21
|
git commit -m "version set to ${tag}"
|
18
22
|
gem build lazylead.gemspec
|
19
23
|
chmod 0600 ../rubygems.yml
|
20
24
|
gem push *.gem --config-file ../rubygems.yml
|
21
|
-
|
22
|
-
- dgroup
|
25
|
+
curl -s -X POST --url "https://circleci.com/api/v2/project/gh/dgroup/lazylead/envvar" -H @../circleci.header -H "accept: application/json" -H "content-type: application/json" -d "{ \"name\": \"DOCKER_RELEASE_TAGS\", \"value\": \"latest ${tag}\" }" -o /dev/null
|
26
|
+
curl -s -X POST --url https://circleci.com/api/v2/project/gh/dgroup/lazylead/pipeline -H @../circleci.header -H 'accept: application/json' -H 'content-type: application/json' -H 'x-attribution-login: dgroup' -o /dev/null
|
23
27
|
merge:
|
24
28
|
script: |-
|
25
29
|
bundle install
|
26
|
-
rake
|
27
|
-
pdd -f /dev/null -v
|
28
|
-
deploy:
|
29
|
-
script: |-
|
30
|
-
echo "There is nothing to deploy"
|
31
|
-
exit -1
|
30
|
+
bundle exec rake test rubocop sqlint xcop
|
data/Rakefile
CHANGED
@@ -26,6 +26,7 @@ require "rubygems"
|
|
26
26
|
require "rake"
|
27
27
|
require "date"
|
28
28
|
require "rdoc"
|
29
|
+
require "rainbow"
|
29
30
|
require "rake/clean"
|
30
31
|
|
31
32
|
# @todo #/DEV Investigate the possibility of using migrations from active_record
|
@@ -44,7 +45,7 @@ def version
|
|
44
45
|
Gem::Specification.load(Dir["*.gemspec"].first).version
|
45
46
|
end
|
46
47
|
|
47
|
-
task default: %i[clean test rubocop xcop copyright]
|
48
|
+
task default: %i[clean test rubocop sqlint xcop copyright docker]
|
48
49
|
|
49
50
|
require "rake/testtask"
|
50
51
|
desc "Run all unit tests"
|
@@ -88,6 +89,42 @@ Xcop::RakeTask.new :xcop do |task|
|
|
88
89
|
task.excludes = %w[target/**/* coverage/**/* wp/**/*]
|
89
90
|
end
|
90
91
|
|
92
|
+
# @todo #/DEV Enable rule "Checks SQL against the ANSI syntax" fully.
|
93
|
+
# Right now all violations related to PRAGMA https://www.sqlite.org/pragma.html
|
94
|
+
# are suppressed as PRAGMA is sqlite specific option.
|
95
|
+
# Potential fix is to move this option into vcs4sql lib and remove from our
|
96
|
+
# sql files.
|
97
|
+
task :sqlint do
|
98
|
+
puts "Running sqlint..."
|
99
|
+
require "sqlint"
|
100
|
+
src = Dir.glob("upgrades/**/*.sql")
|
101
|
+
puts "Inspecting #{src.size} files"
|
102
|
+
total = 0
|
103
|
+
src.each do |f|
|
104
|
+
violations = SQLint::Linter.new(f, File.open(f, "r"))
|
105
|
+
.run
|
106
|
+
.first(1000)
|
107
|
+
.reject { |v| v.message.include? '"PRAGMA"' }
|
108
|
+
violations.each do |v|
|
109
|
+
msg_lines = v.message.split("\n")
|
110
|
+
p [v.filename, v.line, v.column, "#{v.type} #{msg_lines.shift}"].join ":"
|
111
|
+
end
|
112
|
+
total += violations.count { |lint| lint.type == :error }
|
113
|
+
end
|
114
|
+
if total.positive?
|
115
|
+
abort "#{Rainbow(total).red} SQL violations found."
|
116
|
+
else
|
117
|
+
puts "#{src.size} files inspected, #{Rainbow('no offenses').green} detected"
|
118
|
+
end
|
119
|
+
end
|
120
|
+
|
91
121
|
task :clean do
|
92
122
|
Dir.glob("test/resources/**/*.db").each { |f| File.delete(f) }
|
93
123
|
end
|
124
|
+
|
125
|
+
task :docker do
|
126
|
+
puts "Building docker image..."
|
127
|
+
system "docker-compose -f .docker/docker-compose.yml build "\
|
128
|
+
" --build-arg release_tags='latest 1.0'"\
|
129
|
+
" --build-arg version=1.0"
|
130
|
+
end
|
data/lazylead.gemspec
CHANGED
@@ -32,7 +32,7 @@ Gem::Specification.new do |s|
|
|
32
32
|
s.rubygems_version = "2.2"
|
33
33
|
s.required_ruby_version = ">=2.6.5"
|
34
34
|
s.name = "lazylead"
|
35
|
-
s.version = "0.1.
|
35
|
+
s.version = "0.1.2"
|
36
36
|
s.license = "MIT"
|
37
37
|
s.summary = "Eliminate the annoying work within bug-trackers."
|
38
38
|
s.description = "Ticketing systems (Github, Jira, etc.) are strongly
|
@@ -45,7 +45,7 @@ tasks instead of solving technical problems."
|
|
45
45
|
s.authors = ["Yurii Dubinka"]
|
46
46
|
s.email = "yurii.dubinka@gmail.com"
|
47
47
|
s.homepage = "http://github.com/dgroup/lazylead"
|
48
|
-
s.post_install_message = "Thanks for installing Lazylead v0.
|
48
|
+
s.post_install_message = "Thanks for installing Lazylead v0.1.2!
|
49
49
|
Read our blog posts: https://lazylead.org
|
50
50
|
Stay in touch with the community in Telegram: https://t.me/lazylead
|
51
51
|
Follow us on Twitter: https://twitter.com/lazylead
|
@@ -54,7 +54,7 @@ tasks instead of solving technical problems."
|
|
54
54
|
s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
55
55
|
s.test_files = s.files.grep(%r{^(test|features)/})
|
56
56
|
s.rdoc_options = ["--charset=UTF-8"]
|
57
|
-
s.extra_rdoc_files = [
|
57
|
+
s.extra_rdoc_files = %w[readme.md license.txt]
|
58
58
|
s.add_runtime_dependency "activerecord", "6.0.3"
|
59
59
|
s.add_runtime_dependency "backtrace", "0.3"
|
60
60
|
s.add_runtime_dependency "concurrent-ruby", "1.1.5"
|
@@ -101,5 +101,6 @@ tasks instead of solving technical problems."
|
|
101
101
|
s.add_development_dependency "rubocop-minitest", "0.5.1"
|
102
102
|
s.add_development_dependency "rubocop-performance", "1.5.2"
|
103
103
|
s.add_development_dependency "rubocop-rspec", "1.33.0"
|
104
|
+
s.add_development_dependency "sqlint", "0.1.10"
|
104
105
|
s.add_development_dependency "xcop", "0.6"
|
105
106
|
end
|
data/lib/lazylead/version.rb
CHANGED
data/readme.md
CHANGED
@@ -3,7 +3,6 @@
|
|
3
3
|
[![Downloads](https://ruby-gem-downloads-badge.herokuapp.com/lazylead?type=total)](https://rubygems.org/gems/lazylead)
|
4
4
|
[![](https://img.shields.io/docker/pulls/dgroup/lazylead.svg)](https://hub.docker.com/r/dgroup/lazylead "Image pulls")
|
5
5
|
[![](https://images.microbadger.com/badges/image/dgroup/lazylead.svg)](https://microbadger.com/images/dgroup/lazylead "Image layers")
|
6
|
-
[![](https://images.microbadger.com/badges/version/dgroup/lazylead.svg)](https://microbadger.com/images/dgroup/lazylead "Image version")
|
7
6
|
[![Commit activity](https://img.shields.io/github/commit-activity/y/dgroup/lazylead.svg?style=flat-square)](https://github.com/dgroup/lazylead/graphs/commit-activity)
|
8
7
|
[![Hits-of-Code](https://hitsofcode.com/github/dgroup/lazylead)](https://hitsofcode.com/view/github/dgroup/lazylead)
|
9
8
|
[![License: MIT](https://img.shields.io/github/license/mashape/apistatus.svg)](./license.txt)
|
@@ -16,7 +15,6 @@
|
|
16
15
|
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/e1ec2d63ff9040d99c934e3c05c24abe)](https://www.codacy.com/manual/dgroup/lazylead?utm_source=github.com&utm_medium=referral&utm_content=dgroup/lazylead&utm_campaign=Badge_Grade)
|
17
16
|
[![Maintainability](https://api.codeclimate.com/v1/badges/e873a41b1c76d7b2d6ae/maintainability)](https://codeclimate.com/github/dgroup/lazylead/maintainability)
|
18
17
|
[![codecov](https://codecov.io/gh/dgroup/lazylead/branch/master/graph/badge.svg)](https://codecov.io/gh/dgroup/lazylead)
|
19
|
-
[![DepShield Badge](https://depshield.sonatype.org/badges/dgroup/lazylead/depshield.svg)](https://depshield.github.io)
|
20
18
|
|
21
19
|
[![DevOps By Rultor.com](http://www.rultor.com/b/dgroup/lazylead)](http://www.rultor.com/p/dgroup/lazylead)
|
22
20
|
[![EO badge](http://www.elegantobjects.org/badge.svg)](http://www.elegantobjects.org/#principles)
|
@@ -26,7 +24,7 @@ Ticketing systems (Github, Jira, etc.) are strongly integrated into our processe
|
|
26
24
|
|
27
25
|
The idea of automatic management is not new, for example [Zerocracy](https://www.zerocracy.com/) is available on the market.
|
28
26
|
I like this idea, but large companies/projects are not ready yet for such a decisive breakthrough and need step-by-step solutions such as [lazylead](https://github.com/dgroup/lazylead).
|
29
|
-
I think you remember how [static code analysis](https://en.wikipedia.org/wiki/Static_program_analysis) treated at in the past; today we have a huge toolkit (pmd, checkstyle, qulice, rubocop, etc) for each language that allows you to avoid routine issues and remove from the code reviewer the unnecessary load.
|
27
|
+
I think you remember how [static code analysis](https://en.wikipedia.org/wiki/Static_program_analysis) treated at in the past; today we have a huge toolkit (pmd, checkstyle, qulice, rubocop, peon, etc) for each language that allows you to avoid routine issues and remove from the code reviewer the unnecessary load.
|
30
28
|
|
31
29
|
Join our [telegram group](https://t.me/lazyleads) for discussions.
|
32
30
|
|
@@ -51,9 +49,10 @@ Join our [telegram group](https://t.me/lazyleads) for discussions.
|
|
51
49
|
| :---------------------------------------------------- | :-----------: | :----: |
|
52
50
|
| [Microsoft Exchange Server](lib/lazylead/exchange.rb) | Emails | ✅ |
|
53
51
|
| [Microsoft Exchange Server](lib/lazylead/exchange.rb) | Calendar | ⌛ |
|
54
|
-
| [mail.yandex.
|
55
|
-
| [mail.google.
|
56
|
-
|
|
52
|
+
| [mail.yandex.com](lib/lazylead/postman.rb) | Emails | ✅ |
|
53
|
+
| [mail.google.com](lib/lazylead/postman.rb) | Emails | 🌵 |
|
54
|
+
| calendar.google.com | Calendar | ⌛ |
|
55
|
+
| slack.com | Notifications | ⌛ |
|
57
56
|
|
58
57
|
✅ - implemented, ⌛ - planned, 🌵 - implemented, but not tested, ❌ - not supported by ticketing system.
|
59
58
|
|
@@ -65,15 +64,15 @@ New ideas, bugs, suggestions or questions are welcome [via GitHub issues](https:
|
|
65
64
|
Let's assume that:
|
66
65
|
- your team is using jira as a ticketing system
|
67
66
|
- you defined a jira filter with tickets where actions need. The filter id is `555` and it has JQL like
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
67
|
+
```text
|
68
|
+
project=XXXX and type=Bug and status not in (Closed, Cancelled, "Ready For Testing", "On Hold)
|
69
|
+
and parent = YYYY and duedate < startOfDay()
|
70
|
+
```
|
72
71
|
- you have `MS Exchange` server for email notifications
|
73
72
|
- you want to notify your developers during working days at `8am (UTC)` time about tickets where due dates are expired
|
74
73
|
|
75
74
|
For simplicity, we are using [docker-compose](https://docs.docker.com/compose/):
|
76
|
-
1.
|
75
|
+
1. Define yml file with configuration [tasks.yml](.github/tasks.yml)
|
77
76
|
```yml
|
78
77
|
version: '2.3'
|
79
78
|
services:
|
@@ -99,38 +98,40 @@ For simplicity, we are using [docker-compose](https://docs.docker.com/compose/):
|
|
99
98
|
- ./:/lazylead/db
|
100
99
|
# db/ll.db is sqlite file with jira related annoying tasks
|
101
100
|
entrypoint: bin/lazylead --sqlite db/ll.db --trace --verbose
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
101
|
+
```
|
102
|
+
or just download the project using git
|
103
|
+
```bash
|
104
|
+
git clone https://github.com/dgroup/lazylead.git ll && cd ll && pwd && ls -lah
|
105
|
+
```
|
106
|
+
|
107
|
+
2. Create a container, using `docker-compose -f .github/tasks.yml up`
|
108
|
+
The container will stop as there were no tasks provided:
|
109
|
+
```bash
|
110
|
+
ll > docker-compose -f .github/tasks.yml up
|
111
|
+
Creating lazylead ... done
|
112
|
+
Attaching to lazylead
|
113
|
+
lazylead | [2020-06-06T10:35:13] DEBUG Memory footprint at start is 52MB
|
114
|
+
lazylead | [2020-06-06T10:35:13] DEBUG Database: '/lazylead/db/ll.db', sql migration dir: '/lazylead/upgrades/sqlite'
|
115
|
+
lazylead | [2020-06-06T10:35:13] DEBUG Migration applied to /lazylead/db/ll.db from /lazylead/upgrades/sqlite
|
116
|
+
lazylead | [2020-06-06T10:35:13] DEBUG Database connection established
|
117
|
+
lazylead | [2020-06-06T10:35:13] WARN SMTP connection enabled in test mode.
|
118
|
+
lazylead | [2020-06-06T10:35:13] WARN ll-001: No tasks found.
|
119
|
+
lazylead | [2020-06-06T10:35:13] DEBUG Memory footprint at the end is 66MB
|
120
|
+
lazylead exited with code 0
|
121
|
+
ll >
|
122
|
+
```
|
123
|
+
|
124
|
+
3. Define your team and tasks in database.
|
125
|
+
Yes, there are no UI yet, but its planned. Pull requests are welcome!
|
126
|
+
The tables structure defined [here](upgrades/sqlite/001-install-main-lazylead-tables.sql).
|
127
|
+
Modify you [sqlite](https://sqlite.com/index.html) file(`ll.db`) using [DB Browser](https://sqlitebrowser.org/) or any similar tool.
|
128
|
+
Please change the `<youremail.com>` to your email address in order to be in CC when developer get the notification:
|
129
|
+
```sql
|
130
|
+
insert into teams (id, name, properties)
|
130
131
|
values (1, 'Dream team with lazylead', '{}');
|
131
|
-
|
132
|
+
insert into systems(id, properties)
|
132
133
|
values (1,'{"type":"Lazylead::Jira", "username":"${jira_user}", "password":"${jira_password}", "site":"${jira_url}", "context_path":""}');
|
133
|
-
|
134
|
+
insert into tasks (name, cron, enabled, id, system, team_id, action, properties)
|
134
135
|
values ('Expired due dates',
|
135
136
|
'0 8 * * 1-5',
|
136
137
|
'true',
|
@@ -138,30 +139,36 @@ For simplicity, we are using [docker-compose](https://docs.docker.com/compose/):
|
|
138
139
|
'Lazylead::Task::AssigneeAlert',
|
139
140
|
'{"sql":"filter=555", "cc":"<youremail.com>", "subject":"[LL] Expired due dates", "template":"lib/messages/due_date_expired.erb", "postman":"Lazylead::Exchange"}');
|
140
141
|
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
142
|
+
```
|
143
|
+
Yes, for task scheduling we are using [cron](https://crontab.guru).
|
144
|
+
|
145
|
+
4. Once you changed `./ll.db`, please restart the container using `docker-compose -f .github/tasks.yml restart`
|
146
|
+
```bash
|
147
|
+
ll > docker-compose -f .github/tasks.yml restart
|
148
|
+
Restarting lazylead ... done
|
149
|
+
```
|
150
|
+
check the logs and stop container if needed
|
151
|
+
```bash
|
152
|
+
ll > docker logs lazylead
|
151
153
|
2020-06-06T11:37:36] DEBUG Memory footprint at start is 52MB
|
152
154
|
[2020-06-06T11:37:37] DEBUG Database: '/lazylead/db/ll.db', sql migration dir: '/lazylead/upgrades/sqlite'
|
153
155
|
[2020-06-06T11:37:37] DEBUG Migration applied to /lazylead/db/ll.db from /lazylead/upgrades/sqlite
|
154
156
|
[2020-06-06T11:37:37] DEBUG Database connection established
|
155
157
|
[2020-06-06T11:37:37] WARN SMTP connection enabled in test mode.
|
156
158
|
[2020-06-06T11:37:37] DEBUG Task scheduled: id='1', name='Expired due dates', cron='0 8 * * 1-5', system='1', action='Lazylead::Task::AssigneeAlert', team_id='1', description='', enabled='true', properties='{"sql":"filter=555", "cc":"my.email@google.com", "subject":"[LL] Expired due dates", "template":"lib/messages/due_date_expired.erb", "postman":"Lazylead::Exchange"}'
|
157
|
-
|
158
|
-
|
159
|
-
|
159
|
+
...
|
160
|
+
ll > docker stop lazylead
|
161
|
+
lazylead
|
162
|
+
```
|
160
163
|
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
164
|
+
### How to contribute?
|
165
|
+
[![EO badge](http://www.elegantobjects.org/badge.svg)](http://www.elegantobjects.org/#principles)
|
166
|
+
|
167
|
+
Pull requests are welcome! Don't forget to add your name to contribution section and run this, beforehand:
|
168
|
+
```ruby
|
165
169
|
bundle exec rake
|
166
170
|
```
|
167
171
|
Everyone interacting in this project’s codebases, issue trackers, chat rooms is expected to follow the [code of conduct](.github/CODE_OF_CONDUCT.md).
|
172
|
+
|
173
|
+
Contributors:
|
174
|
+
* [dgroup](https://github.com/dgroup) as Yurii Dubinka (yurii.dubinka@gmail.com)
|
@@ -32,19 +32,19 @@
|
|
32
32
|
PRAGMA foreign_keys = ON;
|
33
33
|
create table if not exists teams
|
34
34
|
(
|
35
|
-
id integer primary key
|
35
|
+
id integer primary key,
|
36
36
|
name text not null,
|
37
37
|
properties text
|
38
38
|
);
|
39
39
|
create table if not exists systems
|
40
40
|
(
|
41
|
-
id integer primary key
|
41
|
+
id integer primary key,
|
42
42
|
properties text not null
|
43
43
|
);
|
44
44
|
-- @todo #/DEV task.cron - add regexp verification of cron expression.
|
45
45
|
create table if not exists tasks
|
46
46
|
(
|
47
|
-
id integer primary key
|
47
|
+
id integer primary key,
|
48
48
|
name text not null,
|
49
49
|
cron text not null,
|
50
50
|
-- @todo #/DEV task.cron - add support for non-cron based schedule like at, once, every.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lazylead
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yurii Dubinka
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-06-
|
11
|
+
date: 2020-06-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -654,6 +654,20 @@ dependencies:
|
|
654
654
|
- - '='
|
655
655
|
- !ruby/object:Gem::Version
|
656
656
|
version: 1.33.0
|
657
|
+
- !ruby/object:Gem::Dependency
|
658
|
+
name: sqlint
|
659
|
+
requirement: !ruby/object:Gem::Requirement
|
660
|
+
requirements:
|
661
|
+
- - '='
|
662
|
+
- !ruby/object:Gem::Version
|
663
|
+
version: 0.1.10
|
664
|
+
type: :development
|
665
|
+
prerelease: false
|
666
|
+
version_requirements: !ruby/object:Gem::Requirement
|
667
|
+
requirements:
|
668
|
+
- - '='
|
669
|
+
- !ruby/object:Gem::Version
|
670
|
+
version: 0.1.10
|
657
671
|
- !ruby/object:Gem::Dependency
|
658
672
|
name: xcop
|
659
673
|
requirement: !ruby/object:Gem::Requirement
|
@@ -718,7 +732,6 @@ files:
|
|
718
732
|
- bin/.ruby-version
|
719
733
|
- bin/lazylead
|
720
734
|
- build.sh
|
721
|
-
- deploy.sh
|
722
735
|
- lazylead.gemspec
|
723
736
|
- lib/lazylead.rb
|
724
737
|
- lib/lazylead/allocated.rb
|
@@ -772,7 +785,7 @@ licenses:
|
|
772
785
|
- MIT
|
773
786
|
metadata: {}
|
774
787
|
post_install_message: |-
|
775
|
-
Thanks for installing Lazylead v0.
|
788
|
+
Thanks for installing Lazylead v0.1.2!
|
776
789
|
Read our blog posts: https://lazylead.org
|
777
790
|
Stay in touch with the community in Telegram: https://t.me/lazylead
|
778
791
|
Follow us on Twitter: https://twitter.com/lazylead
|
data/deploy.sh
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
#!/bin/bash
|
2
|
-
set -e
|
3
|
-
set -x
|
4
|
-
|
5
|
-
cd $(dirname $0)
|
6
|
-
bundle update
|
7
|
-
# rake
|
8
|
-
trap 'git reset HEAD~1 && rm bonus.key && git checkout -- .gitignore' EXIT
|
9
|
-
cp /code/home/assets/lazylead/bonus.key .
|
10
|
-
sed -i -s 's|Gemfile.lock||g' .gitignore
|
11
|
-
git add bonus.key
|
12
|
-
git add Gemfile.lock
|
13
|
-
git add .gitignore
|
14
|
-
git commit -m 'configs for heroku'
|
15
|
-
git push heroku master -f
|
16
|
-
|