No description
- Rust 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
|
||
| .forgejo/workflows | ||
| doc | ||
| src | ||
| tests | ||
| .gitignore | ||
| Cargo.lock | ||
| Cargo.toml | ||
| publish.yaml | ||
| README.md | ||
project_builder
Project build and publishing tool
Try
Download latest binary from https://repo.prod.meissa.de/meissa/project_builder/releases
Make it executable: chmod +x pb
Get help with:
./pb
# or
./pb --help
Build
Binary
cargo build
# or
cargo build --release # for the small release binary
Deploy
cargo install --path .
Installs as ~/.cargo/bin/pb
Impression
Get an impression by running the following integration test:
cargo test test_publish_gitlab_release -- --nocapture
Resulting in output like:
=============== Start =============== -> Execute session ---> Execute publish_gitlab_release -----> Execute publish_gitlab_package_for_release -------> Success curl -H "PRIVATE-TOKEN: mytoken" --upload-file target/release/asset "https://my.url/packages/generic/release-package/7.5.3/asset" -----> Success publish_gitlab_package_for_release -----> Success curl --header 'Content-Type: application/json' --data '{ "name": "Release 7.5.3", "tag_name": "7.5.3" , "assets": { "links": [{ "name": "asset", "url": "https://my.url/packages/generic/release-package/7.5.3/asset", "link_type": "other" }] } }' --request POST "https://my.url/releases" -H "PRIVATE-TOKEN: mytoken" ---> Success publish_gitlab_release -> Success session =============== End ================
Run
pb # print help
pb tag # show the latest git tag of this project
Cli
pb # without arguments => shows help
pb -h # shows help
pb tag -h # shows help for command "tag"
pb publish-release -h # shows help for command "publish-release"
Publishing
- Publishing requires that a properly configured file "publish.yaml" active folder, see below
- The specified environment variable for the token (e.g. CI_JOB_TOKEN) must be provided
- in the gitlab pipeline the variable CI_JOB_TOKEN is set per default
Impression
Get an impression by running the following integration test:
cargo test test_publish_gitlab_release -- --nocapture
Resulting in output like:
=============== Start =============== -> Execute session ---> Execute publish_gitlab_release -----> Execute publish_gitlab_package_for_release -------> Success curl -H "PRIVATE-TOKEN: mytoken" --upload-file target/release/asset "https://my.url/packages/generic/release-package/7.5.3/asset" -----> Success publish_gitlab_package_for_release -----> Success curl --header 'Content-Type: application/json' --data '{ "name": "Release 7.5.3", "tag_name": "7.5.3" , "assets": { "links": [{ "name": "asset", "url": "https://my.url/packages/generic/release-package/7.5.3/asset", "link_type": "other" }] } }' --request POST "https://my.url/releases" -H "PRIVATE-TOKEN: mytoken" ---> Success publish_gitlab_release -> Success session =============== End ================
publish.yaml
Example:
release:
release_server_url: [the server api url to which the release is published]
token_env_name: [token name] # e.g. CI_JOB_TOKEN for within gitlab ci
organisation: [org] # the organisation under whish the repo/release resides
release_artifacts:
- [first asset] # full local asset path, e.g. folder1/folder2/asset
- [second asset]
- ...
Run locally
Dry-run:
CI_JOB_TOKEN=mytoken pb publish-release --mode dry-run
Live (don't forget to replace "")
CI_JOB_TOKEN=<mytoken> pb publish-release --mode local
CI pipeline example
See build.yaml
Test
Normal tests (excluding domain tests):
cargo test
Domain tests
RUSTFLAGS="--cfg domaintest" cargo test domaintest