Enonic XP CLI
Enonic XP CLI is a command-line tool built for management of installations and projects of Enonic XP.
In order to build and develop the CLI, you need to have the Go environment available.
Installing Go build and release environment:
Mac OS
brew install goreleaser
brew install dep
- This is the Go dependency management tool.
Windows
Recommended way is to use scoop command line installer
-
Install scoop if needed
Make sure Powershell 3 (or later) and .NET Framework 4.5 (or later) are installed. Then run:
iex (new-object net.webclient).downloadstring('https://get.scoop.sh')
-
Install go
scoop install go
-
Install goreleaser
scoop bucket add goreleaser https://github.com/goreleaser/scoop-bucket.git
scoop install goreleaser
-
Install Go dependency management tool
scoop install dep
For other OSes, please see Goreleaser.
Building project
- Check out XP CLI from GitHub
- Run
dep ensure
in the project folder. - This will download all dependencies for the project. - Run
goreleaser --rm-dist --snapshot
in the project folder to build a snapshot of latest code. A binary installation, ready for use will be put in the dist folder.
Publishing
goreleaser
requires the current commit to be tagged in GitHub in order to be published, so if you want to publish the latest code, commit it and tag the commit. If you want to publish an earlier version, check out the version. Then a build (goreleaser --rm-dist
) will publish xp-cli
to GitHub and our own Artifactory repo, as long as it is set up correctly:
- GitHub - To publish to GitHub, you must have publishing rights on the xp-cli project, and a personal Access Code to identify yourself. This can be set up on GitHub by going to your personal Settings / Developer Settings / Personal Access tokens. Create a token with all rights to repo and put it in
~/.config/goreleaser/github_token
- repo.enonic.com - This repo use the Artifactory general
ci
user. The API key for the ci
user must be put in a local environment variable called ARTIFACTORY_REPO_SECRET
.
If you build a snapshot with goreleaser --rm-dist --snapshot
, it may be uploaded to our repo by executing this command for each created distro:
curl -u ci:$ARTIFACTORY_REPO_SECRET -X PUT "http://repo.enonic.com/public/com/enonic/cli/enonic/next/enonic_1.0.0-next_Windows_64-bit.zip" -T enonic_1.0.0-next_Windows_64-bit.zip