Skip to content

Commit

Permalink
add scripts for building, installing and testing confd
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Fisher committed Mar 11, 2015
1 parent 59ca7ec commit 1bc7507
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bin
7 changes: 6 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
language: go

go:
- 1.3
- 1.2
- tip
install:
- go get github.com/tools/godep
- go get golang.org/x/tools/cmd/cover
- ./build
- sudo ./install
script: ./test
12 changes: 12 additions & 0 deletions build
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash

set -e

GO="godep go"

ORG_PATH="github.com/kelseyhightower"
REPO_PATH="${ORG_PATH}/confd"

echo "Building confd..."
# Static compilation is useful when confd is run in a container
CGO_ENABLED=0 $GO build -a -installsuffix cgo -ldflags '-s' -o bin/confd ${REPO_PATH}
3 changes: 3 additions & 0 deletions clean
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash

rm -f bin/*
10 changes: 5 additions & 5 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@ Currently confd ships binaries for OS X and Linux 64bit systems. You can downloa
#### OS X

```
wget https://github.com/kelseyhightower/confd/releases/download/v0.7.1/confd-0.7.1-darwin-amd64
$ wget https://github.com/kelseyhightower/confd/releases/download/v0.7.1/confd-0.7.1-darwin-amd64
```

#### Linux

```
wget https://github.com/kelseyhightower/confd/releases/download/v0.7.1/confd-0.7.1-linux-amd64
$ wget https://github.com/kelseyhightower/confd/releases/download/v0.7.1/confd-0.7.1-linux-amd64
```

Copy the confd binary to a bin directory in your path.
#### Building from Source

```
sudo mv confd /usr/local/bin/confd
sudo chmod +x /usr/local/bin/confd
$ ./build
$ sudo ./install
```

### Next Steps
Expand Down
7 changes: 7 additions & 0 deletions install
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

BIN_DIR=/usr/local/bin
INSTALL=install

echo "Installing confd to $BIN_DIR/confd..."
$INSTALL -c bin/confd $BIN_DIR/confd
7 changes: 7 additions & 0 deletions test
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

GO="godep go"


echo "Running tests..."
$GO test --cover --race ./...

0 comments on commit 1bc7507

Please sign in to comment.