Skip to content

Commit

Permalink
chore(release): use robot for deploys
Browse files Browse the repository at this point in the history
  • Loading branch information
ecordell committed Jan 23, 2020
1 parent b7af076 commit 97cd5bd
Show file tree
Hide file tree
Showing 10 changed files with 60 additions and 42 deletions.
45 changes: 24 additions & 21 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,33 @@
language: go
go:
- 1.13
sudo: true

os:
- linux
- osx
- windows

install:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install make; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install make; fi

script:
- if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then mingw32-make build; fi
- if [[ "$TRAVIS_OS_NAME" != "windows" ]]; then make unit build; fi

notifications:
email: false

jobs:
include:
- name: "osx"
os: "osx"
go: "1.13"
install: brew install make
script: make unit build
- name: "linux"
os: "linux"
go: "1.13"
install: sudo apt-get install make
script: make unit build
- name: "windows"
os: "windows"
go: "1.13"
script: mingw32-make unit build

deploy:
provider: releases
api_key:
secure: CMJ3KGhwuB7YRCYsJMe0cWAY/gkj2BVGorW9G1awxOyR2+Dv9G5PhItVkVfti0P2LzX8K2rplDp4O8b976wWzWJlJ6MQsSkFId0wYJSXRwNGdqnGhTLdDXB4FmPKapTBqTaYQgumrfvSOMiZ3tAwCD9AjW2fqYnBWnJXJ3yv8cpmN+TOZLJAKG+wAqb2foD9mS3HEQ9ItcoBqqEg8eRedzLuLGKVROLdFweLpi9gWdC22xLNomySwITTXX4kVs35MS0iwZE2cpTNDR8tLLIirHNgkiCCVYdiY0AB77Ikp5AF458UA064yr1b8TjAC3oyi4h6ddFaXo6CT9PZmsc41Te7cguSm2J9Ok2OdxLGitce7oty38QeY0QaG0oolcbXYw6QeiUXJ3BScAzVQBveDYgIACkSlsXAFEgdmR9YLOjYcw1MmquhmDbEuvaHi5T85aqsL8v5PUTMZq9+X/wOTqzR6D+8nQGqvqodxnopAFKpiR7UyiCl16VqrTJnkpWnYEerlx1i3Y7JLEiEK9O8UKL13J65cumCHPbcPNXbIsV6cFM+WXV8XhzKNOenrI5LZS9ske73wN9mOlgJKPwzEzP1H5hw1DTgm7gH/T+0bPCUdg7vh+dGavunjHEth1HmD2F8p6dvMC7+JG7Fjyw2PU76yl9DDm611p69A5auQ14=
file: bin/$TRAVIS_OS_NAME/opm
skip_cleanup: true
edge: true
token:
secure: 1mcUdIu9BBQloKWHEXIum9XFunDVDtWvbL5HuebsSJOlePTRnccBnhwwyxytkxO8bkWlB7RXRwa2JRKAOtrB2sgyvG4zthQeiyuq3qNRuZPyl/KxcHT5swYhwXaFy2kSmsG3WJy6Yx+Rw82yDelnyUkv2XcJODcU3Sf0CZIaYmCHmT9dFJ97yGd5x/Xbw+ApBIjRYQgL/NCXcvR/7ftIMUGcYc6zSMG9U6eWCvY28gZGhElvywbm51UuwOzK37jNKrp9xe4c+Fbp+7EqEUY4ooxCxX82PmJRDEcdjY0NLdafmPN40TA6oDB1873OEIWCa7+Lfn5k+X+JTcV/rPOfOIRB0vS04m5HWJONu4gNHB5lYl3DRHonbhF4X/hzkujlFGkWB/3XDwSj9X88McL0P7mwZsXV5KsiH7kqH3FTzlH2Fm3OTHhBOEJ1s+OEcwRlBRahh8LfzD6Da7BNncSWi2zdc7erD5WVmeiJngZXzGquo3Ly3GWB9Pfkd0rriclHC0CmIj5EeD7NBnrCu18dwdlKRR5L18dUmoLV1I/IUh0BIn0i7CNt3iw15LVX4Lk6wz2JzEfytGQ3GzfIf4cPjmGqIYwlOUuyiht7AyEUg3QIBiqTbU/PL+krvFhAtf3RkD7/5+NZF6VF4p4hYXJN0sGq3XOsN7Ol1nVvc6RpAlk=
file_glob: true
file: bin/**/opm
cleanup: false
on:
repo: operator-framework/operator-registry
tags: true
tags: true
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ FROM openshift/origin-base
RUN mkdir /registry
WORKDIR /registry

COPY --from=builder /src/bin/linux/initializer /bin/initializer
COPY --from=builder /src/bin/linux/registry-server /bin/registry-server
COPY --from=builder /src/bin/linux/configmap-server /bin/configmap-server
COPY --from=builder /src/bin/linux/appregistry-server /bin/appregistry-server
COPY --from=builder /src/bin/linux/opm /bin/opm
COPY --from=builder /src/bin/linux-amd64/initializer /bin/initializer
COPY --from=builder /src/bin/linux-amd64/registry-server /bin/registry-server
COPY --from=builder /src/bin/linux-amd64/configmap-server /bin/configmap-server
COPY --from=builder /src/bin/linux-amd64/appregistry-server /bin/appregistry-server
COPY --from=builder /src/bin/linux-amd64/opm /bin/opm
COPY --from=builder /go/bin/grpc-health-probe /bin/grpc_health_probe

