Skip to content

Commit ef9ece8

Browse files
committedJan 23, 2020
chore(release): use robot for deploys
1 parent b7af076 commit ef9ece8

10 files changed

+45
-28
lines changed
 

‎.travis.yml

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
language: go
2+
23
go:
34
- 1.13
4-
sudo: true
55

66
os:
77
- linux
@@ -21,10 +21,12 @@ notifications:
2121

2222
deploy:
2323
provider: releases
24-
api_key:
25-
secure: CMJ3KGhwuB7YRCYsJMe0cWAY/gkj2BVGorW9G1awxOyR2+Dv9G5PhItVkVfti0P2LzX8K2rplDp4O8b976wWzWJlJ6MQsSkFId0wYJSXRwNGdqnGhTLdDXB4FmPKapTBqTaYQgumrfvSOMiZ3tAwCD9AjW2fqYnBWnJXJ3yv8cpmN+TOZLJAKG+wAqb2foD9mS3HEQ9ItcoBqqEg8eRedzLuLGKVROLdFweLpi9gWdC22xLNomySwITTXX4kVs35MS0iwZE2cpTNDR8tLLIirHNgkiCCVYdiY0AB77Ikp5AF458UA064yr1b8TjAC3oyi4h6ddFaXo6CT9PZmsc41Te7cguSm2J9Ok2OdxLGitce7oty38QeY0QaG0oolcbXYw6QeiUXJ3BScAzVQBveDYgIACkSlsXAFEgdmR9YLOjYcw1MmquhmDbEuvaHi5T85aqsL8v5PUTMZq9+X/wOTqzR6D+8nQGqvqodxnopAFKpiR7UyiCl16VqrTJnkpWnYEerlx1i3Y7JLEiEK9O8UKL13J65cumCHPbcPNXbIsV6cFM+WXV8XhzKNOenrI5LZS9ske73wN9mOlgJKPwzEzP1H5hw1DTgm7gH/T+0bPCUdg7vh+dGavunjHEth1HmD2F8p6dvMC7+JG7Fjyw2PU76yl9DDm611p69A5auQ14=
26-
file: bin/$TRAVIS_OS_NAME/opm
27-
skip_cleanup: true
24+
edge: true
25+
token:
26+
secure: 1mcUdIu9BBQloKWHEXIum9XFunDVDtWvbL5HuebsSJOlePTRnccBnhwwyxytkxO8bkWlB7RXRwa2JRKAOtrB2sgyvG4zthQeiyuq3qNRuZPyl/KxcHT5swYhwXaFy2kSmsG3WJy6Yx+Rw82yDelnyUkv2XcJODcU3Sf0CZIaYmCHmT9dFJ97yGd5x/Xbw+ApBIjRYQgL/NCXcvR/7ftIMUGcYc6zSMG9U6eWCvY28gZGhElvywbm51UuwOzK37jNKrp9xe4c+Fbp+7EqEUY4ooxCxX82PmJRDEcdjY0NLdafmPN40TA6oDB1873OEIWCa7+Lfn5k+X+JTcV/rPOfOIRB0vS04m5HWJONu4gNHB5lYl3DRHonbhF4X/hzkujlFGkWB/3XDwSj9X88McL0P7mwZsXV5KsiH7kqH3FTzlH2Fm3OTHhBOEJ1s+OEcwRlBRahh8LfzD6Da7BNncSWi2zdc7erD5WVmeiJngZXzGquo3Ly3GWB9Pfkd0rriclHC0CmIj5EeD7NBnrCu18dwdlKRR5L18dUmoLV1I/IUh0BIn0i7CNt3iw15LVX4Lk6wz2JzEfytGQ3GzfIf4cPjmGqIYwlOUuyiht7AyEUg3QIBiqTbU/PL+krvFhAtf3RkD7/5+NZF6VF4p4hYXJN0sGq3XOsN7Ol1nVvc6RpAlk=
27+
file_glob: true
28+
file: bin/**/*-opm
29+
cleanup: false
2830
on:
2931
repo: operator-framework/operator-registry
30-
tags: true
32+
tags: true

