From ef5b8e73785bd2ce3b619aa67c8a70483409dc8b Mon Sep 17 00:00:00 2001 From: Jirka Kremser Date: Wed, 21 Nov 2018 15:24:16 +0100 Subject: [PATCH] Fix #138: check the buildah-ability in Travis CI --- .gitignore | 2 ++ .travis.yml | 14 +++++++++----- Makefile | 18 +++++++----------- 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/.gitignore b/.gitignore index 27211b3d..e35ef6b4 100644 --- a/.gitignore +++ b/.gitignore @@ -130,3 +130,5 @@ abstract-operator # spark shell metastore_db/ derby.log + +buildah diff --git a/.travis.yml b/.travis.yml index 674ad637..d349a652 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,13 +17,17 @@ jobs: - stage: test name: "Maven & cont. image build" language: java - script: make build-travis test + script: make build test + + - stage: + name: "Buildah-able?" + script: make buildah - stage: test-oc-and-k8s name: "Specs [oc • CMs]" env: BIN=oc VERSION=v3.9.0 CRD=0 script: &oc-script-defaults - - make build-travis + - make build - ./.travis/.travis.prepare.openshift.sh - ./.travis/.travis.test-oc-and-k8s.sh @@ -40,7 +44,7 @@ jobs: name: "Specs [K8s • CMs]" env: BIN=kubectl VERSION=v1.9.0 CRD=0 MINIKUBE_VERSION=v0.25.2 script: &kc-script-defaults - - make build-travis + - make build - ./.travis/.travis.prepare.minikube.sh - ./.travis/.travis.test-oc-and-k8s.sh @@ -53,7 +57,7 @@ jobs: name: "Restarts [oc • CMs]" env: BIN=oc VERSION=v3.9.0 CRD=0 script: - - make build-travis + - make build - ./.travis/.travis.prepare.openshift.sh - ./.travis/.travis.test-restarts.sh @@ -61,7 +65,7 @@ jobs: name: "Restarts [K8s • CRs]" env: BIN=kubectl VERSION=v1.9.0 CRD=1 MINIKUBE_VERSION=v0.25.2 script: - - make build-travis + - make build - ./.travis/.travis.prepare.minikube.sh - ./.travis/.travis.test-restarts.sh diff --git a/Makefile b/Makefile index bd11ca98..e44a6e50 100644 --- a/Makefile +++ b/Makefile @@ -3,17 +3,6 @@ IMAGE?=radanalyticsio/spark-operator .PHONY: build build: package image-build -.PHONY: build-travis -build-travis: install-lib build - -.PHONY: install-parent -install-parent: - rm -rf ./operator-parent-pom ; git clone --depth=1 --branch master https://github.com/jvm-operators/operator-parent-pom.git && cd operator-parent-pom && MAVEN_OPTS="-Djansi.passthrough=true -Dplexus.logger.type=ansi $(MAVEN_OPTS)" ./mvnw clean install && cd - && rm -rf ./operator-parent-pom - -.PHONY: install-lib -install-lib: install-parent - rm -rf ./abstract-operator ; git clone --depth=1 --branch master https://github.com/jvm-operators/abstract-operator.git && cd abstract-operator && MAVEN_OPTS="-Djansi.passthrough=true -Dplexus.logger.type=ansi $(MAVEN_OPTS)" ./mvnw clean install && cd - && rm -rf ./abstract-operator - .PHONY: package package: MAVEN_OPTS="-Djansi.passthrough=true -Dplexus.logger.type=ansi $(MAVEN_OPTS)" ./mvnw clean package -DskipTests @@ -27,6 +16,13 @@ image-build: docker build -t $(IMAGE):centos -f Dockerfile.centos . docker tag $(IMAGE):centos $(IMAGE):latest +.PHONY: buildah +buildah: + command -v buildah || docker cp $$(docker create docker.io/tomkukral/buildah:latest ls):/usr/bin/buildah ./buildah + echo -e "\n\nbuildah version: " && ./buildah -v || ./buildah -v && echo -e "\n" + buildah bud -f Dockerfile.centos . /dev/null || ./buildah bud -f Dockerfile.centos . + #buildah bud -f Dockerfile.alpine . /dev/null || ./buildah bud -f Dockerfile.alpine . # this fails for the alpine img + .PHONY: image-build-alpine image-build-alpine: docker build -t $(IMAGE):alpine -f Dockerfile.alpine .