Skip to content

Commit

Permalink
Merge pull request tinkerbell#35 from tinkerbell/update-drone-push-se…
Browse files Browse the repository at this point in the history
…ttings

Update push settings
  • Loading branch information
nathangoulding authored and mmlb committed Apr 21, 2020
2 parents cf30be0 + 0a6d143 commit 7ac9ad5
Show file tree
Hide file tree
Showing 5 changed files with 104 additions and 43 deletions.
115 changes: 89 additions & 26 deletions .drone.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,107 @@
---

publish_pr_tmpl: &publish_pr_tmpl
group: publish
image: plugins/docker
registry: quay.io
tags:
- ${DRONE_PULL_REQUEST}
- ${DRONE_PULL_REQUEST}-${DRONE_BUILD_NUMBER}-${DRONE_COMMIT_SHA}
when:
event: pull_request
secrets:
- source: public_docker_password
target: docker_password
- source: public_docker_username
target: docker_username

publish_master_tmpl: &publish_master_tmpl
<<: *publish_pr_tmpl
tags:
- latest
- ${DRONE_BUILD_NUMBER}-${DRONE_COMMIT_SHA}
when:
branch: master
event: push
secrets:
- docker_password
- docker_username

publish_tag_tmpl: &publish_tag_tmpl
<<: *publish_master_tmpl
tags: ${DRONE_TAG}
when:
event: tag

workspace:
base: /go
path: src/github.com/tinkerbell/tink

pipeline:
test:
group: ci
image: golang:1.13-alpine
image: golang:1.13-alpine3.11
commands:
- CGO_ENABLED=0 go test -v ./...

build:
group: ci
image: golang:1.13-alpine
image: golang:1.13-alpine3.11
commands:
- CGO_ENABLED=0 go build
- apk add --update make
- make

publish_pr_tink-cli:
<<: *publish_pr_tmpl
context: cli/tink
dockerfile: cli/tink/Dockerfile
repo: quay.io/tinkerbell/tink-cli-pr

publish:
group: publish
image: plugins/docker
registry: quay.io
publish_pr_tink-server:
<<: *publish_pr_tmpl
repo: quay.io/tinkerbell/tink-pr
tags:
- ${DRONE_BRANCH/\//-}
- ${DRONE_BUILD_NUMBER}-${DRONE_COMMIT_SHA}
when:
event: [push]
secrets:
- source: public_docker_username
target: docker_username
- source: public_docker_password
target: docker_password

publish_tag:
group: publish
image: plugins/docker
registry: quay.io
context: .
dockerfile: Dockerfile
repo: quay.io/tinkerbell/tink-pr

publish_pr_tink-worker:
<<: *publish_pr_tmpl
context: worker
dockerfile: worker/Dockerfile
repo: quay.io/tinkerbell/tink-worker-pr

publish_master_tink-cli:
<<: *publish_master_tmpl
context: cli/tink
dockerfile: cli/tink/Dockerfile
repo: quay.io/tinkerbell/tink-cli

publish_master_tink-server:
<<: *publish_master_tmpl
context: .
dockerfile: Dockerfile
repo: quay.io/tinkerbell/tink

publish_master_tink-worker:
<<: *publish_master_tmpl
context: worker
dockerfile: worker/Dockerfile
repo: quay.io/tinkerbell/tink-worker

publish_tag_tink-cli:
<<: *publish_tag_tmpl
context: cli/tink
dockerfile: cli/tink/Dockerfile
repo: quay.io/tinkerbell/tink-cli

publish_tag_tink-server:
<<: *publish_tag_tmpl
context: .
dockerfile: Dockerfile
repo: quay.io/tinkerbell/tink
tags: ${DRONE_TAG}
when:
event: [tag]
secrets: [docker_username, docker_password]

publish_tag_tink-worker:
<<: *publish_tag_tmpl
context: worker
dockerfile: worker/Dockerfile
repo: quay.io/tinkerbell/tink-worker
16 changes: 5 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
FROM golang:1.13-alpine
FROM alpine:3.11

ENTRYPOINT ["tink-server"]
EXPOSE 42113
EXPOSE 42114

WORKDIR /go/src/app

COPY . .

RUN apk update && \
apk add ca-certificates postgresql-client && \
apk add --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing cfssl && \
go build -o /go/bin/tink-server .
RUN apk add --update ca-certificates && \
apk add --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing cfssl

COPY deploy/migrate /migrate
COPY deploy/docker-entrypoint-initdb.d/tinkerbell-init.sql /init.sql

ENTRYPOINT ["tink-server"]
COPY tink-server /bin/
5 changes: 3 additions & 2 deletions cli/tink/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
FROM alpine:3.7
FROM alpine:3.11

CMD sleep 60d
CMD sleep infinity

RUN apk add --no-cache --update --upgrade ca-certificates

COPY tink-cli /bin/tink
COPY sample.tmpl /tmp
5 changes: 3 additions & 2 deletions tls/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FROM alpine:3.7
FROM alpine:3.11
ENTRYPOINT [ "/entrypoint.sh" ]
COPY . .

RUN apk add --no-cache --update --upgrade ca-certificates postgresql-client
RUN apk add --no-cache --update --upgrade --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing cfssl

COPY . .
6 changes: 4 additions & 2 deletions worker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM alpine:3.10
FROM alpine:3.11

ENTRYPOINT [ "/tink-worker" ]

RUN apk add --no-cache --update --upgrade ca-certificates

COPY tink-worker /tink-worker
ENTRYPOINT [ "/tink-worker" ]

0 comments on commit 7ac9ad5

Please sign in to comment.