Permalink
Browse files

vendor deps

  • Loading branch information...
kamilsk committed Mar 26, 2018
1 parent e237183 commit 8f891c5f760cbb9f6084a6f3512fe1b31e789efc
Showing 1,357 changed files with 795,744 additions and 47 deletions.
@@ -1,6 +1,3 @@
# dep
vendor/

# goreleaser
/dist/

@@ -38,7 +38,7 @@ build:
- linux
- windows
ldflags: -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}}
main: .
main: .

checksum: { name_template: checksums.txt }

@@ -1,7 +1,7 @@
build:
dependencies:
override:
- make deps generate
- make generate

environment:
go: go1.9
@@ -24,7 +24,7 @@ before_install:
- make tools

install:
- make deps generate
- make generate

script:
- make test-with-coverage-profile ARGS='-timeout=1s'
@@ -4,10 +4,10 @@ SUPPORTED_VERSIONS = 1.9 1.10 latest
include makes/env.mk
include makes/local.mk
include makes/docker.mk
include env/cmd.make
include env/docker.make
include env/docker-compose.make
include env/tools.make
include env/cmd.mk
include env/docker.mk
include env/docker-compose.mk
include env/tools.mk

.PHONY: code-quality-check
code-quality-check: ARGS = \
@@ -22,36 +22,6 @@ code-quality-report:
time make code-quality-check | tail +7 | tee report.out | pbcopy


.PHONY: tools
tools:
if ! command -v dep > /dev/null; then \
go get github.com/golang/dep/cmd/dep; \
fi
if ! command -v mockgen > /dev/null; then \
go get github.com/golang/mock/mockgen; \
fi
# quick fix of https://github.com/kamilsk/form-api/issues/70
# https://github.com/jteeuwen/go-bindata/compare/master...a-urth:master
if ! command -v go-bindata > /dev/null; then \
go get -d github.com/a-urth/go-bindata/go-bindata; \
cd $GOPATH/src/github.com/a-urth/go-bindata && git checkout df38da1; \
go install github.com/a-urth/go-bindata/go-bindata; \
fi

.PHONY: deps
deps: tools
dep ensure -v

.PHONY: generate
generate: tools
find . -name mock_*.go | grep -v ./vendor | xargs rm || true
go generate ./...

.PHONY: static
static: tools
go-bindata -o static/bindata.go -pkg static -ignore "^.+\.go$$" -ignore "static/fixtures" static/...


.PHONY: pull-github-tpl
pull-github-tpl:
rm -rf .github
@@ -74,7 +44,6 @@ pull-makes:
)
rm -rf makes/.git


.PHONY: pull-template
pull-template:
rm -rf template
@@ -9,7 +9,7 @@ POSTGRES_INITDB_WALDIR=

# server
SERVICE_HOST=service
SERVICE_PORT=8080
SERVICE_PORT=80
DOMAIN_NAME=_
DOMAIN_PORT=8080
BASIC_USER=admin
@@ -19,7 +19,7 @@ BASIC_PASS=admin
# service
MAX_CPUS=1
BIND=0.0.0.0
PORT=8080
PORT=80
READ_TIMEOUT=0
READ_HEADER_TIMEOUT=0
WRITE_TIMEOUT=0
@@ -30,6 +30,8 @@ DB_PORT=5432
DB_USER=postgres
DB_PASS=postgres
DB_NAME=postgres
DB_OPEN_CONN=1
DB_IDLE_CONN=1
DB_TIMEOUT=1
DB_SSLMODE=disable

@@ -0,0 +1,28 @@
FROM golang:1.10 AS build

ARG QUICK

WORKDIR /go/src/github.com/kamilsk/passport

ADD . .

ENV GOOS linux
ENV GOARCH amd64
ENV CGO_ENABLED 0

RUN echo "os: ${GOOS}", "arch: ${GOARCH}", "cgo: ${CGO_ENABLED}" \
&& go install -ldflags '-s -w -X main.version=dev -X main.commit=dev -X main.date=dev' .

# ~~~

FROM alpine:latest AS service

LABEL maintainer="Kamil Samigullin <kamil@samigullin.info>"

COPY --from=build /go/bin/passport /usr/local/bin/

ENV BIND "0.0.0.0"
ENV PORT "80"

ENTRYPOINT [ "passport" ]
CMD [ "run" ]
File renamed without changes.
@@ -0,0 +1,108 @@
.PHONY: docker-compose
docker-compose:
cp -n env/.example.env env/.env || true
cp -n env/.env .env || true # because https://docs.docker.com/compose/env-file/
docker-compose -f env/docker-compose.yml $(COMMAND)



.PHONY: up
up: COMMAND = up -d
up: docker-compose

