Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
corteza
corteza-server
Commits
48ea1503
Commit
48ea1503
authored
6 years ago
by
Tit Petric
Browse files
Options
Download
Email Patches
Plain Diff
upd(build): add docker, docker-push
parent
daf92fd9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
9 deletions
+60
-9
.dockerignore
.dockerignore
+2
-1
Makefile
Makefile
+28
-8
docker/Dockerfile
docker/Dockerfile
+30
-0
No files found.
.dockerignore
View file @
48ea1503
*/templates
*/docs
*/db
build
codegen
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Makefile
View file @
48ea1503
.PHONY
:
build
realize dep
spec
protobuf
critic
test test.rbac
qa qa.test qa.
vet codegen
.PHONY
:
nothing docker docker-push
realize dep
dep.update
protobuf test test.rbac
test.sam test.crm qa critic
vet codegen
PKG
=
"github.com/
$(
shell
cat .project
)
"
...
...
@@ -17,9 +17,29 @@ GOTEST = ${GOPATH}/bin/gotest
GOCRITIC
=
${GOPATH}
/bin/gocritic
MOCKGEN
=
${GOPATH}
/bin/mockgen
build
:
docker build
--no-cache
--rm
-t
$(
shell
cat
.project
)
.
nothing
:
@
echo
@
echo
Usage: make
[
target]
@
echo
@
echo
- docker: builds docker images locally
@
echo
- docker-push: push built images
@
echo
@
echo
- vet - run go vet on all code
@
echo
- critic - run go critic on all code
@
echo
- test.crm - individual package unit tests
@
echo
- test.sam - individual package unit tests
@
echo
- test.rbac - individual package unit tests
@
echo
-
test
- run all available unit tests
@
echo
- qa - run vet, critic and
test
on code
@
echo
docker
:
docker build
--no-cache
--rm
--build-arg
APP
=
sam
-f
docker/Dockerfile
-t
crusttech/sam .
docker build
--no-cache
--rm
--build-arg
APP
=
crm
-f
docker/Dockerfile
-t
crusttech/crm .
docker-push
:
docker push crusttech/sam
docker push crusttech/crm
########################################################################################################################
# Development
...
...
@@ -44,9 +64,6 @@ protobuf: $(PROTOC)
########################################################################################################################
# QA
critic
:
$(GOCRITIC)
PATH
=
${PATH}
:
${GOPATH}
/bin
$(GOCRITIC)
check-project .
test
:
$(GOTEST)
$(GOTEST)
-covermode
count
-coverprofile
.cover.out
-v
./...
$(GO)
tool cover
-func
=
.cover.out
...
...
@@ -64,7 +81,10 @@ test.rbac: $(GOTEST)
$(GO)
tool cover
-func
=
.cover.out |
grep
--color
"^
\|
[^0-9]0.0%"
vet
:
$(GO)
vet
`
cd
${GOPATH}
/src/
;
find
$(PKG)
-type
f
-name
'*.go'
-and
-not
-path
'*vendor*'
|xargs
-n1
dirname
|uniq
`
$(GO)
vet ./...
critic
:
$(GOCRITIC)
$(GOCRITIC)
check-project .
qa
:
vet critic test
...
...
This diff is collapsed.
Click to expand it.
Dockerfile
→
docker/
Dockerfile
View file @
48ea1503
## builder image
FROM
golang:1.10-alpine AS builder
WORKDIR
/go/src/github.com/crusttech/crust
ARG
APP
ENV
APP=$APP
ENV
CGO_ENABLED=0
COPY
. .
RUN
mkdir
/build
;
\
find cmd
-type
d
-mindepth
1
-maxdepth
1 |
while
read
CMDPATH
;
do
\
go build
-o
/build/
$(
basename
${
CMDPATH
}
)
${
CMDPATH
}
/
*
.go
;
\
done
;
RUN
mkdir
/build
;
go build
-o
/build/
$APP
cmd/
$APP
/
*
.go
## target image
FROM
alpine:3.7
...
...
@@ -18,6 +22,9 @@ WORKDIR /crust
# @todo copy crm/types, migrations
COPY
--from=builder ./build/* /crust/
COPY
--from=builder /build/* /crust/
ARG
APP
ENV
APP=$APP
CMD
["/bin/echo", "Run of the crust commands: sam, crm"]
\ No newline at end of file
ENTRYPOINT
/crust/$APP
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment