Permalink
Browse files

Back to Glide

  • Loading branch information...
s32x committed Dec 14, 2018
1 parent cd227ae commit 3600c92752b6545c827e5e43d729a3008acd37db
Showing 2,176 changed files with 433,630 additions and 860 deletions.
@@ -4,19 +4,20 @@ jobs:
working_directory: /go/src/s32x.com/ipdata
environment:
- DOCKER_TAG: s32x/ipdata
- HEROKU_APP: ipdatainfo
docker:
- image: circleci/golang:1.11.2
- image: circleci/golang:1.11.3
steps:
- checkout
- run:
name: Run unit tests
command: make test
- run:
name: Install Packr
command: go get -u github.com/gobuffalo/packr/v2/packr2
- run:
name: Run unit tests
command: make test
- run:
name: Build binary for Alpine linux
command: env CGO_ENABLED=0 GOOS=linux GOARCH=amd64 packr2 build -o bin/server
command: env CGO_ENABLED=0 GOOS=linux GOARCH=amd64 packr2 build -ldflags="-s -w" -o bin/server
- setup_remote_docker
- run:
name: Build Docker image with binary
@@ -26,4 +27,16 @@ jobs:
command: docker login -u $DOCKER_USER -p $DOCKER_PASS
- run:
name: Push image to DockerHub
command: docker push $DOCKER_TAG
command: docker push $DOCKER_TAG
- run:
name: Install the Heroku CLI
command: curl https://cli-assets.heroku.com/install.sh | sh
- run:
name: Login to Heroku Containers
command: heroku container:login
- run:
name: Push the image to Heroku
command: heroku container:push web -a $HEROKU_APP
- run:
name: Release the image on Heroku
command: heroku container:release web -a $HEROKU_APP
@@ -1,31 +1,21 @@
clean:
-rm -rf bin
packr2 clean
go clean
deps:
make clean
-rm -rf vendor
-rm -f go.mod
-rm -f go.sum
env GO111MODULE=on go mod init
env GO111MODULE=on go mod vendor
-rm -r glide.yaml
-rm -f glide.lock
glide cache-clear
glide init --non-interactive
glide install
test:
go test ./...
run:
make clean
packr2 build -o ./bin/server
packr2 clean
packr2 build -ldflags="-s -w" -o ./bin/server
./bin/server
install:
make clean
make deps
packr2 install
deploy:
make clean
make deps
make test
env CGO_ENABLED=0 GOOS=linux GOARCH=amd64 packr2 build -o ./bin/server
heroku container:login
heroku container:push web -a ipdatainfo
heroku container:release web -a ipdatainfo
make clean
packr2 install

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -0,0 +1,13 @@
package: s32x.com/ipdata
import:
- package: github.com/gobuffalo/packr
subpackages:
- v2
- package: github.com/labstack/echo
subpackages:
- middleware
- package: github.com/mmcloughlin/geohash
- package: github.com/oschwald/maxminddb-golang
- package: golang.org/x/sync
subpackages:
- errgroup
15 go.mod

This file was deleted.

Oops, something went wrong.
@@ -7,7 +7,12 @@ import (
"s32x.com/ipdata/service"
)

func main() { service.Start(getenv("PORT", "8080"), getenv("ENV", "dev")) }
func main() {
service.Start(
getenv("PORT", "8080"),
getenv("ENV", "dev"),
)
}

// getenv attempts to retrieve and return a variable from the environment. If it
// fails it will either crash or failover to a passed default value
@@ -28,7 +28,7 @@ func Start(port, env string) {
e.Use(middleware.CORS())
e.Use(middleware.Gzip())

// Perform HTTP redirects and serve the web index if being hosted in prod
// Configure HTTP redirects and serve the web index if being hosted in prod
if strings.Contains(strings.ToLower(env), "prod") {
e.Pre(middleware.HTTPSNonWWWRedirect())

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
Oops, something went wrong.

0 comments on commit 3600c92

Please sign in to comment.