.PHONY: fresh-up
fresh-up: COMMAND = up --build --force-recreate -d
fresh-up: docker-compose

.PHONY: down
down: COMMAND = down
down: docker-compose

.PHONY: clean-down
clean-down: COMMAND = down --volumes --rmi local
clean-down: docker-compose

.PHONY: status
status: COMMAND = ps
status: docker-compose



.PHONY: start-db
start-db: COMMAND = start db
start-db: docker-compose

.PHONY: stop-db
stop-db: COMMAND = stop db
stop-db: docker-compose

.PHONY: logs-db
logs-db: COMMAND = logs -f db
logs-db: docker-compose

.PHONY: psql
psql: COMMAND = exec db /bin/sh -c 'su - postgres -c psql'
psql: docker-compose

.PHONY: backup
backup: COMMAND = exec db /bin/sh -c 'su - postgres -c "pg_dump --if-exists --clean $${POSTGRES_DB}"' > ./env/backup.sql
backup: docker-compose

.PHONY: restore
restore:
cat ./env/backup.sql | docker exec -i $$(make status | tail +3 | awk '{print $$1}' | grep _db_ | head -1) \
/bin/sh -c 'cat > /tmp/backup.sql && su - postgres -c "psql --single-transaction $${POSTGRES_DB} < /tmp/backup.sql"'



.PHONY: start-migration
start-migration: COMMAND = start migration
start-migration: docker-compose

.PHONY: stop-migration
stop-migration: COMMAND = stop migration
stop-migration: docker-compose

.PHONY: logs-migration
logs-migration: COMMAND = logs -f migration
logs-migration: docker-compose



.PHONY: start-server
start-server: COMMAND = start server
start-server: docker-compose

.PHONY: stop-server
stop-server: COMMAND = stop server
stop-server: docker-compose

.PHONY: logs-server
logs-server: COMMAND = logs -f server
logs-server: docker-compose



.PHONY: start-service
start-service: COMMAND = start service
start-service: docker-compose

.PHONY: stop-service
stop-service: COMMAND = stop service
stop-service: docker-compose

.PHONY: logs-service
logs-service: COMMAND = logs -f service
logs-service: docker-compose



.PHONY: demo
demo: COMMAND = exec service passport migrate up --with-demo
demo: docker-compose



.PHONY: rm-volumes
rm-volumes: down
docker volume ls | tail +2 | awk '{print $$2}' | grep ^env_ | xargs docker volume rm
@@ -24,6 +24,7 @@ services:
volumes:
- ./etc/nginx.conf:/etc/nginx/nginx.conf:ro
- ./etc/service.conf:/etc/nginx/conf.d/service.template:ro
- ../public:/usr/share/sites/passport;
- certificates:/etc/nginx/ssl
- le_challenge:/usr/share/sites/${DOMAIN_NAME}

@@ -0,0 +1,35 @@
.PHONY: docker-build
docker-build:
docker build -f env/Dockerfile \
-t kamilsk/passport:latest \
--force-rm --no-cache --pull --rm \
.

.PHONY: docker-push
docker-push:
docker push kamilsk/passport:latest

.PHONY: docker-refresh
docker-refresh:
docker images --all \
| grep '^kamilsk\/passport\s\+' \
| awk '{print $$3}' \
| xargs docker rmi -f &>/dev/null || true
docker pull kamilsk/passport:latest



.PHONY: docker-start
docker-start:
docker run --rm -d \
--name passport-dev \
--publish 8080:8080 \
kamilsk/passport:latest

.PHONY: docker-logs
docker-logs:
docker logs -f passport-dev

.PHONY: docker-stop
docker-stop:
docker stop passport-dev

This file was deleted.

Oops, something went wrong.
@@ -0,0 +1,21 @@
.PHONY: tools
tools:
if ! command -v mockgen > /dev/null; then \
go get github.com/golang/mock/mockgen; \
fi
# quick fix of https://github.com/kamilsk/form-api/issues/70
# https://github.com/jteeuwen/go-bindata/compare/master...a-urth:master
if ! command -v go-bindata > /dev/null; then \
go get -d github.com/a-urth/go-bindata/go-bindata; \
cd $(GOPATH)/src/github.com/a-urth/go-bindata && git checkout df38da1; \
go install github.com/a-urth/go-bindata/go-bindata; \
fi

.PHONY: generate
generate: tools
find . -name mock_*.go | grep -v ./vendor | xargs rm || true
go generate ./...

.PHONY: static
static: tools
go-bindata -o static/bindata.go -pkg static -ignore "^.+\.go$$" -ignore "static/fixtures" static/...

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 8f891c5

Please sign in to comment.