Added StellarEnv to manage and communicate with stellar installed versions#24
Merged
albertodebortoli merged 86 commits intomasterfrom Mar 11, 2023
Merged
Added StellarEnv to manage and communicate with stellar installed versions#24albertodebortoli merged 86 commits intomasterfrom
albertodebortoli merged 86 commits intomasterfrom
Conversation
# Conflicts: # Stellar/.swiftpm/xcode/xcshareddata/xcschemes/Stellar-Package.xcscheme # Stellar/.swiftpm/xcode/xcshareddata/xcschemes/Stellar.xcscheme # Stellar/Sources/Core/Constants/Constants.swift # Stellar/Sources/Core/URLManager/URLManager.swift
stellarenv to handle list, installation, update of the tool
stellarenv to handle list, installation, update of the toolstellarenv to handle list, installation, update of the tool
This reverts commit 33f6b08.
# Conflicts: # Stellar/Sources/Core/Logger/Logger.swift
xl4kj
approved these changes
Mar 5, 2023
Improvements on #24
it prevents a correct forward of the commands
sorting should be desc from the latest installed
Contributor
Author
|
@albertodebortoli @xl4kj
|
stellarenv to handle list, installation, update of the tool# Conflicts: # Stellar/Sources/Core/Constants/PathConstants.swift
albertodebortoli
approved these changes
Mar 11, 2023
Member
albertodebortoli
left a comment
There was a problem hiding this comment.
This PS brings in an amazing addition! Some things are still pending but we agreed to address them separately as the PR is quite big and we want to have all changes in master to more easily move on.
@malcommac top stuff! 🎉 🌟
albertodebortoli
added a commit
that referenced
this pull request
Mar 13, 2023
…ements Minor improvements post #24
8 tasks
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
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.
This PR introduces a new CLI tool called
stellarenv(note: it must be called.stellarvia shell)Stellar is composed by two CLI tools.
BEFORE TEST
Since our private repo, we need to perform authenticated requests to GitHub APIs.
Create your own token and put into
~./stellar/GITHUB-TOKENfile. It will be used automatically by our tools to perform authenticated requests.stellarThis is the CLI tool you can use to perform automation.
You can have more than one version installed; all the files related to a particular version, including the binary itself, are under the
~/.stellar/Versionsdirectory.stellarenvThis CLI tool is installed in
/usr/local/bin.It offers functions to update stellar installations and also itself.
Once called, it has two different behaviors:
stellarenv, it just executes the commandStellarCLItool installedHow the correct version binary is picked from
/Versions?The
VersionResolver.swiftclass does the following checks into the current working directory:.stellar-binfolder with a complete stellar installation, it will resolve to that.stellar-versionfile with a valid version. If the version is not present locally, it will execute an install automatically.Install_private.shA copy of the
install.shcalledinstall_private.shwas created to support the installation ofstellarenvuntil the repository became public.Once called:
StellarEnv.zippackage and install it in/usr/local/binstellarenv installto install theStellarCLI(latest version) in~/.stellar/VersionsubdirectorystellarenvCOMMANDSinstallThe following command is used to install a specific version of stellar.
You can call it by adding the
versionparameter or not; if not passed, the latest stable release will be installed.When you don't specify
version, you can also setpre-releaseparameter to install the latest pre-release available.stellar install 0.0.4: install stellar 0.0.4stellar install: install the latest stable release availablestellar install pre-release: install the latest pre-release availableupdateThis command checks for updates of both the ENV and CLI tools.
stellarenv updateupdate bothstellarandstellarenvto the latest stable remote version.localThis command creates a
.stellar-versionfile to pin the stellar version that should be used in the current directory.If the
versionparameter is not specified, it just prints the locally installed versions ofstellar(the ones you can find in~/.stellar/Versionsfolder).stellarenv local: print installed versionsstellarenv local 0.0.4: pin the project at the current working directory to the passed versionlistThe following command lists the remote versions of stellar by using GitHub APIs.
It includes the
pre-releaseparameter, which includes or excludes pre-releases from the list.stellarenv list: list all stable releases of the stellar packagestellarenv list pre-releases: also includes releases marked as pre-releases in GitHub releasesbundleBundles the version specified in the
.stellar-versionfile in CWD into the.stellar-bindirectory (eventually download specified release if unavailable locally).stellarenv bundle: from the CWD (.stellar-versionis required on cwd btw)