‎Dockerfile

+5-5
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ FROM openshift/origin-base
2828
RUN mkdir /registry
2929
WORKDIR /registry
3030

31-
COPY --from=builder /src/bin/linux/initializer /bin/initializer
32-
COPY --from=builder /src/bin/linux/registry-server /bin/registry-server
33-
COPY --from=builder /src/bin/linux/configmap-server /bin/configmap-server
34-
COPY --from=builder /src/bin/linux/appregistry-server /bin/appregistry-server
35-
COPY --from=builder /src/bin/linux/opm /bin/opm
31+
COPY --from=builder /src/bin/linux-amd64-initializer /bin/initializer
32+
COPY --from=builder /src/bin/linux-amd64-registry-server /bin/registry-server
33+
COPY --from=builder /src/bin/linux-amd64-configmap-server /bin/configmap-server
34+
COPY --from=builder /src/bin/linux-amd64-appregistry-server /bin/appregistry-server
35+
COPY --from=builder /src/bin/linux-amd64-opm /bin/opm
3636
COPY --from=builder /go/bin/grpc-health-probe /bin/grpc_health_probe
3737

3838
RUN chgrp -R 0 /registry && \

‎Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
GOOS := $(shell go env GOOS)
2-
OS := $(shell bash -c 'if [[ $(GOOS) == darwin ]]; then echo osx; else echo $(GOOS); fi')
3-
CMDS := $(addprefix bin/$(OS)/, $(shell ls ./cmd))
2+
GOARCH := $(shell go env GOARCH)
3+
CMDS := $(addprefix bin/$(GOOS)-$(GOARCH)-, $(shell ls ./cmd))
44
SPECIFIC_UNIT_TEST := $(if $(TEST),-run $(TEST),)
55
MOD_FLAGS := $(shell bash -c 'if [[ "$(shell go env GOFLAGS)" == "-mod=vendor" ]]; then echo ""; else echo "-mod=vendor"; fi')
66

