-
Notifications
You must be signed in to change notification settings - Fork 6
Mode to manage compose file and fetch docker images from registry #25
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
Open
ColonelThirtyTwo
wants to merge
16
commits into
GhostManager:main
Choose a base branch
from
ColonelThirtyTwo:docker-images
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Mode to manage compose file and fetch docker images from registry #25
ColonelThirtyTwo
wants to merge
16
commits into
GhostManager:main
from
ColonelThirtyTwo:docker-images
+1,527
−1,328
Conversation
This file contains hidden or 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
Instead of using global variables and repeating some of the logic in subcommands, move the state into a DockerInterface object and use methods to interact with it. Makes interfacing with docker a bit more flexible, for eventual supporting of docker files outside of the executable's directory.
Implement a GetDaemonClient method that lazily initializes the daemon client, that also avoids repeating the initialization logic in modules.
Move env vars from a global to a field on the docker interface. Cleans up a bunch of `if dev` branches.
More reliable than looking for the container label, especially when multiple instances of Ghostwriter are running.
There is now a `--mode` argument at the root level, which can one of the following: * `prod` (the default): In this new mode, Ghostwriter-CLI will write an embedded docker-compose.yml file that points to the published GW images to the XDG/Windows app data directories. With this, GW-CLI no longer needs to run inside of the GW source repo, simplifying installation * `local-prod`: Equivalent to the previous default, runs the GW checkout in the exe's directory in production mode * `local-dev`: Equivalent to the `--dev` flag, runs the GW checkout in the exe's directory in development mode Currently this uses an embedded docker-compose.yml that points to GW images that I have published. Once official GW images are published, the compose file should be updated to use them.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #25 +/- ##
==========================================
- Coverage 25.57% 21.25% -4.33%
==========================================
Files 37 39 +2
Lines 1294 1407 +113
==========================================
- Hits 331 299 -32
- Misses 914 1063 +149
+ Partials 49 45 -4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Add `--pull` flag to `build` so that it also pulls containers for system managed builds
Add missing `--rm` flag to the `run` command
Remove embedded docker compose file for production mode, and instead download the `gh-cli.yml` file from the latest Ghostwriter release. Currently pointing at my fork since the main repo doesn't have a release with the file yet.
Checks the current version of ghostwriter (from the docker-compose.yml file for production or the VERSION file for local modes) with the latest available release from Github.
After running `containers up`, fetch the current and latest versions, and print an upgrade reminder message if they differ. Only check once every 24 hours to prevent excessive network requests.
Forgot to remove this when we switched GW-CLI to downloading it instead.
If `GWCLI_AUTO_CHECK_UPDATES` is set to false in the env file, the automatic update checks will be skipped. It defaults to true.
Now that the workflow that generates it has been published, switch from my fork to the main repo.
I didn't see the existing version command when I wrote check-version. Having two version commands is pointless, so merge them.
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.
Adds and makes default a mode that writes the Ghostwriter compose file to the XDG/Windows app data directory and pull containers from the ghcr registry rather than requiring a local checkout of the Ghostwriter source.
This simplifies installation in two ways. First, administrators will only need to download the gw-cli binary rather than checking out the source. Second, since the compose file refers to pre-built images, the image building step doesn't need to run, cutting out a lot of potential issues (such as not being able to download packages).
Instead of specifying a
--devflag, a--mode=Xargument has been added, where X can be eitherprod(the default, GWCLI managed docker),local-prod(old default, local directory in prod mode) andlocal-dev(same as--dev, local directory in dev mode).This also includes a lot of refactoring around how the CLI internally manages docker and env var info, to help with managing compose projects in arbitrary directories.
The docker-compose.yml file is fetched from the Ghostwriter GitHub releases (see GhostManager/Ghostwriter#803).
This also adds update checking functionality -
compose upwill check for updates after running by default (setGWCLI_AUTO_CHECK_UPDATESto disable) and thecheck-versionsubcommand will manually do a check.installcan be used to update to the latest (or a selected) version.