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..90bedd84 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,11 @@ -language: java +language: go services: - docker +go: + - "1.10" + # skip install step install: true @@ -15,15 +18,19 @@ stages: jobs: include: - stage: test - name: "Maven & cont. image build" + name: "Maven & container image build" language: java - script: make build-travis test + script: make build test + + - stage: + name: "Buildah-able?" + script: make buildah-travis-deps 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 +47,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 +60,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 +68,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..8e6c18f7 100644 --- a/Makefile +++ b/Makefile @@ -1,19 +1,9 @@ -IMAGE?=radanalyticsio/spark-operator +IMAGE ?= radanalyticsio/spark-operator +#GO_BIN := $(shell which go) .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 +17,34 @@ 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 . + +blabla: + sudo touch $(shell type -P go)"-foo" + +.PHONY: buildah-travis-deps +buildah-travis-deps: + echo -e "travis_fold:start:buildah-deps\033[33;1mInstalling Buildah and its dependencies\033[0m" + #sudo cp $(GO_BIN) $(GO_BIN)_bak && sudo apt-get update && sudo apt-get -y install golang-1.10-go && sudo cp /usr/lib/go-1.10/bin/go $(GO_BIN) && go version + git clone https://github.com/containers/buildah ${GOPATH}/src/github.com/containers/buildah + cd ${GOPATH}/src/github.com/containers/buildah && sudo make install.libseccomp.sudo + #sudo cp $(GO_BIN)_bak $(GO_BIN) && go version + cd ${GOPATH}/src/github.com/containers/buildah && make runc all TAGS="apparmor seccomp" && sudo make install install.runc + echo -e "\ntravis_fold:end:buildah-deps\r" + #sudo apt-get -y install software-properties-common + #sudo add-apt-repository -y ppa:alexlarsson/flatpak + #sudo add-apt-repository -y ppa:gophers/archive + #sudo apt-add-repository -y ppa:projectatomic/ppa + #sudo apt-get -y -qq update + #sudo apt-get -y install bats btrfs-tools git libapparmor-dev libdevmapper-dev libglib2.0-dev libgpgme11-dev libostree-dev libseccomp-dev libselinux1-dev skopeo-containers go-md2man + #sudo apt-get -y install libostree-dev libostree-1-1 + #sudo apt-get -y install golang-1.10 + .PHONY: image-build-alpine image-build-alpine: docker build -t $(IMAGE):alpine -f Dockerfile.alpine .