Skip to content

Commit

Permalink
Fix #138: check the buildah-ability in Travis CI
Browse files Browse the repository at this point in the history
  • Loading branch information
jkremser committed Nov 21, 2018
1 parent a6dcf12 commit ef5b8e7
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 16 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,5 @@ abstract-operator
# spark shell
metastore_db/
derby.log

buildah
14 changes: 9 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand All @@ -53,15 +57,15 @@ 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

- stage:
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

Expand Down
18 changes: 7 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 .
Expand Down

0 comments on commit ef5b8e7

Please sign in to comment.