diff --git a/Jenkinsfile b/Jenkinsfile old mode 100644 new mode 100755 index bf738f3..80fa432 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -7,10 +7,10 @@ stage('Trust') { enforceTrustedApproval('aerogear') } -node ("ocp-slave") { +node ("ocp-slave") { def apb_container_id, pod_container_id, apb_pod_output - def apb_version = "sprint147.2" - + def apb_version = "v3.11" + stage('Cleanup') { deleteDir() } @@ -21,21 +21,21 @@ node ("ocp-slave") { stage('Run APB test') { apb_container_id = sh ( - script: "docker run --detach --net=host --privileged -v \$PWD:/mnt -v \$HOME/.kube:/.kube -v /var/run/docker.sock:/var/run/docker.sock -u \$UID docker.io/ansibleplaybookbundle/apb-tools:${apb_version} test --registry-route docker-registry.default.svc:5000", + script: "docker run --detach --net=host --privileged -v \$PWD:/mnt -v \$HOME/.kube:/.kube -v /var/run/docker.sock:/var/run/docker.sock -u \$UID registry.access.redhat.com/openshift3/apb-tools:${apb_version} test --registry-route docker-registry.default.svc:5000", returnStdout: true ).trim() } stage('Watch the logs') { - + pod_container_id = sh ( script: "sleep 30 ; docker ps --filter since=${apb_container_id} | grep 'entrypoint.sh test' | awk '{print \$1}'", returnStdout: true ).trim() - + sh "docker logs -f ${pod_container_id}" } - + stage('Get APB container logs and evaluate test result') { apb_pod_output = sh ( @@ -45,7 +45,7 @@ node ("ocp-slave") { ).trim() echo apb_pod_output - + if ( apb_pod_output.contains("Pod phase Failed") ) { error("APB test failed.") } diff --git a/Makefile b/Makefile index 14129c5..0c9d47b 100644 --- a/Makefile +++ b/Makefile @@ -4,18 +4,13 @@ IMAGENAME ?= metrics-apb TAG = latest USER=$(shell id -u) PWD=$(shell pwd) -build_and_push: apb_build docker_push apb_push +build_and_push: apb_build docker_push .PHONY: apb_build apb_build: - apb prepare + apb bundle prepare docker build -t $(DOCKERHOST)/$(DOCKERORG)/$(IMAGENAME):$(TAG) . .PHONY: docker_push docker_push: docker push $(DOCKERHOST)/$(DOCKERORG)/$(IMAGENAME):$(TAG) - -.PHONY: apb_push -apb_push: - apb push - diff --git a/README.md b/README.md index 26c9fa6..e2172cb 100644 --- a/README.md +++ b/README.md @@ -7,9 +7,9 @@ ## Testing -If you want to test the changes made to this repo, you can do it by simply running `apb test` +If you want to test the changes made to this repo, you can do it by simply running `apb bundle test` The test does the following: -1. Builds the APB +1. Builds the APB 1. Creates the project in currently targeted OpenShift instance 1. Runs the `provision` role 1. Runs the `test-provision` role which checks that @@ -42,13 +42,13 @@ Under the `playbooks` directory create a file `requirements.yml`: name: oc-patch-file-to-configmap ``` -This file defines the `oc-patch-file-to-configmap` role as a dependency. +This file defines the `oc-patch-file-to-configmap` role as a dependency. #### Modify Dockerfile The next step is to modify the default `Dockerfile`. The default APB Dockerfile usually has a list of commands like this: ``` -COPY playbooks /opt/apb/actions +COPY playbooks /opt/apb/project COPY roles /opt/ansible/roles COPY vars /opt/ansible/vars RUN chmod -R g=u /opt/{ansible,apb}