Skip to content

Commit

Permalink
Publish docker images
Browse files Browse the repository at this point in the history
  • Loading branch information
calind committed Aug 28, 2018
1 parent f12f59d commit 7fe432c
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 20 deletions.
4 changes: 1 addition & 3 deletions .dockerignore
@@ -1,5 +1,3 @@
.git
vendor/*
cmd/*
pkg/*
hack/*
bin/*
33 changes: 24 additions & 9 deletions .drone.yml
Expand Up @@ -10,12 +10,27 @@ pipeline:
- make lint
- make test

# publish:
# image: plugins/docker
# secrets:
# - QUAY_TOKEN
# repo: quay.io/presslabs/wordpress-operator
# tags: [ "latest" ]
# when:
# branch: master
# event: push
publish:
image: plugins/docker
registry: quay.io
repo: quay.io/presslabs/wordpress-operator
tags: [ "latest" ]
username: presslabs+drone
secrets:
- source: QUAY_TOKEN
target: DOCKER_PASSWORD
when:
branch: master
event: push

publish:
image: plugins/docker
registry: quay.io
repo: quay.io/presslabs/wordpress-operator
tags: [ "${DRONE_TAG}" ]
username: presslabs+drone
secrets:
- source: QUAY_TOKEN
target: DOCKER_PASSWORD
when:
event: tag
8 changes: 4 additions & 4 deletions Dockerfile
Expand Up @@ -11,7 +11,7 @@ COPY vendor/ vendor/
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o manager github.com/presslabs/wordpress-operator/cmd/manager

# Copy the controller-manager into a thin image
FROM ubuntu:latest
WORKDIR /root/
COPY --from=builder /go/src/github.com/presslabs/wordpress-operator/manager .
ENTRYPOINT ["./manager"]
FROM scratch
COPY --from=builder /etc/ssl/certs /etc/ssl/certs
COPY --from=builder /go/src/github.com/presslabs/wordpress-operator/manager /
ENTRYPOINT ["/manager"]
6 changes: 3 additions & 3 deletions Makefile
@@ -1,5 +1,5 @@
# Image URL to use all building/pushing image targets
IMG ?= controller:latest
IMG ?= quay.io/presslabs/wordpress-operator:latest

KUBEBUILDER_VERSION ?= 1.0.0

Expand Down Expand Up @@ -43,13 +43,13 @@ generate:
go generate ./pkg/... ./cmd/...

# Build the docker image
docker-build: test
images: test
docker build . -t ${IMG}
@echo "updating kustomize image patch file for manager resource"
sed -i 's@image: .*@image: '"${IMG}"'@' ./config/default/manager_image_patch.yaml

# Push the docker image
docker-push:
publish:
docker push ${IMG}

lint:
Expand Down
1 change: 0 additions & 1 deletion pkg/controller/wordpress/wordpress_controller.go
Expand Up @@ -18,7 +18,6 @@ package wordpress

import (
"context"
"fmt"
gosync "sync"

appsv1 "k8s.io/api/apps/v1"
Expand Down

0 comments on commit 7fe432c

Please sign in to comment.