- Haskell 96.6%
- Shell 1.6%
- Just 1.6%
- Mustache 0.2%
|
patrick brisbin
9e710bf194
All checks were successful
CI / test (pull_request) Successful in 34s
CI / lint (pull_request) Successful in 9s
CI / test (push) Successful in 34s
CI / lint (push) Successful in 7s
CI / test-docs (pull_request) Successful in 11s
CI / test-integration (pull_request) Successful in 25s
CI / test-docs (push) Successful in 11s
CI / test-integration (push) Successful in 26s
Release / release (push) Successful in 3m45s
|
||
|---|---|---|
| .forgejo/workflows | chore(release): don't publish css files | |
| app | Finalize FJCTL rename | |
| dist/fjctl | Implement installation archive | |
| docs | fix(docs): use mdoc for man-page generation | |
| files | Test defaulting behaviors | |
| headroom-templates | chore: add AGPLv3 license headers | |
| integration | chore(ci): update config.yaml for out of band change | |
| src | feat!: replace --docs with --doc | |
| test | chore: remove DocsSpec | |
| .gitignore | fix(docs): use mdoc for man-page generation | |
| .headroom.yaml | chore: add AGPLv3 license headers | |
| .hlint.yaml | chore: enable QuasiQuotes all the time | |
| .releaserc.yaml | fix(release): implement semantic-release on CI | |
| .restyled.yaml |
Add repository.schema.json
|
|
| CHANGELOG.md | Remove more GitHub naming | |
| COPYING | chore: add AGPLv3 license headers | |
| fjctl.cabal | chore: remove DocsSpec | |
| fourmolu.yaml | feat: scaffold Haskell CLI | |
| justfile | feat!: replace --docs with --doc | |
| package.yaml | chore: remove DocsSpec | |
| README.md | chore(docs): update README | |
| stack.yaml | fix(docs): use mdoc for man-page generation | |
| stack.yaml.lock | fix(docs): use mdoc for man-page generation | |
| weeder.toml | Finalize FJCTL rename | |
fjctl
CLI for maintaining Forgejo repositories as IaC.
Installation
Binary
Note
Due to the limitation of my self-hosted Forgejo Actions runner, we only build Linux binaries right now.
curl -L "https://codeberg.org/pbrisbin/fjctl/releases/download/v${VERSION}/fjctl-${VERSION}-Linux-x86_64.tar.gz" | tar xvzf -
cd fjctl
make install PREFIX=$HOME/.local # user installation
sudo make install # global installation, likely needs root
Installation includes man-pages fjctl.1 (the CLI) and fjctl.5 (the
configuration file) and shell completions for bash, fish, and zsh.
Source
Building from source requires a Haskell tool-chain, specifically Stack.
git clone https://codeberg.org/pbrisbin/fjctl && cd fjctl
just dist-check # to install everything (in ~/.local)
stack install # to install just the binary
stack exec -- fjctl ... # to run without installation
Getting Started
-
Create
~/.config/fjctl/config.yaml(assuming default$XDGvariables) -
Add a
defaultskey with properties you want for all repositoriesdefaults:has_actions:trueallow_merge_commits:falsedefault_delete_branch_after_merge:truedefault_merge_style:fast-forward-onlydefault_update_style:rebase -
Add a
repositorieskey with name-properties pairsTo accept all defaults, use
{}. Otherwise, add the properties that differ from defaults for this repository.repositories:pbrisbin/hs-shellwords:description:Parse a string into a list of words, like a shell wouldhas_releases:trueallow_merge_commits:true -
Run
fjctlto compare the on-disk state to the server state and report any differences -
Add
--applyto make the server state match the on-disk state
For an example, see my own (work in progress) config.yaml.
Migration
The --create-via-migrate option can be used to migrate, instead of create, any
configured repositories that do not exist on the server. By default, this
migrates the same-named repository from GitHub and uses no authentication. This
can be adjusted by adding a migrate_options stanza in the configuration file:
migrate_options:clone_addr_template:"https://github.com/{owner}/{name}.git"auth_token:nullauth_username:nullauth_password:nulllabels:falsemilestones:falseDeletion
fjctl will report, but not delete, things that exist on the server but not in
the configuration. This includes variables, branch-protections, and whole
repositories.
It's an open feature to handle deletes in a safe and intuitive way.
Usage
See fjctl(1) for CLI usage and fjctl(5) for
documentation of the configuration file.
License
This project is licensed AGPLv3. See COPYING.