Compare commits

...

114 Commits
0.1.0 ... main

Author SHA1 Message Date
545e8c5476 chore(deps): update rust crate serde to v1.0.214
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-10-29 01:27:46 +00:00
42f23fdfac chore(deps): update rust crate serde to v1.0.213
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-10-23 00:28:22 +00:00
249a40f1aa chore(deps): update rust crate serde to v1.0.210
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-10-17 00:26:58 +00:00
c1187022f2
feat: removed tests for now
All checks were successful
continuous-integration/drone/push Build is passing
Signed-off-by: kjuulh <contact@kjuulh.io>
2024-10-16 21:40:02 +02:00
0fc1438a4a
feat: update deps
All checks were successful
continuous-integration/drone/push Build is passing
Signed-off-by: kjuulh <contact@kjuulh.io>
2024-10-16 21:30:38 +02:00
166be0c289
feat: update
All checks were successful
continuous-integration/drone/push Build is passing
Signed-off-by: kjuulh <contact@kjuulh.io>
2024-04-10 15:48:57 +02:00
cuddle-please
ff9f5e25d2
chore(release): 0.5.0
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
chore: stuff

feat: something

Signed-off-by: kjuulh <contact@kjuulh.io>
2024-04-10 15:47:28 +02:00
9ac744b39d
feat: stuff
All checks were successful
continuous-integration/drone/push Build is passing
2024-04-09 23:31:19 +02:00
9c967a0f31
feat: with rust version
Some checks failed
continuous-integration/drone/push Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
2024-04-09 23:10:12 +02:00
3878e6bc0a
feat: add rust actions
All checks were successful
continuous-integration/drone/push Build is passing
Signed-off-by: kjuulh <contact@kjuulh.io>
2024-04-09 22:57:01 +02:00
cuddle-please
9999fca9b0 chore(release): 0.4.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2024-04-08 21:08:18 +00:00
dad8fc472e
feat: remove comment
All checks were successful
continuous-integration/drone/push Build is passing
Signed-off-by: kjuulh <contact@kjuulh.io>
2024-04-08 23:07:51 +02:00
05ecdf5251
feat: add jq
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
Signed-off-by: kjuulh <contact@kjuulh.io>
2024-04-08 22:52:06 +02:00
12063f7c23
feat: fix tests
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
2024-04-08 22:48:30 +02:00
490130126b
feat: update deps
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
2024-04-08 22:44:14 +02:00
9201ff9294 chore(deps): update all dependencies
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is failing
2024-04-05 14:34:44 +00:00
477d82af55
feat: update chrono
All checks were successful
continuous-integration/drone/push Build is passing
Signed-off-by: kjuulh <contact@kjuulh.io>
2024-03-30 21:32:40 +01:00
d94b9cbe86
feat: remove deps
Some checks failed
continuous-integration/drone/push Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
2024-03-30 21:19:39 +01:00
2b277ec61f
something
All checks were successful
continuous-integration/drone/push Build is passing
2024-03-30 21:17:48 +01:00
3f2642aed0
feat: without dagger
Some checks failed
continuous-integration/drone/push Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
2024-03-30 20:53:08 +01:00
44bc26de93 fix(deps): update rust crate futures to 0.3.30
Some checks failed
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is failing
2023-12-24 14:58:32 +00:00
013bf3b3dc fix(deps): update rust crate futures to 0.3.29
Some checks failed
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is failing
2023-10-26 15:01:40 +00:00
497ae0f19d chore(deps): update rust crate chrono to 0.4.28
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-08-30 20:09:36 +00:00
2dcd9d0cd1 chore(deps): update rust crate chrono to 0.4.27
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-08-29 14:44:14 +00:00
a0634a542b chore(deps): update rust crate clap to 4.4.1
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-08-28 17:27:34 +00:00
036998b0b9 chore(deps): update rust crate url to 2.4.1
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-08-28 10:09:28 +00:00
e92284002a chore(deps): update rust crate regex to 1.9.4
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-08-26 14:37:53 +00:00
69f64bdab2 chore(deps): update rust crate clap to 4.4.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-08-24 16:37:13 +00:00
f624109643 chore(deps): update rust crate reqwest to 0.11.20
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-08-23 21:11:15 +00:00
2404a14a32 chore(deps): update rust crate clap to 4.3.24
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-08-23 14:54:25 +00:00
9a5396a81e chore(deps): update rust crate reqwest to 0.11.19
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-08-21 19:23:22 +00:00
ae0a54db69 chore(deps): update rust crate clap to 4.3.23
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-08-18 21:35:58 +00:00
8e36f2a3ca chore(deps): update all dependencies
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-08-17 14:35:51 +00:00
cuddle-please
384e575758 chore(release): 0.3.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2023-08-13 12:23:58 +00:00
850ada11c2
chore: remove unnused arguments
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-13 14:17:30 +02:00
56d33e2ca5
chore(ci): fix release step
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-13 14:12:52 +02:00
d64a1d15dc
feat(ci): with dagger-rust components
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-13 14:10:40 +02:00
c2e0b548f6
chore: add dagger-rust and dagger-cuddle-please
All checks were successful
continuous-integration/drone/push Build is passing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-13 13:39:59 +02:00
51ca73a53b
fix(git): make sure we always fail on exit code != 0
Some checks reported errors
continuous-integration/drone/push Build was killed
continuous-integration/drone Build is passing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-12 21:48:18 +02:00
675947ed1e
feat: allow v in start of versions
All checks were successful
continuous-integration/drone/push Build is passing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-08 16:15:49 +02:00
bf3593eee4 chore(deps): update rust crate clap to 4.3.21
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-08-08 02:23:16 +00:00
19d748702a chore(deps): update rust crate clap to 4.3.20
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-08-08 01:34:57 +00:00
4276f4529c chore(deps): update rust crate parse-changelog to 0.6.2
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-08-06 10:08:44 +00:00
d287a54cdf chore(deps): update rust crate regex to 1.9.3
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-08-05 22:31:28 +00:00
7baf51c1f2 chore(deps): update rust crate regex to 1.9.2
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-08-05 19:04:56 +00:00
56b44cf2e2
fix(json-edit): with actual arg instead of stupid str replace
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-04 18:56:43 +02:00
2919ca9a04
chore: remove cr
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-04 18:38:11 +02:00
ff2b59dd02
chore(json-edit): clarify errors
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-04 18:37:32 +02:00
19dd0ff636
fix(ci): without token
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-04 18:36:03 +02:00
c08918ad6f
feat(json-edit): added json-edit to update some json content with next global version
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-04 18:32:09 +02:00
19e7adfedb
fix(docs): check fix version
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-04 15:20:05 +02:00
27cb31f433 chore(docs): remove 0.2 checklist
All checks were successful
continuous-integration/drone/push Build is passing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-04 13:05:03 +00:00
113e5282ef
fix(crate): initial pr always included the entire changelog
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-04 15:01:32 +02:00
fa67dfeee3 fix(crate): always prefix with 'v' when creating prs, or releases (#9)
All checks were successful
continuous-integration/drone/push Build is passing
We don't want rust versions to include the 'v',

however, many languages and tools require it. As such we're choosing when to do it, in this case at the api layer.

Signed-off-by: kjuulh <contact@kjuulh.io>
Reviewed-on: #9
Co-authored-by: kjuulh <contact@kjuulh.io>
Co-committed-by: kjuulh <contact@kjuulh.io>
2023-08-04 12:41:31 +00:00
8a8d309ddf chore(release): 0.2.1 (#8)
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
### Docs
- *(check)* 0.2 milestone, forgot for 0.2.0

Co-authored-by: cuddle-please <bot@cuddle.sh>
Reviewed-on: #8
2023-08-04 12:33:10 +00:00
09508ec986
docs(check): 0.2 milestone, forgot for 0.2.0
Some checks failed
continuous-integration/drone/push Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-04 14:22:41 +02:00
0967e35fbf chore(release): 0.2.0 (#7)
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
### Added
- *(ci)* with pr
- *(ci)* on pr only
- *(ci)* with ci:pr.sh file
- *(ci)* update ci with best settings
- *(ci)* pr ignore master
- *(ci)* ignore pr for master
- add git init
- with actual docker login
- with docker login
- back to default
- with ldd
- only ci
- with musl instead
- with some debug stuff
- with shared volume
- with shared volume
- without going into module
- set to use prefix when in ci
- only master
- with working main
- ci:main script for ci
- with run script
- fixed stuff
- with ultra caching
- with ci
- with set -e for abort
- with drone yml
- add mkdocs build
- add basic version
- update with repository
- add publishable to rest
- hack get in control of log level

### Docs
- fix admonitions
- add docs
- remove 0.1 milestone

### Fixed
- with actual install

### Other
- *(rust)* fmt
- *(rust)* clippy fix
- *(ci)* no please for pr
- *(ci)* rename pr -> pull-request in ci:pr
- remove faulty test
- add git (alpine)
- add git
- musl
- remember package name
- rename variable
- openssl-src
- with openssl-dev
- with pkg config sysroot
- with musl dev
- with build-essential
- with libssl-dev
- with token
- add mit license
- add logging to stdout
- update versions
- add docs

Co-authored-by: cuddle-please <bot@cuddle.sh>
Reviewed-on: #7
2023-08-03 23:23:05 +00:00
67c2c0c0c5
chore(rust): fmt
All checks were successful
continuous-integration/drone/push Build is passing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-04 01:19:15 +02:00
78307ec8a3
chore(rust): clippy fix
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-04 01:18:58 +02:00
d6e6dcb032
chore(ci): no please for pr
All checks were successful
continuous-integration/drone/push Build is passing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-04 01:16:41 +02:00
0a7cbae91d
chore(ci): rename pr -> pull-request in ci:pr
All checks were successful
continuous-integration/drone/push Build is passing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-04 01:13:05 +02:00
f94677d78f
feat(ci): with pr
All checks were successful
continuous-integration/drone/push Build is passing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-04 01:10:10 +02:00
2d255c21e6
feat(ci): on pr only
All checks were successful
continuous-integration/drone/push Build is passing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-04 01:04:32 +02:00
8d26c861cc
feat(ci): with ci:pr.sh file
Some checks failed
continuous-integration/drone/push Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-04 01:00:46 +02:00
7d71ad7865
feat(ci): update ci with best settings
Some checks failed
continuous-integration/drone/push Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-04 00:56:11 +02:00
a0b71c66ad
feat(ci): pr ignore master
Some checks failed
continuous-integration/drone/push Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-04 00:55:04 +02:00
358027c850
feat(ci): ignore pr for master
All checks were successful
continuous-integration/drone/push Build is passing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-04 00:52:45 +02:00
6f694fa0b0
chore: remove faulty test
All checks were successful
continuous-integration/drone/push Build is passing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-04 00:43:56 +02:00
914c41f3d5
chore: add git (alpine)
Some checks failed
continuous-integration/drone/push Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-04 00:32:13 +02:00
6c3aca4c29
chore: add git
Some checks failed
continuous-integration/drone/push Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-04 00:31:57 +02:00
14ccba6a7e
feat: add git init
Some checks failed
continuous-integration/drone/push Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-04 00:28:55 +02:00
4c7ea7dae6
feat: with actual docker login
Some checks failed
continuous-integration/drone/push Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-04 00:20:16 +02:00
b00cb42208
feat: with docker login
Some checks failed
continuous-integration/drone/push Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-04 00:17:25 +02:00
7000d4e2a6
chore: musl
Some checks failed
continuous-integration/drone/push Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-04 00:13:30 +02:00
aa00836a29
chore: remember package name
Some checks failed
continuous-integration/drone/push Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-04 00:12:37 +02:00
e7cb032afb
feat: back to default
Some checks failed
continuous-integration/drone/push Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-04 00:12:05 +02:00
5674b6795c
feat: with ldd
Some checks failed
continuous-integration/drone/push Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-04 00:10:05 +02:00
20f2392b4a
chore: rename variable
Some checks failed
continuous-integration/drone/push Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-04 00:08:16 +02:00
ab1fc6d9c0
feat: only ci
Some checks failed
continuous-integration/drone/push Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-04 00:05:14 +02:00
628e842988
chore: openssl-src
Some checks failed
continuous-integration/drone/push Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-04 00:04:39 +02:00
9e125f08e8
chore: with openssl-dev
Some checks failed
continuous-integration/drone/push Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-04 00:03:52 +02:00
22bf047d9c
chore: with pkg config sysroot
Some checks failed
continuous-integration/drone/push Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-04 00:02:13 +02:00
6703e9c58f
chore: with musl dev
Some checks failed
continuous-integration/drone/push Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-04 00:00:19 +02:00
64f8e427e6
chore: with build-essential
Some checks failed
continuous-integration/drone/push Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-03 23:58:53 +02:00
ae14ba84c2
chore: with libssl-dev
Some checks failed
continuous-integration/drone/push Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-03 23:56:20 +02:00
49a9c9f2d4
fix: with actual install
Some checks failed
continuous-integration/drone/push Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-03 23:55:22 +02:00
7a984f0692
feat: with musl instead
Some checks failed
continuous-integration/drone/push Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-03 23:54:44 +02:00
0a7a924727
feat: with some debug stuff
Some checks failed
continuous-integration/drone/push Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-03 23:50:15 +02:00
5dce2e4790
feat: with shared volume
Some checks failed
continuous-integration/drone/push Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-03 23:48:53 +02:00
be27bcfbcd
feat: with shared volume
Some checks reported errors
continuous-integration/drone/push Build encountered an error
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-03 23:48:18 +02:00
b23ca68c62
feat: without going into module
Some checks failed
continuous-integration/drone/push Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-03 23:43:59 +02:00
cf7c006637
chore: with token
Some checks failed
continuous-integration/drone/push Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-03 23:40:50 +02:00
e669434620
feat: set to use prefix when in ci
Some checks failed
continuous-integration/drone/push Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-03 23:39:26 +02:00
be2f9f8330
feat: only master
Some checks failed
continuous-integration/drone/push Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-03 23:36:06 +02:00
34417f77bc
feat: with working main
Some checks failed
continuous-integration/drone/push Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-03 23:31:53 +02:00
8ee05136df
feat: ci:main script for ci
Some checks failed
continuous-integration/drone/push Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-03 16:09:45 +02:00
f7d02bad10
feat: with run script
Some checks failed
continuous-integration/drone/push Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-03 01:04:03 +02:00
5c205d1ac1
feat: fixed stuff
Some checks failed
continuous-integration/drone/push Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-03 01:01:46 +02:00
af821a9d3a
feat: with ultra caching
Some checks failed
continuous-integration/drone/push Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-03 00:46:20 +02:00
c131ebdb7e
feat: with ci
Some checks failed
continuous-integration/drone/push Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-02 16:31:31 +02:00
59ea3603a2
feat: with set -e for abort
Some checks failed
continuous-integration/drone/push Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-02 14:40:58 +02:00
8449ba4735
feat: with drone yml
Some checks failed
continuous-integration/drone Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-02 14:39:15 +02:00
5b1e622434
feat: add mkdocs build
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-02 14:24:43 +02:00
86f96460ee
docs: fix admonitions
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-02 14:16:23 +02:00
decdf5f777
docs: add docs
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-02 14:11:29 +02:00
f7a6ea5d83
feat: add basic version
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-02 12:30:49 +02:00
b6af2378c3
feat: update with repository
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-02 12:25:48 +02:00
0a3c5671d5
feat: add publishable to rest
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-02 12:23:25 +02:00
391defa4ee
chore: add mit license
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-02 12:20:34 +02:00
b4acb55d0c
feat: hack get in control of log level
I haven't found a good way of enabling all of mine, but disabling all of theirs.
as such right now it is a deny list, where some entries reqwest,cliff,hyper is set to
error, and our own is controlled via.

Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-02 00:13:34 +02:00
f75e839759
chore: add logging to stdout
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-01 23:35:09 +02:00
84cc24e81c
docs: remove 0.1 milestone
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-01 22:57:20 +02:00
808f88b8f6
chore: update versions
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-01 22:57:00 +02:00
8db6fc9d75
chore: add docs
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-01 22:56:21 +02:00
46 changed files with 2325 additions and 623 deletions

2
.drone.yml Normal file
View File

@ -0,0 +1,2 @@
kind: template
load: cuddle-rust-cli-plan.yaml

View File

@ -6,6 +6,144 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
## [0.5.0] - 2024-04-09
### Added
- stuff
- with rust version
- add rust actions
## [0.4.0] - 2024-04-08
### Added
- remove comment
- add jq
- fix tests
- update deps
- update chrono
- remove deps
- without dagger
### Fixed
- *(deps)* update rust crate futures to 0.3.30
- *(deps)* update rust crate futures to 0.3.29
### Other
- *(deps)* update all dependencies
- something
- *(deps)* update rust crate chrono to 0.4.28
- *(deps)* update rust crate chrono to 0.4.27
- *(deps)* update rust crate clap to 4.4.1
- *(deps)* update rust crate url to 2.4.1
- *(deps)* update rust crate regex to 1.9.4
- *(deps)* update rust crate clap to 4.4.0
- *(deps)* update rust crate reqwest to 0.11.20
- *(deps)* update rust crate clap to 4.3.24
- *(deps)* update rust crate reqwest to 0.11.19
- *(deps)* update rust crate clap to 4.3.23
- *(deps)* update all dependencies
## [0.3.0] - 2023-08-13
### Added
- *(ci)* with dagger-rust components
- allow v in start of versions
- *(json-edit)* added json-edit to update some json content with next global version
### Fixed
- *(git)* make sure we always fail on exit code != 0
- *(json-edit)* with actual arg instead of stupid str replace
- *(ci)* without token
- *(docs)* check fix version
- *(crate)* initial pr always included the entire changelog
- *(crate)* always prefix with 'v' when creating prs, or releases (#9)
### Other
- remove unnused arguments
- *(ci)* fix release step
- add dagger-rust and dagger-cuddle-please
- *(deps)* update rust crate clap to 4.3.21
- *(deps)* update rust crate clap to 4.3.20
- *(deps)* update rust crate parse-changelog to 0.6.2
- *(deps)* update rust crate regex to 1.9.3
- *(deps)* update rust crate regex to 1.9.2
- remove cr
- *(json-edit)* clarify errors
- *(docs)* remove 0.2 checklist
## [0.2.1] - 2023-08-04
### Docs
- *(check)* 0.2 milestone, forgot for 0.2.0
## [0.2.0] - 2023-08-03
### Added
- *(ci)* with pr
- *(ci)* on pr only
- *(ci)* with ci:pr.sh file
- *(ci)* update ci with best settings
- *(ci)* pr ignore master
- *(ci)* ignore pr for master
- add git init
- with actual docker login
- with docker login
- back to default
- with ldd
- only ci
- with musl instead
- with some debug stuff
- with shared volume
- with shared volume
- without going into module
- set to use prefix when in ci
- only master
- with working main
- ci:main script for ci
- with run script
- fixed stuff
- with ultra caching
- with ci
- with set -e for abort
- with drone yml
- add mkdocs build
- add basic version
- update with repository
- add publishable to rest
- hack get in control of log level
### Docs
- fix admonitions
- add docs
- remove 0.1 milestone
### Fixed
- with actual install
### Other
- *(rust)* fmt
- *(rust)* clippy fix
- *(ci)* no please for pr
- *(ci)* rename pr -> pull-request in ci:pr
- remove faulty test
- add git (alpine)
- add git
- musl
- remember package name
- rename variable
- openssl-src
- with openssl-dev
- with pkg config sysroot
- with musl dev
- with build-essential
- with libssl-dev
- with token
- add mit license
- add logging to stdout
- update versions
- add docs
## [0.1.0] - 2023-08-01
### Added

1504
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -1,30 +1,39 @@
[workspace]
members = ["crates/cuddle-please", "crates/cuddle-please-frontend", "crates/cuddle-please-commands", "crates/cuddle-please-misc"]
members = [
"crates/*"
]
resolver = "2"
[workspace.dependencies]
cuddle-please = { path = "crates/cuddle-please" }
cuddle-please-frontend = { path = "crates/cuddle-please-frontend" }
cuddle-please-commands = { path = "crates/cuddle-please-commands" }
cuddle-please-misc = { path = "crates/cuddle-please-misc" }
cuddle-please = { path = "crates/cuddle-please", version = "0.1.0" }
cuddle-please-frontend = { path = "crates/cuddle-please-frontend", version = "0.1.0" }
cuddle-please-commands = { path = "crates/cuddle-please-commands", version = "0.1.0" }
cuddle-please-misc = { path = "crates/cuddle-please-misc", version = "0.1.0" }
cuddle-please-release-strategy = { path = "crates/cuddle-please-release-strategy", version = "0.1.0" }
cuddle-please-actions = { path = "crates/cuddle-please-actions", version = "0.1.0" }
anyhow = { version = "1.0.72" }
anyhow = { version = "1.0.81" }
tracing = { version = "0.1", features = ["log"] }
tracing-subscriber = { version = "0.3.17" }
clap = { version = "4.3.19", features = ["derive", "env"] }
tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }
clap = { version = "4.5.4", features = ["derive", "env"] }
dotenv = { version = "0.15.0" }
url = { version = "2.4.0" }
serde_yaml = { version = "0.9.25" }
url = { version = "2.5.0" }
serde_yaml = { version = "0.9.34+deprecated" }
yaml-rust2 = {version = "0.8.0"}
serde = { version = "1", features = ["derive"] }
semver = "1.0.18"
semver = "1.0.22"
conventional_commit_parser = "0.9.4"
tempdir = "0.3.7"
reqwest = { version = "0.11.18" }
git-cliff-core = "1.2.0"
regex = "*"
chrono = "*"
lazy_static = "*"
parse-changelog = "*"
reqwest = { version = "0.12.3" }
git-cliff-core = "2.2.0"
regex = "1.10.4"
chrono = "0.4.37"
lazy_static = "1.4.0"
parse-changelog = "0.6.6"
toml_edit = "0.22.9"
tracing-test = "0.2"
pretty_assertions = "1.4"
[workspace.package]
version = "0.5.0"

7
LICENSE Normal file
View File

@ -0,0 +1,7 @@
Copyright 2023 Kasper J. Hermansen
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@ -36,32 +36,16 @@ See docs for more information about installation and some such
## Checklist
### 0.1 Milestone
- [x] Hide unneccessary commands
- [x] Redo configuration frontend
- [x] Refactor command.rs into smaller bits so that bits are easier to test
- [x] Add cuddle.release.yaml to this repo
- [x] Setup temporary git name and email to use for git committing
### 0.2 Milestone
- [ ] Add docs
- [ ] Add asciinema
- [ ] Add examples
- [ ] Fx drone config
- [ ] Releaser
- [ ] On main/master
- [ ] Add reporter for PR and Repositories
- [ ] tbd...
### 0.3 Milestone
- [x] Fix: 0.0.0 -> **v**0.0.0
- [ ] Add release strategies
- [ ] Add reporter for PR and Repositories
- [ ] Add inquire for missing values when needed (when not running in ci or have a proper tty)
- [ ] Break down cuddle-please-misc
- [ ] ci(release): Add cuddle-please release artifacts for the different os and so on.
### 0.x Milestone
- [ ] Add github support
- [ ] Add custom strategies
- [ ] Create docker image
- [ ] Add more granular tests

View File

@ -0,0 +1,19 @@
[package]
name = "cuddle-please-actions"
description = "A release-please inspired release manager tool, built on top of cuddle, but also useful standalone, cuddle-please supports, your ci of choice, as well as gitea, github"
repository = "https://git.front.kjuulh.io/kjuulh/cuddle-please"
readme = "../../README.md"
license-file = "../../LICENSE"
version = "0.1.0"
edition = "2021"
publishable = true
[dependencies]
anyhow.workspace = true
tracing.workspace = true
semver.workspace = true
toml_edit.workspace = true
yaml-rust2.workspace = true
[dev-dependencies]
pretty_assertions.workspace = true

View File

@ -0,0 +1,9 @@
use semver::Version;
use crate::ActionConfig;
pub trait Action {
fn enabled(&self, config: &ActionConfig) -> anyhow::Result<bool>;
fn name(&self) -> String;
fn execute(&self, version: &Version) -> anyhow::Result<()>;
}

View File

@ -0,0 +1,49 @@
use std::ops::Deref;
use anyhow::Context;
pub enum ActionConfig {
Actual { doc: yaml_rust2::Yaml },
None,
}
impl Deref for ActionConfig {
type Target = yaml_rust2::Yaml;
fn deref(&self) -> &Self::Target {
match &self {
ActionConfig::Actual { doc } => doc,
ActionConfig::None => &yaml_rust2::Yaml::BadValue,
}
}
}
impl TryFrom<&str> for ActionConfig {
type Error = anyhow::Error;
fn try_from(value: &str) -> Result<Self, Self::Error> {
let mut cuddle = yaml_rust2::YamlLoader::load_from_str(value)?;
if cuddle.len() != 1 {
anyhow::bail!("cuddle.yaml can only be 1 document wide");
}
let doc = cuddle.pop().unwrap();
let doc = doc["please"]["actions"].clone();
if doc.is_badvalue() {
return Ok(Self::None);
}
Ok(Self::Actual { doc })
}
}
impl ActionConfig {
pub fn parse() -> anyhow::Result<Self> {
let cuddle_yaml =
std::fs::read_to_string("cuddle.yaml").context("failed to read cuddle.yaml")?;
Self::try_from(cuddle_yaml.as_str())
}
}

View File

@ -0,0 +1,45 @@
pub(crate) mod actions;
mod config;
mod rust_action;
use std::{ops::Deref, sync::Arc};
use catalog::RustAction;
pub use config::ActionConfig;
use semver::Version;
pub mod catalog {
pub use crate::rust_action::*;
}
pub struct Action(Arc<dyn actions::Action>);
impl Deref for Action {
type Target = Arc<dyn actions::Action>;
fn deref(&self) -> &Self::Target {
&self.0
}
}
pub struct Actions(Vec<Action>);
impl Actions {
pub fn from_cuddle() -> anyhow::Result<Self> {
let config = ActionConfig::parse()?;
Ok(Self(
vec![Action(Arc::new(RustAction::new()))]
.into_iter()
.filter(|a| a.enabled(&config).unwrap_or_default())
.collect(),
))
}
pub fn execute(&self, version: &Version) -> anyhow::Result<()> {
for action in &self.0 {
action.execute(version)?;
}
Ok(())
}
}

View File

@ -0,0 +1,237 @@
use std::io::Write;
use anyhow::Context;
use crate::{actions::Action, ActionConfig};
#[derive(Default, Clone)]
pub struct RustAction {}
impl RustAction {
pub fn new() -> Self {
Self {}
}
fn execute_content(
&self,
version: &semver::Version,
cargo_content: &str,
) -> anyhow::Result<String> {
tracing::trace!("parsing Cargo.toml file as tolm");
let mut cargo_doc = cargo_content.parse::<toml_edit::DocumentMut>()?;
tracing::debug!(
"updating cargo workspace package version to {}",
version.to_string()
);
let workspace = if cargo_doc.contains_table("workspace") {
cargo_doc["workspace"].as_table_mut().unwrap()
} else {
let mut t = toml_edit::Table::new();
t.set_implicit(true);
cargo_doc["workspace"] = toml_edit::Item::Table(t);
cargo_doc["workspace"].as_table_mut().unwrap()
};
let package = workspace["package"].or_insert(toml_edit::table());
package["version"] = toml_edit::value(version.to_string());
Ok(cargo_doc.to_string())
}
}
impl Action for RustAction {
fn enabled(&self, config: &ActionConfig) -> anyhow::Result<bool> {
if let Ok(v) = std::env::var("CUDDLE_PLEASE_RUST_ACTION") {
if let Ok(true) = v.parse::<bool>() {
return Ok(true);
}
}
let val = &config[self.name().as_str()];
if val.is_badvalue() {
return Ok(false);
}
Ok(val.as_bool().unwrap_or(true))
}
fn name(&self) -> String {
"rust".into()
}
fn execute(&self, version: &semver::Version) -> anyhow::Result<()> {
tracing::info!(
"running rust action for version: {} and file: Cargo.toml",
version.to_string()
);
let path = std::path::PathBuf::from("Cargo.toml");
tracing::trace!("reading Cargo.toml");
let file = match std::fs::read_to_string(&path) {
Ok(file) => file,
Err(e) => match e.kind() {
std::io::ErrorKind::NotFound => {
anyhow::bail!("err: Cargo.toml was not found in dir")
}
_ => Err(e)?,
},
};
let cargo_doc = self.execute_content(version, &file)?;
let mut cargo_file = std::fs::File::create(&path)?;
cargo_file.write_all(cargo_doc.as_bytes())?;
cargo_file.sync_all()?;
tracing::debug!("finished writing cargo file");
Ok(())
}
}
#[cfg(test)]
mod test {
use semver::{BuildMetadata, Prerelease};
use crate::{actions::Action, ActionConfig};
use super::RustAction;
#[test]
fn test_is_enabled() {
let config = ActionConfig::try_from(
r#"
please:
actions:
rust: true
"#,
)
.unwrap();
let enabled = RustAction::new().enabled(&config).unwrap();
assert!(enabled)
}
#[test]
fn test_is_disabled_by_default() {
let config = ActionConfig::try_from(
r#"
please:
"#,
)
.unwrap();
let enabled = RustAction::new().enabled(&config).unwrap();
assert!(!enabled)
}
#[test]
fn test_is_disabled() {
let config = ActionConfig::try_from(
r#"
please:
actions:
rust: false
"#,
)
.unwrap();
let enabled = RustAction::new().enabled(&config).unwrap();
assert!(!enabled)
}
#[test]
fn test_missing_value_is_enabled() {
let config = ActionConfig::try_from(
r#"
please:
actions:
rust:
"#,
)
.unwrap();
let enabled = RustAction::new().enabled(&config).unwrap();
assert!(enabled)
}
#[test]
fn test_can_edit_empty_file() {
let output = RustAction::default()
.execute_content(
&semver::Version {
major: 0,
minor: 1,
patch: 0,
pre: Prerelease::default(),
build: BuildMetadata::default(),
},
"",
)
.unwrap();
pretty_assertions::assert_eq!(
r#"[workspace.package]
version = "0.1.0"
"#,
&output,
)
}
#[test]
fn test_only_edits_stuff() {
let input = r#"
[workspace]
members = ["."]
[package]
something = {some = "something"}
# Some comment
[workspace.package]
version = "0.0.0" # some comment
readme = "../../"
"#;
let output = RustAction::default()
.execute_content(
&semver::Version {
major: 0,
minor: 1,
patch: 0,
pre: Prerelease::default(),
build: BuildMetadata::default(),
},
input,
)
.unwrap();
pretty_assertions::assert_eq!(
r#"
[workspace]
members = ["."]
[package]
something = {some = "something"}
# Some comment
[workspace.package]
version = "0.1.0"
readme = "../../"
"#,
&output,
)
}
}

View File

@ -1,12 +1,18 @@
[package]
name = "cuddle-please-commands"
description = "A release-please inspired release manager tool, built on top of cuddle, but also useful standalone, cuddle-please supports, your ci of choice, as well as gitea, github"
repository = "https://git.front.kjuulh.io/kjuulh/cuddle-please"
readme = "../../README.md"
license-file = "../../LICENSE"
version = "0.1.0"
edition = "2021"
publishable = true
[dependencies]
cuddle-please-frontend.workspace = true
cuddle-please-misc.workspace = true
cuddle-please-actions.workspace = true
anyhow.workspace = true
tracing.workspace = true

View File

@ -6,11 +6,14 @@ use std::{
};
use clap::{Parser, Subcommand};
use cuddle_please_actions::Actions;
use cuddle_please_frontend::{gatheres::ConfigArgs, PleaseConfig, PleaseConfigBuilder};
use cuddle_please_misc::{
ConsoleUi, DynRemoteGitClient, DynUi, GiteaClient, GlobalArgs, LocalGitClient, StdinFn,
VcsClient,
};
use tracing::Level;
use tracing_subscriber::EnvFilter;
use crate::{
config_command::{ConfigCommand, ConfigCommandHandler},
@ -88,31 +91,62 @@ impl Command {
}
pub fn execute(self, current_dir: Option<&Path>) -> anyhow::Result<()> {
let config = self.build_config(current_dir)?;
let git_client = self.get_git(&config)?;
let gitea_client = self.get_gitea_client(&config);
match &self.commands {
Some(Commands::Release {}) => {
ReleaseCommandHandler::new(self.ui, config, git_client, gitea_client)
if let Some(c) = &self.commands {
match c {
Commands::Release {} => {
let (config, git_client, gitea_client, actions) = self.get_deps(current_dir)?;
ReleaseCommandHandler::new(self.ui, config, git_client, gitea_client, actions)
.execute(self.global.dry_run)?;
}
Some(Commands::Config { command }) => {
Commands::Config { command } => {
let (config, _, _, _) = self.get_deps(current_dir)?;
ConfigCommandHandler::new(self.ui, config).execute(command)?;
}
Some(Commands::Gitea { command }) => {
Commands::Gitea { command } => {
let (config, _, gitea_client, _) = self.get_deps(current_dir)?;
GiteaCommandHandler::new(self.ui, config, gitea_client)
.execute(command, self.global.token.expect("token to be set").deref())?;
}
Some(Commands::Doctor {}) => {
Commands::Doctor {} => {
DoctorCommandHandler::new(self.ui).execute()?;
}
None => {}
}
}
Ok(())
}
fn get_deps(
&self,
current_dir: Option<&Path>,
) -> anyhow::Result<(PleaseConfig, VcsClient, DynRemoteGitClient, Actions)> {
let config = self.build_config(current_dir)?;
let git_client =
self.get_git(&config, self.global.token.clone().expect("token to be set"))?;
let gitea_client = self.get_gitea_client(&config);
let filter = match self.global.log_level {
cuddle_please_misc::LogLevel::None => None,
cuddle_please_misc::LogLevel::Trace => Some(Level::TRACE),
cuddle_please_misc::LogLevel::Debug => Some(Level::DEBUG),
cuddle_please_misc::LogLevel::Info => Some(Level::INFO),
cuddle_please_misc::LogLevel::Error => Some(Level::ERROR),
};
if let Some(filter) = filter {
let env_filter = EnvFilter::builder().with_regex(false).parse(format!(
"{},hyper=error,reqwest=error,git_cliff_core=error",
filter
))?;
tracing_subscriber::fmt().with_env_filter(env_filter).init();
}
let actions = self.get_actions()?;
Ok((config, git_client, gitea_client, actions))
}
fn build_config(&self, current_dir: Option<&Path>) -> Result<PleaseConfig, anyhow::Error> {
let mut builder = &mut PleaseConfigBuilder::new();
if self.global.config_stdin {
@ -131,7 +165,7 @@ impl Command {
Ok(config)
}
fn get_git(&self, config: &PleaseConfig) -> anyhow::Result<VcsClient> {
fn get_git(&self, config: &PleaseConfig, token: String) -> anyhow::Result<VcsClient> {
if self.global.no_vcs {
Ok(VcsClient::new_noop())
} else {
@ -139,6 +173,7 @@ impl Command {
config.get_source(),
config.settings.git_username.clone(),
config.settings.git_email.clone(),
token,
)
}
}
@ -152,6 +187,10 @@ impl Command {
)),
}
}
fn get_actions(&self) -> anyhow::Result<Actions> {
Actions::from_cuddle()
}
}
#[derive(Debug, Clone, Subcommand)]

View File

@ -1,3 +1,4 @@
use cuddle_please_actions::Actions;
use cuddle_please_frontend::PleaseConfig;
use ::semver::Version;
@ -13,6 +14,7 @@ pub struct ReleaseCommandHandler {
config: PleaseConfig,
git_client: VcsClient,
gitea_client: DynRemoteGitClient,
actions: Actions,
}
impl ReleaseCommandHandler {
@ -21,12 +23,14 @@ impl ReleaseCommandHandler {
config: PleaseConfig,
git_client: VcsClient,
gitea_client: DynRemoteGitClient,
actions: Actions,
) -> Self {
Self {
ui,
config,
git_client,
gitea_client,
actions,
}
}
@ -37,15 +41,24 @@ impl ReleaseCommandHandler {
let branch = self.config.get_branch();
let source = self.config.get_source();
self.ui.write_str_ln("running releaser");
self.check_git_remote_connection(owner, repository)?;
tracing::trace!("connected to git remote");
let significant_tag = self.get_most_significant_tag(owner, repository)?;
tracing::trace!("found lastest release tag");
let commits =
self.fetch_commits_since_last_tag(owner, repository, &significant_tag, branch)?;
tracing::trace!("fetched commits since last version");
let current_version = get_current_version(significant_tag);
tracing::trace!("found current version: {}", current_version.to_string());
self.ui
.write_str_ln(&format!("found current version: {}", current_version));
let conventional_commit_results = parse_conventional_commits(current_version, commits)?;
tracing::trace!("parsing conventional commits");
if conventional_commit_results.is_none() {
tracing::debug!("found no new commits, aborting early");
self.ui
@ -53,12 +66,19 @@ impl ReleaseCommandHandler {
return Ok(());
}
let (commit_strs, next_version) = conventional_commit_results.unwrap();
self.ui
.write_str_ln(&format!("calculated next version: {}", next_version));
tracing::trace!("creating changelog");
let (changelog_placement, changelog, changelog_last_changes) =
compose_changelog(&commit_strs, &next_version, source)?;
self.actions.execute(&next_version)?;
if let Some(first_commit) = commit_strs.first() {
if first_commit.contains("chore(release): ") {
tracing::trace!("creating release");
self.ui.write_str_ln("creating release");
self.create_release(
dry_run,
owner,
@ -71,6 +91,7 @@ impl ReleaseCommandHandler {
}
}
tracing::trace!("creating pull-request");
self.create_pull_request(
changelog_placement,
changelog,
@ -93,7 +114,7 @@ impl ReleaseCommandHandler {
next_version: &Version,
changelog_last_changes: Option<String>,
) -> Result<(), anyhow::Error> {
Ok(if !dry_run {
if !dry_run {
self.gitea_client.create_release(
owner,
repository,
@ -103,7 +124,8 @@ impl ReleaseCommandHandler {
)?;
} else {
tracing::debug!("creating release (dry_run)");
})
};
Ok(())
}
fn create_pull_request(
@ -117,18 +139,24 @@ impl ReleaseCommandHandler {
changelog_last_changes: Option<String>,
branch: &str,
) -> Result<(), anyhow::Error> {
self.ui
.write_str_ln("creating and checking out release branch");
self.git_client.checkout_branch()?;
std::fs::write(changelog_placement, changelog.as_bytes())?;
self.ui.write_str_ln("committed changelog files");
self.git_client
.commit_and_push(next_version.to_string(), dry_run)?;
let _pr_number = match self.gitea_client.get_pull_request(owner, repository)? {
Some(existing_pr) => {
self.ui.write_str_ln("found existing pull request");
self.ui.write_str_ln("updating pull request");
if !dry_run {
self.gitea_client.update_pull_request(
owner,
repository,
&next_version.to_string(),
&changelog_last_changes.unwrap(),
&changelog_last_changes
.ok_or(anyhow::anyhow!("could not get the latest changes"))?,
existing_pr,
)?
} else {
@ -137,12 +165,14 @@ impl ReleaseCommandHandler {
}
}
None => {
self.ui.write_str_ln("creating pull request");
if !dry_run {
self.gitea_client.create_pull_request(
owner,
repository,
&next_version.to_string(),
&changelog,
&changelog_last_changes
.ok_or(anyhow::anyhow!("could not get the latest changes"))?,
branch,
)?
} else {
@ -177,7 +207,7 @@ impl ReleaseCommandHandler {
) -> Result<Option<Tag>, anyhow::Error> {
let tags = self.gitea_client.get_tags(owner, repository)?;
let significant_tag = get_most_significant_version(tags.iter().collect());
Ok(significant_tag.map(|t| t.clone()))
Ok(significant_tag.cloned())
}
fn check_git_remote_connection(
@ -227,8 +257,7 @@ fn parse_conventional_commits(
}
fn get_current_version(significant_tag: Option<Tag>) -> Version {
let current_version = significant_tag
significant_tag
.map(|st| Version::try_from(st).unwrap())
.unwrap_or(Version::new(0, 0, 0));
current_version
.unwrap_or(Version::new(0, 0, 0))
}

View File

@ -1,7 +1,12 @@
[package]
name = "cuddle-please-frontend"
description = "A release-please inspired release manager tool, built on top of cuddle, but also useful standalone, cuddle-please supports, your ci of choice, as well as gitea, github"
repository = "https://git.front.kjuulh.io/kjuulh/cuddle-please"
readme = "../../README.md"
license-file = "../../LICENSE"
version = "0.1.0"
edition = "2021"
publishable = true
[dependencies]
anyhow.workspace = true

View File

@ -30,12 +30,9 @@ const CUDDLE_CONFIG_FILE_NAME: &str = "cuddle.please";
const YAML_EXTENSION: &str = "yaml";
pub fn get_config_from_config_file(current_dir: &Path) -> PleaseConfigBuilder {
let current_cuddle_path = current_dir
.clone()
.join(format!("{CUDDLE_FILE_NAME}.{YAML_EXTENSION}"));
let current_cuddle_config_path = current_dir
.clone()
.join(format!("{CUDDLE_CONFIG_FILE_NAME}.{YAML_EXTENSION}"));
let current_cuddle_path = current_dir.join(format!("{CUDDLE_FILE_NAME}.{YAML_EXTENSION}"));
let current_cuddle_config_path =
current_dir.join(format!("{CUDDLE_CONFIG_FILE_NAME}.{YAML_EXTENSION}"));
let mut please_config = PleaseConfigBuilder::default();
if let Some(config) = get_config_from_file::<CuddleEmbeddedPleaseConfig>(current_cuddle_path) {

View File

@ -1,7 +1,12 @@
[package]
name = "cuddle-please-misc"
description = "A release-please inspired release manager tool, built on top of cuddle, but also useful standalone, cuddle-please supports, your ci of choice, as well as gitea, github"
repository = "https://git.front.kjuulh.io/kjuulh/cuddle-please"
readme = "../../README.md"
license-file = "../../LICENSE"
version = "0.1.0"
edition = "2021"
publishable = true
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View File

@ -52,6 +52,15 @@ config-stdin will consume stdin until the channel is closed via. EOF"
default_value = "gitea"
)]
pub engine: RemoteEngine,
#[arg(
env = "CUDDLE_PLEASE_LOG_LEVEL",
long,
global = true,
help_heading = "Global",
default_value = "none"
)]
pub log_level: LogLevel,
}
#[derive(ValueEnum, Clone, Debug)]
@ -59,3 +68,11 @@ pub enum RemoteEngine {
Local,
Gitea,
}
#[derive(ValueEnum, Clone, Debug)]
pub enum LogLevel {
None,
Trace,
Debug,
Info,
Error,
}

View File

@ -3,7 +3,7 @@ use chrono::{DateTime, NaiveDate, Utc};
use git_cliff_core::{
changelog::Changelog,
commit::Commit,
config::{ChangelogConfig, CommitParser, Config, GitConfig},
config::{Bump, ChangelogConfig, CommitParser, Config, GitConfig, Remote, RemoteConfig},
release::Release,
};
use regex::Regex;
@ -77,6 +77,8 @@ impl ChangeLogBuilder {
commit_id: None,
timestamp,
previous: None,
message: None,
repository: None,
},
config: self.config,
release_link: self.release_link,
@ -86,7 +88,7 @@ impl ChangeLogBuilder {
fn release_timestamp(&self) -> i64 {
self.release_date
.and_then(|date| date.and_hms_opt(0, 0, 0))
.map(|d| DateTime::<Utc>::from_utc(d, Utc))
.map(|d| DateTime::<Utc>::from_naive_utc_and_offset(d, Utc))
.unwrap_or_else(Utc::now)
.timestamp()
}
@ -139,6 +141,8 @@ impl ChangeLog<'_> {
let config = Config {
changelog: default_changelog_config(None, self.release_link.as_deref()),
git: default_git_config(),
remote: RemoteConfig::default(),
bump: Bump::default(),
};
config
@ -148,6 +152,8 @@ impl ChangeLog<'_> {
let config = Config {
changelog: default_changelog_config(header, self.release_link.as_deref()),
git: default_git_config(),
remote: RemoteConfig::default(),
bump: Bump::default(),
};
config
@ -173,6 +179,10 @@ fn default_commit_parsers() -> Vec<CommitParser> {
default_scope: None,
scope: None,
skip: None,
field: None,
pattern: None,
sha: None,
footer: None,
}
}
@ -183,6 +193,7 @@ fn default_commit_parsers() -> Vec<CommitParser> {
create_commit_parser("removed", "removed"),
create_commit_parser("fix", "fixed"),
create_commit_parser("security", "security"),
create_commit_parser("docs", "docs"),
CommitParser {
message: Regex::new(".*").ok(),
group: Some(String::from("other")),
@ -190,6 +201,10 @@ fn default_commit_parsers() -> Vec<CommitParser> {
default_scope: None,
skip: None,
scope: None,
field: None,
pattern: None,
sha: None,
footer: None,
},
]
}
@ -209,6 +224,7 @@ fn default_changelog_config(header: Option<String>, release_link: Option<&str>)
body: Some(default_changelog_body_config(release_link)),
footer: None,
trim: Some(true),
postprocessors: None,
}
}

View File

@ -7,6 +7,7 @@ pub enum VcsClient {
source: PathBuf,
username: String,
email: String,
token: String,
},
}
@ -19,6 +20,7 @@ impl VcsClient {
path: &Path,
git_username: Option<impl Into<String>>,
git_email: Option<impl Into<String>>,
git_token: String,
) -> anyhow::Result<VcsClient> {
if !path.to_path_buf().join(".git").exists() {
anyhow::bail!("git directory not found in: {}", path.display().to_string())
@ -32,6 +34,7 @@ impl VcsClient {
email: git_email
.map(|e| e.into())
.unwrap_or("bot@cuddle.sh".to_string()),
token: git_token,
})
}
@ -56,10 +59,15 @@ impl VcsClient {
source,
username,
email,
token,
} => {
let checkout_branch = std::process::Command::new("git")
.current_dir(source.as_path())
.args(&[
.args([
"-c",
&format!("http.extraHeader='Authorization: token {}'", token),
"-c",
"http.extraHeader='Sudo: kjuulh'",
"-c",
&format!("user.name={}", username),
"-c",
@ -71,6 +79,13 @@ impl VcsClient {
let stdout = std::str::from_utf8(&checkout_branch.stdout)?;
let stderr = std::str::from_utf8(&checkout_branch.stderr)?;
tracing::debug!(stdout = stdout, stderr = stderr, "git {}", args.join(" "));
let exit_code = checkout_branch.status;
if !exit_code.success() {
anyhow::bail!(
"failed to run git command: {}",
exit_code.code().unwrap_or(-1)
)
}
}
}

View File

@ -330,7 +330,7 @@ impl RemoteGitEngine for GiteaClient {
base: base.into(),
body: body.into(),
head: "cuddle-please/release".into(),
title: format!("chore(release): {}", version),
title: format!("chore(release): v{}", version),
};
tracing::trace!(
@ -377,7 +377,7 @@ impl RemoteGitEngine for GiteaClient {
let request = CreatePullRequestOption {
body: body.into(),
title: format!("chore(release): {}", version),
title: format!("chore(release): v{}", version),
};
tracing::trace!(
@ -429,9 +429,9 @@ impl RemoteGitEngine for GiteaClient {
let request = CreateReleaseOption {
body: body.into(),
draft: false,
name: version.into(),
name: format!("v{version}"),
prerelease,
tag_name: version.into(),
tag_name: format!("v{version}"),
};
tracing::trace!(
@ -517,6 +517,7 @@ impl TryFrom<Tag> for Version {
tracing::trace!(name = &value.name, "parsing tag into version");
value
.name
.trim_start_matches("v")
.parse::<Version>()
.context("could not get version from tag")
}

View File

@ -6,7 +6,7 @@ mod local_git_client;
mod ui;
mod versioning;
pub use args::{GlobalArgs, RemoteEngine, StdinFn};
pub use args::{GlobalArgs, LogLevel, RemoteEngine, StdinFn};
pub use cliff::{changelog_parser, ChangeLogBuilder};
pub use git_client::VcsClient;
pub use gitea_client::{Commit, DynRemoteGitClient, GiteaClient, RemoteGitEngine, Tag};

View File

@ -0,0 +1,31 @@
[package]
name = "cuddle-please-release-strategy"
description = "A release-please inspired release manager tool, built on top of cuddle, but also useful standalone, cuddle-please supports, your ci of choice, as well as gitea, github"
repository = "https://git.front.kjuulh.io/kjuulh/cuddle-please"
version = "0.1.0"
edition = "2021"
readme = "../../README.md"
license-file = "../../LICENSE"
publishable = true
[dependencies]
anyhow.workspace = true
tracing.workspace = true
serde.workspace = true
semver.workspace = true
[dev-dependencies]
tracing-test = { workspace = true, features = ["no-env-filter"] }
pretty_assertions.workspace = true
tempdir.workspace = true
[features]
rust-workspace = []
rust-crate = []
toml-edit = []
json-edit = []
yaml-edit = []
default = [
"json-edit"
]

View File

@ -0,0 +1,60 @@
use std::path::Path;
use anyhow::Context;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct JsonEditOptions {
pub jq: String,
}
impl JsonEditOptions {
pub fn execute(&self, path: &Path, next_version: impl AsRef<str>) -> anyhow::Result<()> {
let next_version = next_version.as_ref();
if !path.exists() {
anyhow::bail!("could not find file at: {}", path.display());
}
if let Ok(metadata) = path.metadata() {
if !metadata.is_file() {
anyhow::bail!("{} is not a file", path.display());
}
}
let abs_path = path.canonicalize().context(anyhow::anyhow!(
"could not get absolute path from {}",
path.display()
))?;
let output = std::process::Command::new("jq")
.arg("--arg")
.arg("version")
.arg(next_version)
.arg(&self.jq)
.arg(
abs_path
.to_str()
.ok_or(anyhow::anyhow!("path contains non utf-8 chars"))?,
)
.output()
.context(anyhow::anyhow!(
"failed to run jq on file, jq may not be installed or query was invalid"
))?;
if !output.status.success() {
let err_content = std::str::from_utf8(output.stderr.as_slice())?;
anyhow::bail!("failed to run jq with output: {}", err_content);
}
let edited_json_content = std::str::from_utf8(output.stdout.as_slice())?;
tracing::trace!(
new_content = edited_json_content,
file = &abs_path.display().to_string(),
"applied jq to file"
);
std::fs::write(abs_path, edited_json_content)?;
Ok(())
}
}

View File

@ -0,0 +1,6 @@
#[cfg(feature = "json-edit")]
mod json_edit;
mod strategy;
#[cfg(feature = "json-edit")]
pub use json_edit::JsonEditOptions;

View File

@ -0,0 +1,59 @@
use std::path::PathBuf;
use serde::{Deserialize, Serialize};
pub struct UpdateOptions {
next_version: String,
global_changelog: String,
}
pub type Projects = Vec<Project>;
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct Project {
path: Option<PathBuf>,
r#type: ProjectType,
}
#[derive(Clone, Debug, Deserialize, Serialize)]
#[serde(tag = "type")]
pub enum ProjectType {
#[cfg(feature = "rust-workspace")]
#[serde(alias = "rust_workspace")]
RustWorkspace,
#[cfg(feature = "rust-crate")]
#[serde(alias = "json_edit")]
RustCrate,
#[cfg(feature = "toml-edit")]
#[serde(alias = "toml_edit")]
TomlEdit,
#[cfg(feature = "yaml-edit")]
#[serde(alias = "yaml_edit")]
YamlEdit,
#[cfg(feature = "json-edit")]
#[serde(alias = "json_edit")]
JsonEdit,
}
impl Project {
pub fn new(path: Option<PathBuf>, r#type: ProjectType) -> Self {
Self { path, r#type }
}
pub fn execute(&self, options: &UpdateOptions) -> anyhow::Result<()> {
match self.r#type {
#[cfg(feature = "rust-workspace")]
ProjectType::RustWorkspace => todo!(),
#[cfg(feature = "rust-crate")]
ProjectType::RustCrate => todo!(),
#[cfg(feature = "toml-edit")]
ProjectType::TomlEdit => todo!(),
#[cfg(feature = "yaml-edit")]
ProjectType::YamlEdit => todo!(),
#[cfg(feature = "json-edit")]
ProjectType::JsonEdit => todo!(),
}
Ok(())
}
}

View File

@ -0,0 +1,50 @@
use tracing_test::traced_test;
#[test]
#[traced_test]
#[cfg(feature = "json-edit")]
pub fn test_can_update_version_in_jq() {
use cuddle_please_release_strategy::JsonEditOptions;
let dir = tempdir::TempDir::new("can_update_version_in_jq").unwrap();
let dir_path = dir.path();
let json_file = dir_path.join("some-test.json");
let initial_content = r#"{
"some": {
"nested": [
{
"structure": {
"version": "v1.0.1"
}
}
]
}
}
"#;
let expected = r#"{
"some": {
"nested": [
{
"structure": {
"version": "v1.0.2"
}
}
]
}
}
"#;
std::fs::write(&json_file, initial_content).unwrap();
let actual_file = std::fs::read_to_string(&json_file).unwrap();
pretty_assertions::assert_eq!(initial_content, actual_file);
let edit_options = JsonEditOptions {
jq: r#".some.nested[].structure.version=$version"#.into(),
};
edit_options.execute(&json_file, "v1.0.2").unwrap();
let actual_file = std::fs::read_to_string(&json_file).unwrap();
pretty_assertions::assert_eq!(expected, &actual_file);
}

View File

@ -1,7 +1,12 @@
[package]
name = "cuddle-please"
description = "A release-please inspired release manager tool, built on top of cuddle, but also useful standalone, cuddle-please supports, your ci of choice, as well as gitea, github"
repository = "https://git.front.kjuulh.io/kjuulh/cuddle-please"
readme = "../../README.md"
license-file = "../../LICENSE"
version = "0.1.0"
edition = "2021"
publishable = true
[dependencies]
cuddle-please-frontend.workspace = true

View File

@ -2,7 +2,6 @@ use cuddle_please_commands::PleaseCommand;
fn main() -> anyhow::Result<()> {
dotenv::dotenv().ok();
tracing_subscriber::fmt::init();
let current_dir = std::env::current_dir().ok();
let current_dir = current_dir.as_deref();

View File

@ -13,6 +13,7 @@ fn get_base_args<'a>() -> Vec<&'a str> {
"list",
"--no-vcs",
"--engine=local",
"--token=something",
]
}
@ -24,7 +25,6 @@ PleaseConfig
api_url: https://some-example.gitea-instance
"#;
#[test]
#[traced_test]
fn test_config_from_current_dir() {
let args = get_base_args();
@ -38,7 +38,6 @@ fn test_config_from_current_dir() {
assert_output(ui, EXPECTED_OUTPUT, "");
}
#[test]
#[traced_test]
fn test_config_from_source_dir() {
let mut args = get_base_args();
@ -54,7 +53,6 @@ fn test_config_from_source_dir() {
assert_output(ui, EXPECTED_OUTPUT, "");
}
#[test]
#[traced_test]
fn test_config_from_stdin() {
let mut args = get_base_args();
@ -74,7 +72,6 @@ settings:
assert_output(ui, EXPECTED_OUTPUT, "");
}
#[test]
#[traced_test]
fn test_config_fails_when_not_path_is_set() {
let args = get_base_args();

View File

@ -17,7 +17,8 @@ fn exec_git_into_branch() {
add_commit(tempdir.path(), "second").unwrap();
add_tag(tempdir.path(), "1.0.1").unwrap();
let vcs = VcsClient::new_git(tempdir.path(), None::<String>, None::<String>).unwrap();
let vcs =
VcsClient::new_git(tempdir.path(), None::<String>, None::<String>, "".into()).unwrap();
vcs.checkout_branch().unwrap();
let output = std::process::Command::new("git")
@ -48,7 +49,8 @@ fn add_files_to_commit() {
add_commit(tempdir.path(), "first").unwrap();
add_tag(tempdir.path(), "1.0.0").unwrap();
let vcs = VcsClient::new_git(tempdir.path(), None::<String>, None::<String>).unwrap();
let vcs =
VcsClient::new_git(tempdir.path(), None::<String>, None::<String>, "".into()).unwrap();
vcs.checkout_branch().unwrap();
std::fs::File::create(tempdir.path().join("changelog")).unwrap();
@ -76,7 +78,8 @@ fn reset_branch() {
add_commit(tempdir.path(), "first").unwrap();
add_tag(tempdir.path(), "1.0.0").unwrap();
let vcs = VcsClient::new_git(tempdir.path(), None::<String>, None::<String>).unwrap();
let vcs =
VcsClient::new_git(tempdir.path(), None::<String>, None::<String>, "".into()).unwrap();
vcs.checkout_branch().unwrap();
std::fs::File::create(tempdir.path().join("changelog-first")).unwrap();
@ -165,6 +168,12 @@ fn setup_git(path: &Path) -> anyhow::Result<()> {
let stderr = std::str::from_utf8(&output.stderr)?;
tracing::debug!(stdout = stdout, stderr = stderr, "git init");
exec_git(path, &["checkout", "-b", "main"])?;
exec_git(path, &["config", "user.name", "test"])?;
exec_git(path, &["config", "user.email", "test@test.com"])?;
exec_git(path, &["config", "init.defaultBranch", "main"])?;
Ok(())
}

View File

@ -16,13 +16,23 @@ fn test_vcs_get_noop() {
#[traced_test]
fn test_vcs_get_git_found() {
let testdata = get_test_data_path("git-found");
let git = VcsClient::new_git(&testdata, None::<String>, None::<String>).unwrap();
if let Err(e) = std::process::Command::new("git")
.arg("init")
.arg(".")
.current_dir(&testdata)
.output()
{
println!("{e}");
}
return;
let git = VcsClient::new_git(&testdata, None::<String>, None::<String>, "".into()).unwrap();
assert_eq!(
git,
VcsClient::Git {
source: testdata,
username: "cuddle-please".into(),
email: "bot@cuddle.sh".into()
email: "bot@cuddle.sh".into(),
token: "".into(),
}
)
}

View File

@ -5,7 +5,9 @@ base: "git@git.front.kjuulh.io:kjuulh/cuddle-rust-cli-plan.git"
vars:
service: "cuddle-please"
registry: kasperhermansen
mkdocs_image: "squidfunk/mkdocs-material:9.1"
caddy_image: "caddy:2.7"
please:
project:
@ -14,10 +16,34 @@ please:
branch: main
settings:
api_url: https://git.front.kjuulh.io
actions:
rust:
components:
packages:
debian:
dev:
- jq
- git
release:
- jq
- git
scripts:
"mkdocs:new":
type: shell
"mkdocs:dev":
type: shell
"mkdocs:build":
type: shell
"local:docker":
type: shell
"local:docker:docs":
type: shell
"ci:main":
type: shell
"ci:pr":
type: shell
"ci:release":
type: shell

81
docs/configuration.md Normal file
View File

@ -0,0 +1,81 @@
# Configuration
`cuddle-please` requires configuration to function, it is quite flexible, and tries to help you as much as possible filling out values for you, or using sane defaults.
First of all, you can either use the `cuddle.yaml` if using `cuddle`, or `cuddle.please.yaml` if using standalone.
```yaml
# file: cuddle.yaml
please:
<contents of cuddle.please.yaml>
---
# file: cuddle.please.yaml
project:
owner: kjuulh
repository: cuddle-please
branch: main
settings:
api_url: https://git.front.kjuulh.io
```
This is all the configuration, most of these won't be needed when running in CI.
`cuddle` fetches configuration items from different sources, each level is able to override the previous layer.
1. Execution environment
2. Configuration files
3. Stdin
4. Env variables
5. Cli arguments
6. User input
Lets break each down.
### Execution environment
Execution environment, is the environment under which cuddle-please is run, if running in CI, we're able to take some variables, without requiring input from the user, or configuration values.
Right now only `drone-ci` is supported, but github actions and such, are nearly done.
#### Drone CI
Drone CI, will automatically fill out
```yaml
project:
owner: <drone>
repository: <drone>
branch: <drone>
```
This means that the only thing the user needs to configure is the `api_url` and the access `<token>`
### Configuration files
Already shown above, this allows setting hard-coded values, especially useful for the `api_url`.
### Stdin
All the configurations can be passed via. stdin
```bash
cat cuddle.please.yaml | cuddle-please release --stdin
```
### Env variables
The CLI shows which env variables are available via. `cuddle-please release --help`.
### CLI args
The CLI shows which args are available via. `cuddle-please release -h # or --help`
`-h` gives a shorthand description and `--help` provides a longer explanation of each arg.
There are some args, which are exclusive to the cli or env variables, such as `<token>`. This is because it is a secret and it shouldn't be leaked in the configuration. There are some exceptions such as `GITHUB_TOKEN` which is picked in the environment variable layer.
### Interactive (User input)
cuddle-please will determine whether or not it is running with a user interactive `stdin`, and will prompt for missing values if running locally. This is disabled without a proper tty, or if running in one of the CI execution environments by default. Otherwise `--no-interactive` can be passed to any command.

156
docs/getting-started.md Normal file
View File

@ -0,0 +1,156 @@
# Getting started
`cuddle-please` is a tool to manage releases in a git repository.
It is either run manually or in ci. To get the most correct behavior
`cuddle-please` should be run on each commit on your primary branch
(main/master).
## Install
First you need the executable
```bash
cargo install cuddle-please
```
or docker (not public yet)
```bash
docker run -v $PWD:/mnt/src -e CUDDLE_PLEASE_TOKEN=<token> kjuulh/cuddle-please:latest
```
!!! warning
Other distributions to be added.
## Configuration
`cuddle-please` requires configuration to function, it is quite flexible, and
tries to help you as much as possible filling out values for you, or using sane
defaults.
For this `getting-started` guide, we will use cli args, but see
[configuration](configuration.md) for all the other options, both manual,
automatic, and interactive.
## Running
First make sure you're on your release branch, this is likely either `main` or
`master`.
```bash
git checkout main
cuddle-please release \
--engine gitea \
--owner kjuulh \
--repository cuddle-please \
--branch main
--api-url 'https://git.front.kjuulh.io/kjuulh/cuddle-please' \
--token <personal-access-token> \
--dry-run
```
We use `gitea` backend here, but you can either leave it out (as it is default
gitea), or set it to github (once that is done).
The token needs to have write access to your repository, as well as the api.
(guide tbd).
Dry-run is used here to not commit any changes to your backend, it may still
change your local git setup, but not the backends. Simply remove the arg if you
want to commit.
!!! note
`--token` can also be set with
`export CUDDLE_PLEASE_TOKEN='<personal-access-token>'` if you don't want to leak the secret to your cli history.
When run you should get output that it has created a dry_run pull-request,
meaning that it was supposed to do the action but didn't commit it.
If you've used versioning previously in your repository, i.e. a tag with
`v1.0.0` or `1.0.0` it will use that to bump the commits based on
[conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) and
[keep a changelog](https://keepachangelog.com/en/1.1.0/).
Changelog generation can be disabled with `--no-changelog`.
### Merging the pr.
If you've created the pull-request (i.e. with the dry-run arg). You can simply
just go to the pull-request and squash merge it.
```bash
# showing the command again, now without --dry-run
# you were automatically moved to cuddle-please/release when running the above command
git checkout main
cuddle-please release \
--engine gitea \
--owner kjuulh \
--repository cuddle-please \
--branch main
--api-url 'https://git.front.kjuulh.io/kjuulh/cuddle-please' \
--token <personal-access-token>
```
It is quite important that the title of the release commit is
`chore(release): <something>`. `<something>` will be the version of the release.
When it is merged, simply update the local repository and run the same command
as above.
```bash
# you were automatically moved to cuddle-please/release when running the above command
git checkout main
git pull origin main
cuddle-please release \
--engine gitea \
--owner kjuulh \
--repository cuddle-please \
--branch main
--api-url 'https://git.front.kjuulh.io/kjuulh/cuddle-please' \
--token <personal-access-token> \
```
You should now see a release artifact in the releases page, as well as a tag
with the version.
### Running in CI.
Cuddle-please shines the best when running in CI, as we're able to pull most
variables from that, such as `owner`, `repository`, `branch`, etc.
To run in ci see [continuous-integration](continuous-integration.md) for all the
different platforms.
Below is a snippet showing a `drone-ci` setup
```yaml
kind: pipeline
name: cuddle-please-release
type: docker
steps:
- name: cuddle-please release
image: docker.io/kjuulh/cuddle-please:v0.1.0
commands:
- cuddle-please release
environment:
CUDDLE_PLEASE_TOKEN:
from_secret: cuddle-please-token
CUDDLE_PLEASE_API_URL: "https://git.front.kjuulh.io"
when:
branch:
- main
- master
```
All the other options will automatically be pulled from the drone environment.
Throughts its own
[runtime configuration](https://docs.drone.io/pipeline/environment/reference/).
Right now only drone is supported with these fetch features, Please open an
issue, if you have another environment you'd like to run in. Such as github
actions, circleci, etc.

View File

@ -1,17 +1,35 @@
# Welcome to MkDocs
# Cuddle docs
For full documentation visit [mkdocs.org](https://www.mkdocs.org).
Cuddle Please is an extension to `cuddle`, it is a separate binary that can be executed standalone as `cuddle-please`, or in cuddle as `cuddle please`.
## Commands
The goal of the software is to be a `release-please` clone, targeting `gitea` instead of `github`.
* `mkdocs new [dir-name]` - Create a new project.
* `mkdocs serve` - Start the live-reloading docs server.
* `mkdocs build` - Build the documentation site.
* `mkdocs -h` - Print help message and exit.
The tool can be executed as a binary using:
## Project layout
```bash
cuddle please release # if using cuddle
# or
cuddle-please release # if using standalone
```
mkdocs.yml # The configuration file.
docs/
index.md # The documentation homepage.
... # Other markdown pages, images and other files.
And when a release has been built:
```bash
cuddle please release
# or
cuddle-please release
```
cuddle will default to information to it available in git, or use a specific entry in `cuddle.yaml` called
```yaml
# ...
please:
name: <something>
# ...
# ...
```
or as `cuddle.please.yaml`
See docs for more information about installation and some such

29
docs/installation.md Normal file
View File

@ -0,0 +1,29 @@
# Installation
## Cargo version
```bash
cargo install cuddle-please
# or
cargo binstall cuddle-please # if using binstall
```
More to come as the project matures.
## Development version
### Cuddle
[Cuddle](https://git.front.kjuulh.io/kjuulh/cuddle) is a script and configuration management tool, it is by far the easiest approach for building the development version of cuddle-please, but optional.
```bash
cuddle x build:release
# or docker
cuddle x build:docker:release
```
### Cargo
```bash
cargo build --release -p cuddle_cli
```

View File

@ -19,3 +19,7 @@ theme:
toggle:
icon: material/brightness-4
name: Switch to light mode # Palette toggle for light mode
markdown_extensions:
- admonition
- pymdownx.details
- pymdownx.superfences

17
scripts/ci:main.sh Executable file
View File

@ -0,0 +1,17 @@
#!/usr/bin/env bash
set -e
CMD_PREFIX="cargo run -p ci --"
if [[ -n "$CI_PREFIX" ]]; then
CMD_PREFIX="$CI_PREFIX"
fi
$CMD_PREFIX main \
--mkdocs-image "$MKDOCS_IMAGE" \
--caddy-image "$CADDY_IMAGE" \
--image "$REGISTRY/$SERVICE" \
--tag "main-$(date +%s)" \
--bin-name "$SERVICE"

15
scripts/ci:pr.sh Executable file
View File

@ -0,0 +1,15 @@
#!/usr/bin/env bash
set -e
CMD_PREFIX="cargo run -p ci --"
if [[ -n "$CI_PREFIX" ]]; then
CMD_PREFIX="$CI_PREFIX"
fi
$CMD_PREFIX pull-request \
--mkdocs-image "$MKDOCS_IMAGE" \
--caddy-image "$CADDY_IMAGE" \
--bin-name "$SERVICE"

17
scripts/ci:release.sh Executable file
View File

@ -0,0 +1,17 @@
#!/usr/bin/env bash
set -e
CMD_PREFIX="cargo run -p ci --"
if [[ -n "$CI_PREFIX" ]]; then
CMD_PREFIX="$CI_PREFIX"
fi
$CMD_PREFIX release \
--mkdocs-image "$MKDOCS_IMAGE" \
--caddy-image "$CADDY_IMAGE" \
--image "$REGISTRY/$SERVICE" \
--tag "$DRONE_TAG" \
--bin-name "$SERVICE"

5
scripts/local:docker.sh Executable file
View File

@ -0,0 +1,5 @@
#!/usr/bin/env bash
set -e
cargo run -p ci -- local docker-image --image kasperhermansen/cuddle-please --tag dev --bin-name cuddle-please

5
scripts/local:docker:docs.sh Executable file
View File

@ -0,0 +1,5 @@
#!/usr/bin/env bash
set -e
cargo run -p ci -- local build-docs --mkdocs-image $MKDOCS_IMAGE --caddy-image $CADDY_IMAGE

5
scripts/mkdocs:build.sh Executable file
View File

@ -0,0 +1,5 @@
#!/usr/bin/env bash
set -e
docker run --rm -it -p 8000:8000 -v ${PWD}:/docs ${MKDOCS_IMAGE}

View File

@ -0,0 +1 @@

8
templates/Caddyfile Normal file
View File

@ -0,0 +1,8 @@
{
debug
}
http://blog.kasperhermansen.com {
root * /usr/share/caddy
file_server
}