Skip to content

Commit 6c815b6

Browse files
committed
add suggestions from @mikenairn
1 parent 7059530 commit 6c815b6

File tree

3 files changed

+8
-49
lines changed

3 files changed

+8
-49
lines changed

openshift-ci/Dockerfile.tools

+5-41
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,9 @@
11
FROM registry.svc.ci.openshift.org/openshift/release:golang-1.13
2+
LABEL maintainer="pbraun@redhat.com"
23

34
ENV OPERATOR_SDK_VERSION=v0.18.2 \
4-
DELOREAN_VERSION=master \
55
GOFLAGS=""
6-
7-
RUN set -o pipefail && \
8-
INSTALL_PKGS="skopeo rsync" && \
9-
yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS
10-
11-
# install delorean (from git with no history and only the tag)
12-
# Note: Change to using pre-built binary when it's available https://issues.redhat.com/browse/DEL-288
13-
RUN mkdir -p $GOPATH/src/github.com/delorean \
14-
&& cd $GOPATH/src/github.com/delorean \
15-
&& git clone --depth 1 -b $DELOREAN_VERSION https://github.com/integr8ly/delorean \
16-
&& cd delorean \
17-
&& make build/cli \
18-
&& cp delorean /usr/local/bin
19-
20-
# install operator-sdk (from git with no history and only the tag)
21-
RUN mkdir -p $GOPATH/src/github.com/operator-framework \
22-
&& cd $GOPATH/src/github.com/operator-framework \
23-
&& git clone --depth 1 -b $OPERATOR_SDK_VERSION https://github.com/operator-framework/operator-sdk \
24-
&& cd operator-sdk \
25-
&& go mod vendor \
26-
&& make tidy \
27-
&& make install \
28-
&& chmod -R 0777 $GOPATH \
29-
&& rm -rf $GOPATH/.cache
30-
31-
# install jq and yq
32-
RUN wget -O jq https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64 \
33-
&& chmod +x ./jq \
34-
&& cp jq /usr/bin \
35-
&& curl -Lo /usr/local/bin/yq https://github.com/mikefarah/yq/releases/download/3.1.2/yq_linux_amd64 \
36-
&& chmod +x /usr/local/bin/yq
37-
38-
# install nodejs
39-
ENV NODE_VERSION=12.16.3 \
40-
NPM_CONFIG_CACHE=/tmp/.npm
41-
42-
RUN curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-x64.tar.xz" \
43-
&& tar -xJf "node-v$NODE_VERSION-linux-x64.tar.xz" -C /usr/local --strip-components=1 --no-same-owner \
44-
&& rm "node-v$NODE_VERSION-linux-x64.tar.xz" \
45-
&& ln -s /usr/local/bin/node /usr/local/bin/nodejs
6+
# install operator-sdk
7+
RUN curl -LO https://github.com/operator-framework/operator-sdk/releases/download/${OPERATOR_SDK_VERSION}/operator-sdk-${OPERATOR_SDK_VERSION}-x86_64-linux-gnu && \
8+
mv operator-sdk-${OPERATOR_SDK_VERSION}-x86_64-linux-gnu /usr/bin/operator-sdk && \
9+
chmod +x /usr/bin/operator-sdk

openshift-ci/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ Base image used on CI for all builds and test jobs.
77
#### Build and Test
88

99
```
10-
$ docker build -t registry.svc.ci.openshift.org/integr8ly/intly-operator-base-image:latest - < Dockerfile.tools
11-
$ IMAGE_NAME=registry.svc.ci.openshift.org/integr8ly/intly-operator-base-image:latest test/run
10+
$ docker build -t registry.svc.ci.openshift.org/integr8ly/grafana-operator-base-image:latest - < Dockerfile.tools
11+
$ IMAGE_NAME=registry.svc.ci.openshift.org/integr8ly/grafana-operator-base-image:latest test/run
1212
operator-sdk version: "v0.12.0", commit: "2445fcda834ca4b7cf0d6c38fba6317fb219b469", go version: "go1.13.5 linux/amd64"
1313
go version go1.13.5 linux/amd64
1414
go mod tidy

openshift-ci/test/run

+1-6
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,7 @@ WORK_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
99

1010
docker run --rm --entrypoint=/bin/sh ${IMAGE_NAME} -c 'operator-sdk version'
1111
docker run --rm --entrypoint=/bin/sh ${IMAGE_NAME} -c 'go version'
12-
docker run --rm --entrypoint=/bin/sh ${IMAGE_NAME} -c 'jq --version'
13-
docker run --rm --entrypoint=/bin/sh ${IMAGE_NAME} -c 'yq --version'
14-
docker run --rm --entrypoint=/bin/sh ${IMAGE_NAME} -c 'node --version'
15-
docker run --rm --entrypoint=/bin/sh ${IMAGE_NAME} -c 'delorean --help'
16-
docker run --rm --entrypoint=/bin/sh ${IMAGE_NAME} -c 'skopeo --version'
17-
docker run --rm --entrypoint=/bin/sh ${IMAGE_NAME} -c 'rsync --version'
12+
1813

1914
docker run --rm -u $UID -v "${WORK_DIR}/../..:/grafana-operator:z" --entrypoint=/bin/sh ${IMAGE_NAME} -c "cd /grafana-operator && make code/check"
2015
docker run --rm -u $UID -v "${WORK_DIR}/../..:/grafana-operator:z" --entrypoint=/bin/sh ${IMAGE_NAME} -c "cd /grafana-operator && make code/compile"

0 commit comments

Comments
 (0)