Slack App client
- Install Go 1.8.x
- Clone this repository into: $GOPATH/src/github.com/guregodevo
- To build, run: make
- You may need to pull in packages: go get {package path}
- To run tests, run: make tests
- To create a linux build, run: make dist
- Copy the following files to the service machine:
- discomotionslack (the binary)
- ${ENV}.config.yaml (the config file appropriate to the environment)
$ ./discomotionslack --config dev.config.yaml
An alternative is to run the API in an isolated environment, using docker containers.
- Install Docker and Docker Compose
brew cask install docker
on MacOS, and then launch theDocker
application to start the docker daemon
- Clone this repository
git clone https://github.com/guregodevo/discomotionslack.git
- Start the application (and all its dependencies)
make run-in-docker
- The API is exposed on the port
8080
. And check the available HTTP endpoints. - At the end, just hit
ctrl+c
in the docker output to stop the containers
Dependencies are managed with Dep, and are already "vendored" (stored in the vendor
dir, so that you don't need to retrieve them yourself).
We vendor our dependencies to have reproductible builds and be sure of what we have in the binary.
- Get Dep:
go get -u github.com/golang/dep/cmd/dep
- Use the new dependency in your source code (for example
import github.com/pkg/errors
in your.go
files, and do something with it)- If your IDE runs
goimports
on save, and complains about the new pkg being unknown,go get
-it before (for examplego get github.com/pkg/errors
for example)
- If your IDE runs
- Run
dep ensure pkg@version
(for exampledep ensure github.com/pkg/errors@0.8.0
) - the version can be a git tag or branch- This will update the
Gopkg.toml
file - If you ommit the version,
dep
will not add the new dependency to theGopkg.toml
file, only to theGopkg.lock
file (which is not what we want) - The
Gopkg.lock
file and thevendor
dir should have changed too. If not, that's because you didn't use the new dependency in your source code.dep
is smart enough to not add a dependency that you are not using ;-)
- This will update the
- Review the changes, run the tests, and commit
If you want to update one or more dependencies:
- Get Dep:
go get -u github.com/golang/dep/cmd/dep
- Edit the
Gopkg.toml
file to use a more recent version of the dependency - Run
dep ensure -update
- The
Gopkg.lock
file and thevendor
dir should have changed
- The
- Review the changes, run the tests, and commit