@@ -9,7 +9,7 @@ MOD_FLAGS := $(shell bash -c 'if [[ "$(shell go env GOFLAGS)" == "-mod=vendor" ]
99
all: clean test build
1010

1111
$(CMDS):
12-
go build $(MOD_FLAGS) $(extra_flags) -o $@ ./cmd/$(shell basename $@)
12+
go build $(MOD_FLAGS) $(extra_flags) -o $@ ./cmd/$(shell basename $@ | cut -d- -f3-)
1313

1414
build: clean $(CMDS)
1515

‎README.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
[![Build Status](https://travis-ci.com/operator-framework/operator-registry.svg?branch=master)](https://travis-ci.com/operator-framework/operator-registry)
12
# operator-registry
23

34
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).

‎appr-registry.Dockerfile

+1-4
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,9 @@ WORKDIR /go/src/$PROJECT
2020
COPY --from=builder /go/src/github.com/operator-framework/operator-registry/vendor/$ORG/grpc-health-probe .
2121
COPY --from=builder /go/src/github.com/operator-framework/operator-registry/vendor .
2222
RUN CGO_ENABLED=0 go install -a -tags netgo -ldflags "-w"
23-
RUN ls /go/bin
24-
RUN ls .
25-
2623

2724
FROM scratch
28-
COPY --from=builder /go/src/github.com/operator-framework/operator-registry/bin/linux/appregistry-server /bin/appregistry-server
25+
COPY --from=builder /go/src/github.com/operator-framework/operator-registry/bin/linux-amd64-appregistry-server /bin/appregistry-server
2926
COPY --from=probe-builder /go/bin/grpc-health-probe /bin/grpc_health_probe
3027
EXPOSE 50051
3128
ENTRYPOINT ["/bin/appregistry-server"]

‎configmap-registry.Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ FROM quay.io/operator-framework/upstream-registry-builder:latest as builder
22
FROM busybox as userspace
33

44
FROM scratch
5-
COPY --from=builder /build/bin/linux/configmap-server /bin/configmap-server
6-
COPY --from=builder /build/bin/linux/opm /bin/opm
5+
COPY --from=builder /build/bin/linux-amd64-configmap-server /bin/configmap-server
6+
COPY --from=builder /build/bin/linux-amd64-opm /bin/opm
77
COPY --from=userspace /bin/cp /bin/cp
88
COPY --from=builder /bin/grpc_health_probe /bin/grpc_health_probe
99
EXPOSE 50051

‎docs/contributors/releases.md

+18-1
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,21 @@ Builds are also triggered for the following docker images. The tags in Quay.io w
2020
- [quay.io/operator-framework/configmap-operator-registry](https://quay.io/repository/operator-framework/configmap-operator-registry)
2121
- [quay.io/operator-framework/upstream-registry-builder](https://quay.io/repository/operator-framework/upstream-registry-builder?tab=tags)
2222

23-
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.
23+
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.
24+
25+
26+
## Generating Travis API keys
27+
28+
This requires the travis CLI tool to be installed.
29+
30+
First, backup the existing deploy config in `.travis.yml` - the prompts will overwrite some of the config, and
31+
we only need the generated api token. This can be done by renaming the `deploy` yaml key to something else.
32+
33+
```sh
34+
$ travis setup releases -r operator-framework/operator-registry --force --pro
35+
```
36+
37+
When prompted, enter credentials for the of-deploy-robot account. Copy the api key from the newly generated `deploy` section in .travis.yml, place
38+
it in the right place in the actual deploy config, and delete the generated deploy section.
39+
40+
You mean need to `travis login --pro` first.

‎opm-example.Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ FROM quay.io/operator-framework/upstream-registry-builder AS builder
33
FROM scratch
44
LABEL operators.operatorframework.io.index.database.v1=./index.db
55
COPY database ./
6-
COPY --from=builder /build/bin/linux/opm /opm
6+
COPY --from=builder /build/bin/linux-amd64-opm /opm
77
COPY --from=builder /bin/grpc_health_probe /bin/grpc_health_probe
88
EXPOSE 50051
99
ENTRYPOINT ["/opm"]

‎registry.Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ RUN GRPC_HEALTH_PROBE_VERSION=v0.2.1 && \
1414
chmod +x /bin/grpc_health_probe
1515

1616
FROM scratch
17-
COPY --from=builder /build/bin/linux/registry-server /registry-server
17+
COPY --from=builder /build/bin/linux-amd64-registry-server /registry-server
1818
COPY --from=builder /bin/grpc_health_probe /bin/grpc_health_probe
1919
EXPOSE 50051
2020
ENTRYPOINT ["/registry-server"]

‎upstream-builder.Dockerfile

+5-5
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ RUN make static
1212
RUN GRPC_HEALTH_PROBE_VERSION=v0.2.1 && \
1313
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 && \
1414
chmod +x /bin/grpc_health_probe
15-
RUN cp /build/bin/linux/opm /bin/opm && \
16-
cp /build/bin/linux/initializer /bin/initializer && \
17-
cp /build/bin/linux/appregistry-server /bin/appregistry-server && \
18-
cp /build/bin/linux/configmap-server /bin/configmap-server && \
19-
cp /build/bin/linux/registry-server /bin/registry-server
15+
RUN cp /build/bin/linux-amd64-opm /bin/opm && \
16+
cp /build/bin/linux-amd64-initializer /bin/initializer && \
17+
cp /build/bin/linux-amd64-appregistry-server /bin/appregistry-server && \
18+
cp /build/bin/linux-amd64-configmap-server /bin/configmap-server && \
19+
cp /build/bin/linux-amd64-registry-server /bin/registry-server

0 commit comments

Comments
 (0)
Please sign in to comment.