RUN chgrp -R 0 /registry && \
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
GOOS := $(shell go env GOOS)
OS := $(shell bash -c 'if [[ $(GOOS) == darwin ]]; then echo osx; else echo $(GOOS); fi')
CMDS := $(addprefix bin/$(OS)/, $(shell ls ./cmd))
GOARCH := $(shell go env GOARCH)
CMDS := $(addprefix bin/$(GOOS)-$(GOARCH)/, $(shell ls ./cmd))
SPECIFIC_UNIT_TEST := $(if $(TEST),-run $(TEST),)
MOD_FLAGS := $(shell bash -c 'if [[ "$(shell go env GOFLAGS)" == "-mod=vendor" ]]; then echo ""; else echo "-mod=vendor"; fi')

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[![Build Status](https://travis-ci.com/operator-framework/operator-registry.svg?branch=master)](https://travis-ci.com/operator-framework/operator-registry)
# operator-registry

Operator Registry runs in a Kubernetes or OpenShift cluster to provide operator catalog data to [Operator Lifecycle Manager](https://github.com/operator-framework/operator-lifecycle-manager).
Expand Down
5 changes: 1 addition & 4 deletions appr-registry.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,9 @@ WORKDIR /go/src/$PROJECT
COPY --from=builder /go/src/github.com/operator-framework/operator-registry/vendor/$ORG/grpc-health-probe .
COPY --from=builder /go/src/github.com/operator-framework/operator-registry/vendor .
RUN CGO_ENABLED=0 go install -a -tags netgo -ldflags "-w"
RUN ls /go/bin
RUN ls .


FROM scratch
COPY --from=builder /go/src/github.com/operator-framework/operator-registry/bin/linux/appregistry-server /bin/appregistry-server
COPY --from=builder /go/src/github.com/operator-framework/operator-registry/bin/linux-amd64/appregistry-server /bin/appregistry-server
COPY --from=probe-builder /go/bin/grpc-health-probe /bin/grpc_health_probe
EXPOSE 50051
ENTRYPOINT ["/bin/appregistry-server"]
4 changes: 2 additions & 2 deletions configmap-registry.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ FROM quay.io/operator-framework/upstream-registry-builder:latest as builder
FROM busybox as userspace

FROM scratch
COPY --from=builder /build/bin/linux/configmap-server /bin/configmap-server
COPY --from=builder /build/bin/linux/opm /bin/opm
COPY --from=builder /build/bin/linux-amd64/configmap-server /bin/configmap-server
COPY --from=builder /build/bin/linux-amd64/opm /bin/opm
COPY --from=userspace /bin/cp /bin/cp
COPY --from=builder /bin/grpc_health_probe /bin/grpc_health_probe
EXPOSE 50051
Expand Down
19 changes: 18 additions & 1 deletion docs/contributors/releases.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,21 @@ Builds are also triggered for the following docker images. The tags in Quay.io w
- [quay.io/operator-framework/configmap-operator-registry](https://quay.io/repository/operator-framework/configmap-operator-registry)
- [quay.io/operator-framework/upstream-registry-builder](https://quay.io/repository/operator-framework/upstream-registry-builder?tab=tags)

Images are also built to track master with `latest` tags. It is recommended that you always pull by digest, and only use images that are tagged with a version.
Images are also built to track master with `latest` tags. It is recommended that you always pull by digest, and only use images that are tagged with a version.


## Generating Travis API keys

This requires the travis CLI tool to be installed.

First, backup the existing deploy config in `.travis.yml` - the prompts will overwrite some of the config, and
we only need the generated api token. This can be done by renaming the `deploy` yaml key to something else.

```sh
$ travis setup releases -r operator-framework/operator-registry --force --pro
```

When prompted, enter credentials for the of-deploy-robot account. Copy the api key from the newly generated `deploy` section in .travis.yml, place
it in the right place in the actual deploy config, and delete the generated deploy section.

You mean need to `travis login --pro` first.
2 changes: 1 addition & 1 deletion opm-example.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM quay.io/operator-framework/upstream-registry-builder AS builder
FROM scratch
LABEL operators.operatorframework.io.index.database.v1=./index.db
COPY database ./
COPY --from=builder /build/bin/linux/opm /opm
COPY --from=builder /build/bin/linux-amd64/opm /opm
COPY --from=builder /bin/grpc_health_probe /bin/grpc_health_probe
EXPOSE 50051
ENTRYPOINT ["/opm"]
Expand Down
2 changes: 1 addition & 1 deletion registry.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ RUN GRPC_HEALTH_PROBE_VERSION=v0.2.1 && \
chmod +x /bin/grpc_health_probe

FROM scratch
COPY --from=builder /build/bin/linux/registry-server /registry-server
COPY --from=builder /build/bin/linux-amd64/registry-server /registry-server
COPY --from=builder /bin/grpc_health_probe /bin/grpc_health_probe
EXPOSE 50051
ENTRYPOINT ["/registry-server"]
Expand Down
10 changes: 5 additions & 5 deletions upstream-builder.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ RUN make static
RUN GRPC_HEALTH_PROBE_VERSION=v0.2.1 && \
wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-amd64 && \
chmod +x /bin/grpc_health_probe
RUN cp /build/bin/linux/opm /bin/opm && \
cp /build/bin/linux/initializer /bin/initializer && \
cp /build/bin/linux/appregistry-server /bin/appregistry-server && \
cp /build/bin/linux/configmap-server /bin/configmap-server && \
cp /build/bin/linux/registry-server /bin/registry-server
RUN cp /build/bin/linux-amd64/opm /bin/opm && \
cp /build/bin/linux-amd64/initializer /bin/initializer && \
cp /build/bin/linux-amd64/appregistry-server /bin/appregistry-server && \
cp /build/bin/linux-amd64/configmap-server /bin/configmap-server && \
cp /build/bin/linux-amd64/registry-server /bin/registry-server

0 comments on commit 97cd5bd

Please sign in to comment.