Skip to content

Commit 80069ee

Browse files
authored
Merge pull request #123 from yknx4/chore/setup-integrations
chore: setup commit integrations
2 parents 24bd19b + d132638 commit 80069ee

File tree

8 files changed

+1073
-38
lines changed

8 files changed

+1073
-38
lines changed

.github/workflows/deployment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ jobs:
2222
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
2323
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
2424
with:
25-
environment: production
25+
environment: prod

.husky/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
_

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npx lint-staged

.husky/prepare-commit-msg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
exec < /dev/tty && node_modules/.bin/cz --hook || true

README.md

Lines changed: 24 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,12 @@
33
![Build Status](https://github.com/yknx4/librecov/actions/workflows/tests.yml/badge.svg)
44
[![Coverage Status](https://www.librecov.com/projects/1/badge.svg)](https://www.librecov.com/projects/1)
55
[![codecov](https://codecov.io/gh/yknx4/librecov/branch/main/graph/badge.svg?token=Q9kaFXoFTn)](https://codecov.io/gh/yknx4/librecov)
6+
[![codebeat badge](https://codebeat.co/badges/c1031e2a-2da1-4bd3-9654-26999b8c6478)](https://codebeat.co/projects/github-com-yknx4-librecov-main)
67

78
LibreCov is a self-hosted opensource test coverage history viewer.
89
It is (mostly) compatible with [coveralls](https://coveralls.io/), so most
910
coverage tools will work easily.
1011

11-
## Demo and screenshots
12-
13-
A demo is available at https://www.librecov.com, you can create an account or login with
14-
15-
* username: user@librecov.com
16-
* password: password123
17-
18-
For "security" reasons, the user is not admin.
19-
NOTE: the demo is on a Heroku free dyno, so it may not always be available and might be very slow.
20-
2112
### Projects list
2213

2314
![projects](https://cloud.githubusercontent.com/assets/1436271/21740030/45ce95d6-d4ef-11e6-8d09-fac4aa7d5f00.png)
@@ -53,13 +44,15 @@ Check [config/local.sample.exs](https://github.com/yknx4/librecov/blob/main/conf
5344
If you already have a database to use, you can simply start the application using docker:
5445

5546
Setup database, run migrations and seeds
47+
5648
```
57-
$ docker run --rm -v /absolute/path/to/local.exs:/librecov/config/local.exs yknx4/librecov mix ecto.setup
49+
docker run --rm -v /absolute/path/to/local.exs:/librecov/config/local.exs yknx4/librecov mix ecto.setup
5850
```
5951

6052
Execute Phoenix Server
53+
6154
```
62-
$ docker run -v /absolute/path/to/local.exs:/librecov/config/local.exs yknx4/librecov
55+
docker run -v /absolute/path/to/local.exs:/librecov/config/local.exs yknx4/librecov
6356
```
6457

6558
This will start the server on the port you set in `local.exs`.
@@ -71,21 +64,21 @@ If you do not have a database, you can start one with `docker` and `docker-compo
7164
Once you have your `docker-compose.yml` and `local.exs` ready, you can run
7265

7366
```
74-
$ docker-compose run librecov mix ecto.setup
75-
$ docker-compose up
67+
docker-compose run librecov mix ecto.setup
68+
docker-compose up
7669
```
7770

7871
### Manually
7972

8073
```
81-
$ git clone https://github.com/yknx4/librecov.git
82-
$ cd librecov
83-
$ cp /path/to/local.exs config/local.exs # local.exs must be in the `config` directory of the app
84-
85-
$ npm install # (or yarn install)
86-
$ mix deps.get
87-
$ mix ecto.setup
88-
$ mix phoenix.server
74+
git clone https://github.com/yknx4/librecov.git
75+
cd librecov
76+
cp /path/to/local.exs config/local.exs # local.exs must be in the `config` directory of the app
77+
78+
npm install # (or yarn install)
79+
mix deps.get
80+
mix ecto.setup
81+
mix phoenix.server
8982
```
9083

9184
This should start LibreCov at port 4000.
@@ -94,7 +87,7 @@ If you want to setup the server for production, you will need to run the above c
9487
with `MIX_ENV=prod` and to run
9588

9689
```
97-
$ mix assets.compile
90+
mix assets.compile
9891
```
9992

10093
before starting the server.
@@ -104,16 +97,16 @@ before starting the server.
10497
You should also be able to deploy to Heroku by simply git pushing this repository.
10598
You will need to set the following environment variables using `heroku config:set`
10699

107-
* `LIBRECOV_PORT`
108-
* `LIBRECOV_SCHEME`
109-
* `SECRET_KEY_BASE`
110-
* `SMTP_USER`
111-
* `SMTP_PASSWORD`
100+
- `LIBRECOV_PORT`
101+
- `LIBRECOV_SCHEME`
102+
- `SECRET_KEY_BASE`
103+
- `SMTP_USER`
104+
- `SMTP_PASSWORD`
112105

113106
You will need to run
114107

115108
```
116-
$ heroku run mix ecto.setup
109+
heroku run mix ecto.setup
117110
```
118111

119112
before you can use your application.
@@ -122,8 +115,8 @@ before you can use your application.
122115

123116
In all setups, `mix ecto.setup` creates the following admin user
124117

125-
* email: admin@example.com
126-
* password: p4ssw0rd
118+
- email: admin@example.com
119+
- password: p4ssw0rd
127120

128121
You should use it for your first login and the change the email and password.
129122

config/prod.exs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@ config Librecov.Plug.Github,
4040

4141
config :sentry,
4242
dsn: System.get_env("SENTRY_DSN"),
43-
environment_name: :prod,
43+
environment_name: System.get_env("RELEASE_LEVEL") || :prod,
4444
enable_source_code_context: true,
4545
root_source_code_path: File.cwd!(),
4646
tags: %{
4747
env: "production"
4848
},
49-
included_environments: [:prod]
49+
included_environments: [:prod, :staging]
5050

5151
config :logger, Sentry.LoggerBackend,
5252
level: :error,

package.json

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
"test": "test"
88
},
99
"scripts": {
10-
"test": "echo \"Error: no test specified\" && exit 1"
10+
"test": "echo \"Error: no test specified\" && exit 1",
11+
"prepare": "husky install"
1112
},
1213
"author": "Daniel Perez <daniel@claudetech.com>",
1314
"license": "MIT",
@@ -18,11 +19,15 @@
1819
"babel-preset-es2015": "^6.18.0",
1920
"babel-runtime": "^6.20.0",
2021
"css-loader": "^0.28.9",
22+
"cz-conventional-changelog": "3.3.0",
2123
"extract-text-webpack-plugin": "^3.0.2",
2224
"file-loader": "^1.1.6",
25+
"husky": ">=6",
2326
"json-loader": "^0.5.3",
2427
"less": "^2.5.3",
2528
"less-loader": "^4.0.5",
29+
"lint-staged": ">=10",
30+
"prettier": "^2.3.2",
2631
"pug": "^2.0.0-rc.4",
2732
"pug-loader": "^2.3.0",
2833
"style-loader": "^0.19.0",
@@ -40,5 +45,14 @@
4045
"lodash": "^4.17.20",
4146
"nib": "^1.1.0",
4247
"riot": "^2.2.4"
48+
},
49+
"lint-staged": {
50+
"*.{js,css,md}": "prettier --write",
51+
"*.{ex,exs}": "mix format"
52+
},
53+
"config": {
54+
"commitizen": {
55+
"path": "./node_modules/cz-conventional-changelog"
56+
}
4357
}
4458
}

0 commit comments

Comments
 (0)