An SWS application implemented in the Go Programming Language.
SWS is published as a docker image on Docker hub at jmazzitelli/sws
See the LICENSE file.
|
Note
|
These build instructions assume you have the following installed on your system: (1) Go Programming Language which must be at least version 1.8, (2) git, (3) Docker, and (4) make. To run SWS on OpenShift after you build it, it is assumed you have a running OpenShift environment available to you. If you do not, you can find a set of instructions on how to set up OpenShift below. To run SWS on Kubernetes after you built it, it is assumed you have a running Kubernetes environment available to you. |
To build SWS:
-
Clone this repository inside a GOPATH. These instructions will use the example GOPATH of "/source/go/swift-sunshine/swscore" but you can use whatever you want. Just change the first line of the below instructions to use your GOPATH.
export GOPATH=/source/go/swift-sunshine/sws
mkdir -p $GOPATH
cd $GOPATH
mkdir -p src/github.com/swift-sunshine
cd src/github.com/swift-sunshine
git clone git@github.com:swift-sunshine/swscore
export PATH=${PATH}:${GOPATH}/bin-
Install dep - the Go dependency management tool that SWS uses to build itself
cd ${GOPATH}/src/github.com/swift-sunshine/swscore
make dep-install-
Tell dep to install the SWS dependencies
cd ${GOPATH}/src/github.com/swift-sunshine/swscore
make dep-update-
Build SWS
cd ${GOPATH}/src/github.com/swift-sunshine/swscore
make build-
At this point you can run the SWS tests
cd ${GOPATH}/src/github.com/swift-sunshine/swscore
make testThe following section assumes that the user has OpenShift Origin installed.
The OpenShift Origin Documentation will outline all the steps required.
You can alternatively build OpenShift Origin from source and run that. See hack/README.adoc for a quick way to do this using the *-openshift.sh scripts provided by this project.
Create the SWS docker image through the "docker" make target:
cd ${GOPATH}/src/github.com/swift-sunshine/swscore
make docker|
Note
|
The following commands assume that the oc command is available in the user’s path and that the user is logged in.
|
The deploy and undeploy commands are automated in the Makefile. The following will undeploy an old installation of SWS, if available, and deploy a new one:
make openshift-deploy
The following section assumes that the user has Kubernetes installed.
Create the SWS docker image through the "docker" make target:
cd ${GOPATH}/src/github.com/swift-sunshine/swscore
make docker|
Note
|
The following commands assume that the kubectl command is available in the user’s path and that the user is logged in.
|
The deploy and undeploy commands are automated in the Makefile. The following will undeploy an old installation of SWS, if available, and deploy a new one:
make k8s-deploy
Sometimes you may want to run SWS outside of any container environment, perhaps for debugging purposes. To do this, run:
cd ${GOPATH}/src/github.com/swift-sunshine/swscore
make install
make runThe "install" target installs the SWS executable in your GOPATH /bin directory so you can run it outside of the Makefile:
cd ${GOPATH}/src/github.com/swift-sunshine/swscore
make install
${GOPATH}/bin/sws -config <your-config-file>Many configuration settings can optionally be set via environment variables. If one of the environment variables below are set, they serve as the default value for its associated YAML configuration setting. The following are currently supported:
| Environment Variable Name | Description and YAML Setting |
|---|---|
|
Description of string here. foo:
string: VALUE |
|
Description of int here. foo:
int: VALUE |