Skip to content

Commit

Permalink
Add cli-artifacts image
Browse files Browse the repository at this point in the history
  • Loading branch information
tnozicka committed Aug 1, 2019
1 parent f2e4811 commit 8feb5c1
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 19 deletions.
45 changes: 26 additions & 19 deletions Makefile
@@ -1,14 +1,6 @@
all: build
.PHONY: all

GO_LD_EXTRAFLAGS :=-X github.com/openshift/oc/vendor/k8s.io/kubernetes/pkg/version.gitMajor="1" \
-X github.com/openshift/oc/vendor/k8s.io/kubernetes/pkg/version.gitMinor="14" \
-X github.com/openshift/oc/vendor/k8s.io/kubernetes/pkg/version.gitVersion="v1.14.0+724e12f93f" \
-X github.com/openshift/oc/vendor/k8s.io/kubernetes/pkg/version.gitCommit="$(SOURCE_GIT_COMMIT)" \
-X github.com/openshift/oc/vendor/k8s.io/kubernetes/pkg/version.buildDate="$(shell date -u +'%Y-%m-%dT%H:%M:%SZ')" \
-X github.com/openshift/oc/vendor/k8s.io/kubernetes/pkg/version.gitTreeState="clean"


# Include the library makefile
include $(addprefix ./vendor/github.com/openshift/library-go/alpha-build-machinery/make/, \
golang.mk \
Expand All @@ -17,6 +9,13 @@ include $(addprefix ./vendor/github.com/openshift/library-go/alpha-build-machine
targets/openshift/rpm.mk \
)

GO_LD_EXTRAFLAGS :=-X github.com/openshift/oc/vendor/k8s.io/kubernetes/pkg/version.gitMajor="1" \
-X github.com/openshift/oc/vendor/k8s.io/kubernetes/pkg/version.gitMinor="14" \
-X github.com/openshift/oc/vendor/k8s.io/kubernetes/pkg/version.gitVersion="v1.14.0+724e12f93f" \
-X github.com/openshift/oc/vendor/k8s.io/kubernetes/pkg/version.gitCommit="$(SOURCE_GIT_COMMIT)" \
-X github.com/openshift/oc/vendor/k8s.io/kubernetes/pkg/version.buildDate="$(shell date -u +'%Y-%m-%dT%H:%M:%SZ')" \
-X github.com/openshift/oc/vendor/k8s.io/kubernetes/pkg/version.gitTreeState="clean"

GO_BUILD_PACKAGES :=$(strip \
./cmd/... \
$(wildcard ./tools/*) \
Expand All @@ -34,18 +33,26 @@ RPM_EXTRAFLAGS := \
--define 'dist .el7' \
--define 'release 1'

# This will call a macro called "build-image" which will generate image specific targets based on the parameters:
# $0 - macro name
# $1 - target suffix
# $2 - Dockerfile path
# $3 - context directory for image build
$(call build-image,ose-cli,./images/cli/Dockerfile.rhel,.)

$(call build-image,ose-deployer,./images/deployer/Dockerfile.rhel,.)
image-ose-deployer: image-ose-cli
IMAGE_REGISTRY :=registry.svc.ci.openshift.org

$(call build-image,ose-recycler,./images/recycler/Dockerfile.rhel,.)
image-ose-recycler: image-ose-cli
# This will call a macro called "build-image" which will generate image specific targets based on the parameters:
# $1 - target name
# $2 - image registry
# $3 - image org
# $4 - image name
# $5 - image tag
# $6 - Dockerfile path
# $7 - context
$(call build-image,ocp-cli,$(IMAGE_REGISTRY)/ocp/4.2:cli,./images/cli/Dockerfile.rhel,.)

$(call build-image,ocp-cli-artifacts,$(IMAGE_REGISTRY)/ocp/4.2:cli-artifacts,./images/cli-artifacts/Dockerfile.rhel,.)
image-ocp-cli-artifacts: image-ocp-cli

$(call build-image,ocp-deployer,$(IMAGE_REGISTRY)/ocp/4.2:deployer,./images/deployer/Dockerfile.rhel,.)
image-ocp-deployer: image-ocp-cli

$(call build-image,ocp-recycler,$(IMAGE_REGISTRY)/ocp/4.2:recycler,./images/recycler/Dockerfile.rhel,.)
image-ocp-recycler: image-ocp-cli

update: update-generated-completions
.PHONY: update
Expand Down
14 changes: 14 additions & 0 deletions images/cli-artifacts/Dockerfile.rhel
@@ -0,0 +1,14 @@
# This Dockerfile builds an image containing the Mac and Windows version of the installer
# layered on top of the Linux cli image.
FROM registry.svc.ci.openshift.org/ocp/builder:golang-1.12 AS builder
WORKDIR /go/src/github.com/openshift/oc
COPY . .
RUN yum install -y --setopt=skip_missing_names_on_install=False gpgme-devel libassuan-devel
RUN make cross-build-darwin-amd64 cross-build-windows-amd64 --warn-undefined-variables

FROM registry.svc.ci.openshift.org/ocp/4.2:cli
COPY --from=builder /go/src/github.com/openshift/oc/_output/bin/darwin_amd64/oc /usr/share/openshift/mac/oc
COPY --from=builder /go/src/github.com/openshift/oc/_output/bin/windows_amd64/oc.exe /usr/share/openshift/windows/oc.exe
LABEL io.k8s.display-name="OpenShift Clients" \
io.k8s.description="OpenShift is a platform for developing, building, and deploying containerized applications." \
io.openshift.tags="openshift,cli"

0 comments on commit 8feb5c1

Please sign in to comment.