/ PLAYBOOK.scm
PLAYBOOK.scm
 1  ; SPDX-License-Identifier: AGPL-3.0-or-later
 2  ; PLAYBOOK.scm - Operational playbooks
 3  
 4  (playbook
 5    (version "1.0.0")
 6    (schema-version "1.0")
 7  
 8    (setup
 9      (name "Initial Setup")
10      (steps
11        (step "Install GNAT compiler"
12          (fedora "sudo dnf install gcc-gnat")
13          (debian "sudo apt install gnat"))
14        (step "Install GPRbuild"
15          (fedora "sudo dnf install gprbuild")
16          (debian "sudo apt install gprbuild"))
17        (step "Clone and build"
18          (commands
19            "git clone https://github.com/hyperpolymath/bitfuckit.git"
20            "cd bitfuckit"
21            "gprbuild -P bitfuckit.gpr"))
22        (step "Install binary"
23          (command "cp bin/bitfuckit ~/.local/bin/"))))
24  
25    (authenticate
26      (name "Bitbucket Authentication")
27      (prerequisites
28        "Bitbucket account"
29        "App password with repo permissions")
30      (steps
31        (step "Create app password"
32          (url "https://bitbucket.org/account/settings/app-passwords/")
33          (permissions "repository:read" "repository:write" "repository:delete"))
34        (step "Run login"
35          (command "bitfuckit auth login"))
36        (step "Verify"
37          (command "bitfuckit auth status"))))
38  
39    (mirror-workflow
40      (name "Mirror from GitHub to Bitbucket")
41      (prerequisites
42        "Authenticated with bitfuckit"
43        "Inside a git repository"
44        "SSH key added to Bitbucket")
45      (steps
46        (step "Ensure in repo directory"
47          (command "git status"))
48        (step "Mirror to Bitbucket"
49          (command "bitfuckit mirror <repo-name>"))
50        (step "Verify on Bitbucket"
51          (url "https://bitbucket.org/<workspace>/<repo>"))))
52  
53    (troubleshooting
54      (issue "401 Unauthorized"
55        (cause "Invalid or expired app password")
56        (fix "bitfuckit auth login"))
57  
58      (issue "404 Not Found"
59        (cause "Wrong workspace or repo name")
60        (fix "Check workspace with: bitfuckit auth status"))
61  
62      (issue "Permission denied on push"
63        (cause "SSH key not registered or app password lacks write permission")
64        (fix "Add SSH key at bitbucket.org/account/settings/ssh-keys/"))
65  
66      (issue "gprbuild not found"
67        (cause "GPRbuild not installed")
68        (fix "sudo dnf install gprbuild"))
69  
70      (issue "TUI garbled display"
71        (cause "Terminal doesn't support ANSI or Unicode")
72        (fix "Use a modern terminal emulator (kitty, alacritty, gnome-terminal)")))
73  
74    (release
75      (name "Release Checklist")
76      (steps
77        (step "Update version in STATE.scm")
78        (step "Update CHANGELOG if present")
79        (step "Build and test"
80          (commands
81            "gprbuild -P bitfuckit.gpr"
82            "bin/bitfuckit --help"))
83        (step "Tag release"
84          (command "git tag -s v0.1.0 -m 'Release v0.1.0'"))
85        (step "Push with tags"
86          (command "git push --tags origin main"))
87        (step "Create GitHub release"
88          (command "gh release create v0.1.0 --generate-notes")))))