Crates.io | releasr |
lib.rs | releasr |
version | 0.1.0 |
source | src |
created_at | 2022-07-03 20:07:42.709761 |
updated_at | 2022-07-03 20:07:42.709761 |
description | Release note tracking on a per environment per semver release. |
homepage | https://github.com/Krakaw/releasr |
repository | https://github.com/Krakaw/releasr |
max_upload_size | |
id | 618536 |
size | 91,656 |
Release note tracking on a per environment per semver release.
Ever delay a release and then forget the steps you need to run when it eventually does go out. Releasr is made for just those times. Attach version specific release notes and retrieve them when the deployment is ready to go out.
Every release note is attached to an environment. Once a note has been completed it won't be shown again.
Notes cannot be added to a version that has been completed already.
cargo build --release
./target/release/releasr
cp .env.sample .env
./releasr
# Create a dev environment
curl http://localhost:8080/environments \
-X POST \
-H 'Content-Type: application/json' \
-d '{"name": "backend_dev", "version_url": "https://example.com/version.json", "last_deployed_version": 0}'
# Create a prod environment
curl http://localhost:8080/environments \
-X POST \
-H 'Content-Type: application/json' \
-d '{"name": "backend_prod", "version_url": "https://example.com/version.json", "last_deployed_version": 0}'
# Attach a note to both environments
curl http://localhost:8080/notes \
-X POST \
-H 'Content-Type: application/json' \
-d '{"environment": "backend_*", "version": "1.0.0", "note": "Run initial migrations using `cargo run -- migrations`"}'
[
{
"id": 1,
"version": "1.0.0",
"version_int": 1000000,
"note": "Run initial migrations using `cargo run -- migrations`",
"environment": "backend_dev",
"completed_at": null,
"created_at": "2021-12-30T11:41:37.866539073Z",
"modified_at": "2021-12-30T11:41:37.866539073Z"
},
{
"id": 2,
"version": "1.0.0",
"version_int": 1000000,
"note": "Run initial migrations using `cargo run -- migrations`",
"environment": "backend_prod",
"completed_at": null,
"created_at": "2021-12-30T11:41:37.882175630Z",
"modified_at": "2021-12-30T11:41:37.882175630Z"
}
]
# Attach a note to a specific environment for another version
curl http://localhost:8080/notes \
-X POST \
-H 'Content-Type: application/json' \
-d '{"environment": "backend_prod", "version": "1.0.1", "note": "Manually delete records from `table_x`"}'
[
{
"id": 3,
"version": "1.0.1",
"version_int": 1000001,
"note": "Manually delete records from `table_x`",
"environment": "backend_prod",
"completed_at": null,
"created_at": "2021-12-30T11:44:40.673926719Z",
"modified_at": "2021-12-30T11:44:40.673926719Z"
}
]
# To fetch all pending notes
curl http://localhost:8080/notes \
-X GET \
-H 'Content-Type: application/json'
[
{
"id": 1,
"version": "1.0.0",
"version_int": 1000000,
"note": "Run initial migrations using `cargo run -- migrations`",
"environment": "backend_dev",
"completed_at": null,
"created_at": "2021-12-30T11:41:37.866539073Z",
"modified_at": "2021-12-30T11:41:37.866539073Z"
},
{
"id": 2,
"version": "1.0.0",
"version_int": 1000000,
"note": "Run initial migrations using `cargo run -- migrations`",
"environment": "backend_prod",
"completed_at": null,
"created_at": "2021-12-30T11:41:37.882175630Z",
"modified_at": "2021-12-30T11:41:37.882175630Z"
},
{
"id": 3,
"version": "1.0.1",
"version_int": 1000001,
"note": "Manually delete records from `table_x`",
"environment": "backend_prod",
"completed_at": null,
"created_at": "2021-12-30T11:44:40.673926719Z",
"modified_at": "2021-12-30T11:44:40.673926719Z"
}
]
# To fetch specific pending notes for an environment and maximum version
curl http://localhost:8080/notes?environment=backend_prod&version=1.0.0 \
-X GET \
-H 'Content-Type: application/json'
[
{
"id": 2,
"version": "1.0.0",
"version_int": 1000000,
"note": "Run initial migrations using `cargo run -- migrations`",
"environment": "backend_prod",
"completed_at": null,
"created_at": "2021-12-30T11:41:37.882175630Z",
"modified_at": "2021-12-30T11:41:37.882175630Z"
}
]
# Once a deploy is complete and the notes have been executed, you can complete them.
curl http://localhost:8080/notes \
-X PATCH \
-H 'Content-Type: application/json' \
-d '{"environment": "backend_dev", "version": "1.0.1"}'
{
"completed_count": 1,
"environment": {
"last_deployed_version": 1000001,
"name": "backend_dev",
"version_url": "https://example.com/version.json"
}
}
# Delete a note using its `id`
curl http://localhost:8080/notes/2 \
-X DELETE \
-H 'Content-Type: application/json'
{
"id": 2,
"version": "1.0.0",
"version_int": 1000000,
"note": "Run initial migrations using `cargo run -- migrations`",
"environment": "backend_prod",
"completed_at": null,
"created_at": "2021-12-30T11:41:37.882175630Z",
"modified_at": "2021-12-30T11:41:37.882175630Z"
}
cargo test
👤 Krakaw
Give a ⭐️ if this project helped you!
This README was generated with ❤️ by readme-md-generator