Skip to content

Commit

Permalink
new docker images (cs3org#309)
Browse files Browse the repository at this point in the history
* new docker images

* new pipeline for pr

* limit publish docker to master branch
  • Loading branch information
labkode authored Oct 17, 2019
1 parent 02e4953 commit de921b5
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 14 deletions.
55 changes: 54 additions & 1 deletion .drone.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,65 @@
---
kind: pipeline
type: docker
name: build
name: build-and-publish-docker

platform:
os: linux
arch: amd64

trigger:
branch:
- master
event:
exclude:
- pull_request
- tag
- promote
- rollback
steps:
- name: build
image: golang:1.13
commands:
- make ci

- name: publish-docker-reva-latest
pull: always
image: plugins/docker
settings:
repo: cs3org/reva
tags: latest
dockerfile: Dockerfile.reva
username:
from_secret: dockerhub_username
password:
from_secret: dockerhub_password

- name: publish-docker-revad-latest
pull: always
image: plugins/docker
settings:
repo: cs3org/revad
tags: latest
dockerfile: Dockerfile.revad
username:
from_secret: dockerhub_username
password:
from_secret: dockerhub_password

---
kind: pipeline
type: docker
name: build-only

platform:
os: linux
arch: amd64

trigger:
event:
include:
- pull_request

steps:
- name: build
image: golang:1.13
Expand Down
6 changes: 1 addition & 5 deletions Dockerfile.reva
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,5 @@ FROM golang:1.13

WORKDIR /go/src/github/cs3org/reva
COPY . .
RUN GO111MODULE=off make deps
ENV GO111MODULE=on
RUN make deps && make
WORKDIR /go/src/github/cs3org/reva/cmd/reva
RUN go install
RUN make build-reva-docker && cp /go/src/github/cs3org/reva/cmd/reva/reva /go/bin/reva
ENTRYPOINT ["/go/bin/reva"]
8 changes: 1 addition & 7 deletions Dockerfile.revad
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,7 @@ FROM golang:1.13

WORKDIR /go/src/github/cs3org/reva
COPY . .
RUN GO111MODULE=off make deps
ENV GO111MODULE=on
RUN make deps && make
WORKDIR /go/src/github/cs3org/reva/cmd/revad
RUN go install
RUN mkdir -p /etc/revad/
RUN echo "" > /etc/revad/revad.toml
RUN make build-revad-docker && cp /go/src/github/cs3org/reva/cmd/revad/revad /go/bin/revad && mkdir -p /etc/revad/ && echo "" > /etc/revad/revad.toml
EXPOSE 9999
EXPOSE 10000
CMD ["/go/bin/revad", "-c", "/etc/revad/revad.toml", "-p", "/var/run/revad.pid"]
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ tidy:
go mod tidy

build-revad: imports
go build -mod=venodr -o ./cmd/revad/revad ${LDFLAGS} ./cmd/revad
go build -mod=vendor -o ./cmd/revad/revad ${LDFLAGS} ./cmd/revad

build-reva: imports
go build -mod=vendor -o ./cmd/reva/reva ${LDFLAGS} ./cmd/reva
Expand Down Expand Up @@ -54,3 +54,10 @@ lint-ci:

# to be run in CI platform
ci: build-ci test lint-ci

# to be run in Docker build
build-revad-docker: off
go build -mod=vendor -o ./cmd/revad/revad ${LDFLAGS} ./cmd/revad
build-reva-docker: off
go build -mod=vendor -o ./cmd/revad/reva ${LDFLAGS} ./cmd/reva

0 comments on commit de921b5

Please sign in to comment.