Skip to content

Commit

Permalink
Merge pull request #3 from digitalocean/merge-in-upstream
Browse files Browse the repository at this point in the history
Merge in upstream
  • Loading branch information
adamwg authored Jan 29, 2021
2 parents 37e1c11 + 99d969b commit 9cd5165
Show file tree
Hide file tree
Showing 16 changed files with 529 additions and 915 deletions.
97 changes: 70 additions & 27 deletions .drone.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,79 @@
---
kind: pipeline
name: default

platform:
os: linux
arch: amd64

workspace:
base: /go
path: src/github.com/kontena/kubelet-rubber-stamp
base: /src
path: kubelet-rubber-stamp

pipeline:
test:
steps:
- name: test
image: golang:1.11
commands:
- mkdir -p /go/bin
- curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
- dep ensure -v -vendor-only
- go mod download
- ./test.sh

docker:
group: image
registry: quay.io
- name: docker
image: plugins/docker
settings:
registry: quay.io
repo: quay.io/kontena/kubelet-rubber-stamp-amd64
dockerfile: Dockerfile
auto_tag: true
username:
from_secret: docker_username
password:
from_secret: docker_password

- name: docker-arm
image: plugins/docker
secrets: [ docker_username, docker_password ]
repo: quay.io/kontena/kubelet-rubber-stamp-amd64
dockerfile: Dockerfile
auto_tag: true
when:
branches: ['master', 'refs/tags/*']

docker-arm:
group: image
registry: quay.io
settings:
registry: quay.io
repo: quay.io/kontena/kubelet-rubber-stamp-arm64
dockerfile: Dockerfile
build_args:
- ARCH=arm64
auto_tag: true
username:
from_secret: docker_username
password:
from_secret: docker_password

- name: docker-hub
image: plugins/docker
settings:
repo: kontenapharos/kubelet-rubber-stamp-amd64
dockerfile: Dockerfile
auto_tag: true
username:
from_secret: docker_hub_username
password:
from_secret: docker_hub_password

- name: docker-hub-arm
image: plugins/docker
secrets: [ docker_username, docker_password ]
repo: quay.io/kontena/kubelet-rubber-stamp-arm64
dockerfile: Dockerfile
build_args:
- ARCH=arm64
auto_tag: true
when:
branches: ['master', 'refs/tags/*']
settings:
repo: kontenapharos/kubelet-rubber-stamp-arm64
dockerfile: Dockerfile
build_args:
- ARCH=arm64
auto_tag: true
username:
from_secret: docker_hub_username
password:
from_secret: docker_hub_password

- name: manifest
image: plugins/manifest
settings:
username:
from_secret: docker_hub_username
password:
from_secret: docker_hub_password
spec: .manifest.tpl
auto_tag: true
18 changes: 18 additions & 0 deletions .manifest.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
image: docker.io/kontenapharos/kubelet-rubber-stamp:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}latest{{/if}}
{{#if build.tags}}
tags:
{{#each build.tags}}
- {{this}}
{{/each}}
{{/if}}
manifests:
-
image: docker.io/kontenapharos/kubelet-rubber-stamp-amd64:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}latest{{/if}}
platform:
architecture: amd64
os: linux
-
image: docker.io/kontenapharos/kubelet-rubber-stamp-arm64:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}latest{{/if}}
platform:
architecture: arm64
os: linux
15 changes: 7 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
FROM golang:1.11 as builder

RUN curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
WORKDIR /src

WORKDIR /go/src/github.com/kontena/kubelet-rubber-stamp

# Add dependency graph and vendor it in
ADD Gopkg.* /go/src/github.com/kontena/kubelet-rubber-stamp/
RUN dep ensure -v -vendor-only
# Add dependency and download it
ADD go.mod .
ADD go.sum .
RUN go mod download

# Add source and compile
ADD . /go/src/github.com/kontena/kubelet-rubber-stamp/
ADD . /src/

ARG ARCH=amd64
RUN CGO_ENABLED=0 GOOS=linux GOARCH=${ARCH} go build -a -installsuffix cgo -o kubelet-rubber-stamp cmd/manager/main.go


FROM scratch

COPY --from=builder /go/src/github.com/kontena/kubelet-rubber-stamp/kubelet-rubber-stamp /kubelet-rubber-stamp
COPY --from=builder /src/kubelet-rubber-stamp /kubelet-rubber-stamp

ENTRYPOINT ["/kubelet-rubber-stamp", "-logtostderr"]
Loading

0 comments on commit 9cd5165

Please sign in to comment.