-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update documentation and installation scripts, fix bug #20
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
If a 'launchd' service is bootstrapped but not currently running, calling 'launchctl kill SIGINT' on the service will result in error code 3 ("No such process"). Stopping an already-stopped service isn't an error case, so update to ignore the error code. As part of adding a new test to cover this error code, reorganize 'TestLaunchd_Stop' into table-driven tests to reduce code duplication. Signed-off-by: Victoria Dye <vdye@github.com>
The options present in the 'ln' command differ between Linux and MacOS ('-r' in the former creates a relative link from absolute paths, '-F' in the latter forces overwriting an existing link). Drop use of these options in packaging/installation scripts by instead explicitly specifying relative paths and deleting existing links before calling 'ln', respectively. Signed-off-by: Victoria Dye <vdye@github.com>
To prepare for an install-from-source target in the Makefile, create a general (Unix) 'uninstall.sh' script. This script is nearly identical to 'build/package/pkg/uninstall.sh', with a few notable differences: 1. The script does not run as 'root' by calling itself with 'sudo'; instead, operations that may require root privileges are first tried as the calling user and, if they fail, are called again with 'sudo'. 2. If the script is run with 'sudo' (or otherwise as 'root'), the user is prompted to confirm whether they want to proceed. These changes help us avoid platform-specific code around finding the current logged in user to run 'git-bundle-server web-server stop'. Signed-off-by: Victoria Dye <vdye@github.com>
derrickstolee
approved these changes
Feb 16, 2023
ldennington
approved these changes
Feb 16, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Especially liked the consolidation down to the single uninstall.sh
script. One thing I noticed is that the ruby asciidoctor extension does seem to be experimental, but if you've been using it successfully I don't think that's a big deal.
Add an install-from-source target to the 'Makefile' to allow installation on any Unix-based system, rather than only those for which packages are built (i.e., Darwin and Debian). This is done by repurposing the 'layout-unix.sh' script into an 'install.sh' script. Like the 'uninstall.sh' update from the previous commit, the new script contains only a few major differences from 'layout-unix.sh': - The '--payload' option is renamed to '--install-root'. - Like 'uninstall.sh', commands that may require root privileges (such as when '--install-root=/') are wrapped in a 'retry_root' function that first runs the operation as the calling user, then as root if it fails. However, unlike 'uninstall.sh', this behavior is gated by an '--allow-root' option, ensuring we only do this escalation if we're running the 'install' target. - 'INSTALL_TO' is renamed to 'APP_ROOT' to avoid confusion with 'INSTALL_ROOT'. This is also done in the pkg 'postinstall' script. Signed-off-by: Victoria Dye <vdye@github.com>
Add Asciidoc manual pages for 'git-bundle-server' (describing bundle servers in general as well as the tool's individual commands) and 'git-bundle-web-server'. In addition to the Asciidoc pages, add custom 'man:' and 'url:' macros in 'asciidoctor-extensions.rb'. The former is a simplified version of an Asciidoctor example extension [1] (providing basic markup for references to other man pages), while the latter overrides the default autolinking [2] behavior in 'asciidoctor' to avoid some roff rendering weirdness and applies some simple markup. These files are intended for use with Asciidoctor. Documents can be generated with: $ asciidoctor -I scripts/ -r asciidoctor-extensions.rb docs/man/*.adoc In a later commit, these docs will be built into installable manpages as part of a 'Makefile' target. [1] https://github.com/asciidoctor/asciidoctor-extensions-lab/blob/main/lib/man-inline-macro/extension.rb [2] https://docs.asciidoctor.org/asciidoc/latest/macros/autolinks/ Signed-off-by: Victoria Dye <vdye@github.com>
Add a 'doc' target and 'make-docs.sh' script to build the Asciidoc documents in 'docs/man' into installable manpages. Include these documents (and associated symlinks) in installations from source and from platform-specific packages. Additionally, update 'release.yml' to install 'asciidoctor' so that the documentation can successfully be built in that workflow. Signed-off-by: Victoria Dye <vdye@github.com>
Add instructions for installing/uninstalling the bundle server. Update instructions for local development to suggest using 'make' and to recommended a 'bin/' output directory when using 'go build' directly. Signed-off-by: Victoria Dye <vdye@github.com>
derrickstolee
approved these changes
Feb 17, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #15
This pull request updates a number of installation-related scripts, focusing primarily on documentation.
launchd.go
I somehow missed in all of my prior testing of the service 🙃install
target to theMakefile
.git-bundle-server
andgit-bundle-web-server
including custom Asciidoctor extensions for some specialized macros and aREADME.md
containing information about how the documentation should be updated. These documents are built intoman
pages withmake doc
and are installed (with appropriate symlinks) in all supported installation methods.README.md
, and does some minor reorganization of the file.Testing
Manual installs of packages and from source on both MacOS (amd64) and Ubuntu. Successful pipeline run: https://github.com/github/git-bundle-server/actions/runs/4189915807