Install Codewind on MacOS or Windows. Prebuilt binary files are available for download on Eclipse.
- Before starting
- Downloading the release binary file for
- Building and deploying locally on MacOS
- Creating a cross-platform binary
- Running the Tests
- API
- Contributing
Ensure that you are logged in to Docker. Type docker login
into a command line window and follow the instructions.
- Download the release binary file to a folder on your system.
- Use the
cd
command to go to the location of the downloaded file in the command line window. - If the binary file has the
.dms
extension, remove the extension so that the file is namedcwctl-macos
. - Enter the
chmod +x cwctl-macos
command to give yourself execution permissions for the binary. - If you already have a
codewind-workspace
with your projects in it, copy it into your/Users/<username>
home directory. If you do not already have a workspace, the CLI creates an empty workspace for you in this directory. - Type
./cwctl-macos
in the command line window to run the CLI. - To run a command, enter
./cwctl-macos <command>
.
- Download the release binary file to a folder on your system.
- Use the
cd
command to go to the location of the downloaded file in the command line window. - If necessary, remove any file extensions so that the file is named
cwctl-linux
. - Enter the
chmod +x cwctl-linux
command to give yourself execution permissions for the binary. - If you already have a
codewind-workspace
with your projects in it, copy the workspace into your$HOME
home directory. If you do not already have a workspace, the CLI creates an empty workspace for you in this directory. - Install
docker-compose
with Install Docker Compose. - To run the CLI, enter
./cwctl-linux
in the command line window. - To run a command, enter
./cwctl-linux <command>
.
- Download the release binary file to a folder on your system.
- Use the
cd
command to go to the location of the downloaded file in the command prompt. - Ensure that the binary file has an
.exe
extension. If it doesn't, add the extension to the file name. - Ensure that your
C:\
drive is shared with Docker Desktop for Windows. To check, go to Settings>Shared drives and make sure theC:\
drive check box is selected. - If you already have a
codewind-workspace
with your projects in it, copy thecodewind-workspace
into yourC:\
directory. If you do not already have a workspace, the CLI creates an empty one for you in this directory. - To get started and see the commands that are available, type the
.\cwctl-win.exe
command in the command prompt. - To run a command, enter
.\cwctl-win.exe <command>
.
- Ensure that you have a Go environment set up. If you don't yet have a Go environment, see Install Go.
- If you have Brew, use the following commands to install
dep
for MacOS:
$ brew install dep
$ brew upgrade dep
- Create the directory tree expected
../go/src/github.com/eclipse
. - Use the
cd
command to go to theeclipse
directory that you previously created. - After you go to this directory, clone the repository by typing
git clone https://github.com/eclipse/codewind-installer.git
. - Use the
cd
command to go to the project directory and install the vendor packages with thedep ensure -v
command. - Build the binary and give it a name with the
go build -o <binary-name>
command. To build a binary without the debug symbols, use thego build -ldflags="-s -w" -o <binary-name>
command. - Copy your
codewind-workspace
into your/Users/<username>
home directory. - Type
./<binary-name>
in the command line window to run the CLI. - To run a command, enter
./<binary-name> <command>
.
- Use the
go tool dist list
command to get a list of the possibleGOOS/ARCH
combinations available to build. - Choose the
GOOS/ARCH
that you want to build for and then enterGOOS=<OS> GOARCH=<ARCH> go build
to create the binary. To build a binary without the debug symbols, use theGOOS=<OS> GOARCH=<ARCH> go build -ldflags="-s -w"
command.
- Set up your environment by installing bats-core as per the bats-core instructions found at https://github.com/bats-core/bats-core.
- Clone the
codewind-installer
repository. - Use the
cd
command to go to the top level project directory. - Ensure your system environment is clean by having no Codewind images installed or containers running.
- To run the tests, enter the
bats integration.bats
command in the command line window and wait for the tests to finish.
$ go test ./...
$ go test github.com/eclipse/codewind-installer/utils
$ go test github.com/eclipse/codewind-installer/utils -run ^(TestDetermineProjectInfo)$ # or ^(DetermineProjectInfo)$
$ go test github.com/eclipse/codewind-installer/utils -run ^(TestDetermineProjectInfo)$
E.g.:
PASS
ok github.com/eclipse/codewind-installer/utils
To see more details, use go test -v
.
$ ./test.sh -coverage
This is the same as go test ./...
, but outputs test coverage scores for each function, package, and an overall score.
Command | Alias | Usage |
---|---|---|
project | 'Manage Codewind projects' | |
install | in |
'Pull pfe & performance images from dockerhub' |
start | 'Start the Codewind containers' | |
status | 'Print the installation status of Codewind' | |
stop | 'Stop the running Codewind containers' | |
stop-all | 'Stop all of the Codewind and project containers' | |
remove | rm |
'Remove Codewind/Project docker images and the codewind network' |
templates | 'Manage project templates' | |
sectoken | st |
'Authenticate with username and password to obtain an access_token' |
secrealm | sr |
'Manage new or existing REALM configurations' |
secclient | sc |
'Manage new or existing APPLICATION access configurations' |
seckeyring | sk |
'Manage Codewind keys in the desktop keyring' |
secuser | su |
'Manage new or existing USER access configurations' |
connections | con |
'Manage connections configuration list' |
help | h |
'Shows a list of commands or help for one command' |
--url/-u <value>
- URL of project to download
Subcommands:
bind
- Bind a project to Codewind for building and running
Flags: --name,-n value Project name --language,-l value Project language --type,-t value Project Type --path,-p value Project Path --conid value Connection ID
sync
- Synchronize a bound project to its connection
Flags: --path,-p value Project Path --id,-i value Project ID --time,-t value Time of last project sync
connection/con
- Manage the connection targets for a project
set,s
- Sets the connection for a projectID
Flags: --id,i value Project ID --conid value Connection ID
get,g
- Gets connections for a projectID
Flags: --id,i value Project ID
remove,r
- Removes the connection from a projectID
Flags: --id,i value Project ID
--tag/-t <value>
- Dockerhub image tag (default: "latest")
--json/-j
- Specify terminal output
--tag/-t <value>
- Dockerhub image tag (default: "latest")
--debug/-d
- Add debug output
--json/-j
- Specify terminal output
Note: No additional flags
Note: No additional flags
--tag/-t <value>
- Dockerhub image tag.
Note: Failing to specify a --tag
, will remove all Codewind images on the host machine.
Note: No additional flags
Subcommands:
list/ls
- List available templates
Subcommands:
get/g
- Authenticate and obtain an access_token.
Note 1:: The preferred way to authenticate is by supplying just the connection ID (conid) and username. In this mode the command will use the stored password from the platform keyring Note 2:: If you dont have a connection ID (conid) you must supply use the host, realm and client flags Note 3:: You can use a combination of both the connection ID (conid) and host/realm/client flags. In this mode, the host/realm/client flags take precedence override the connection defaults Note 4:: The password flag is optional when used with the connection ID (conid) flag and when a password already exists in the platform keyring. Including the password flag will update the keychain password after a successful login or add a password to the keychain if one does not exist
Flags: --host value URL or ingress to Keycloak service --realm value Application realm --username value Account Username --password value Account Password --client value Client --conid value Use connection details from a connection configuration
Subcommands:
create/c
- Create a new realm (requires either admin_token or username/password)
Flags: --host value URL or ingress to Keycloak service --newrealm value Application realm to be created --accesstoken value Admin access_token
Subcommands:
create/c
- Create a new client in an existing Keycloak realm (requires either admin_token or username/password)
--host value URL or ingress to Keycloak service --realm value Application realm where client should be created --newclient value New client ID to create --redirect value Allowed redirect callback URL eg:
http://127.0.0.1:9090/*
--accesstoken value Admin access_token
get/g
- Get client id (requires either admin_token or username/password)
--host value URL or ingress to Keycloak service --realm value Application realm --clientid value Client ID to retrieve --accesstoken value Admin access_token --username value Admin Username --password value Admin Password
secret/s
- Get client secret (requires either admin_token or username/password)
--host value URL or ingress to Keycloak service --realm value Application realm --clientid value Client ID to retrieve --accesstoken value Admin access_token --username value Admin Username --password value Admin Password
Subcommands:
update/u
- Add new or update existing Codewind credentials key in keyring
--conid
<value>
Connection ID (see the connections cmd) --username<value>
Username --password<value>
Password
validate/v
- Checks if credentials key exist in the keyring
--conid
<value>
Connection ID (see the connections cmd) --username<value>
Username
Subcommands:
create/c
- Create a new user in an existing Keycloak realm (requires either admin_token or username/password)
--host value URL or ingress to Keycloak service --realm value Application realm --accesstoken value Admin access_token --username value Admin Username --password value Admin Password --name value Username to add
get/g
- Gets an existing Keycloak user from an existing realm (requires either admin_token or username/password)
--host value URL or ingress to Keycloak service --realm value Application realm --accesstoken value Admin access_token --username value Admin Username --password value Admin Password --name value Username to query
setpw/p
- Reset an existing users password (requires either admin_token or username/password)
--host value URL or ingress to Keycloak service --realm value Application realm --accesstoken value Admin access_token --username value Admin Username --password value Admin Password --name value Username to query --newpw value New replacement password
Subcommands:
add/a
- Add a new connection to the list
Flags: --label value A displayable name --url value The ingress URL of the PFE instance
get/g
- Get a connection using its ID
Flags: --conid value The Connection ID to retrieve
remove/rm
- Remove a connection from the list
Flags: --conid value A connection id
list/ls
- List known connections
Note: No additional flags
reset
- Resets the connections list to a single local connection
Note: No additional flags
--help/-h
- Shows a list of commands or help for one command
Submit issues and contributions: