Tony Mack | aeefc66 | 2015-10-30 18:08:47 +0000 | [diff] [blame] | 1 | CONTAINER_NAME:=xos-server |
David K. Bainbridge | ab4a2eb | 2015-12-03 11:49:01 -0800 | [diff] [blame] | 2 | IMAGE_NAME:=xosproject/xos |
Tony Mack | 86cbbd7 | 2015-11-01 16:31:30 +0000 | [diff] [blame] | 3 | TOSCA_CONFIG_PATH:=/opt/xos/configurations/opencloud/opencloud.yaml |
David K. Bainbridge | fe8bfcd | 2015-12-03 22:12:06 -0800 | [diff] [blame] | 4 | XOS_GIT_REPO?=git://github.com/open-cloud/xos.git |
| 5 | XOS_GIT_BRANCH?=master |
Jeremy Mowery | e07a38b | 2016-04-16 12:25:30 -0700 | [diff] [blame] | 6 | NO_DOCKER_CACHE?=false |
Tony Mack | 7c162e7 | 2015-10-30 15:22:20 +0000 | [diff] [blame] | 7 | |
Tony Mack | aeefc66 | 2015-10-30 18:08:47 +0000 | [diff] [blame] | 8 | .PHONY: build |
Andy Bavier | f9e48bd | 2016-01-20 16:29:29 -0800 | [diff] [blame] | 9 | build: ; sudo docker build --no-cache=${NO_DOCKER_CACHE} --rm -t ${IMAGE_NAME} . |
David K. Bainbridge | fe8bfcd | 2015-12-03 22:12:06 -0800 | [diff] [blame] | 10 | |
| 11 | .PHONY: custom |
Andy Bavier | beef3fb | 2016-01-06 16:40:00 -0500 | [diff] [blame] | 12 | custom: ; cat Dockerfile.templ | sed -e "s|XOS_GIT_REPO|${XOS_GIT_REPO}|g" -e "s|XOS_GIT_BRANCH|${XOS_GIT_BRANCH}|g" | docker build --no-cache=${NO_DOCKER_CACHE} --rm -t ${IMAGE_NAME} - |
| 13 | |
| 14 | .PHONY: devel |
Andy Bavier | f9e48bd | 2016-01-20 16:29:29 -0800 | [diff] [blame] | 15 | devel: ; cd ../..; ls; sudo docker build -f containers/xos/Dockerfile.devel --no-cache=${NO_DOCKER_CACHE} --rm -t ${IMAGE_NAME} . |
Tony Mack | aeefc66 | 2015-10-30 18:08:47 +0000 | [diff] [blame] | 16 | |
Matteo Scandolo | a665842 | 2016-04-06 14:44:56 -0700 | [diff] [blame] | 17 | .PHONY: test |
| 18 | test: ; cd ../..; ls; sudo docker build -f containers/xos/Dockerfile.test --no-cache=${NO_DOCKER_CACHE} --rm -t ${IMAGE_NAME} . |
| 19 | |
Tony Mack | aeefc66 | 2015-10-30 18:08:47 +0000 | [diff] [blame] | 20 | .PHONY: run |
Andy Bavier | f9e48bd | 2016-01-20 16:29:29 -0800 | [diff] [blame] | 21 | run: ; sudo docker run -d --name ${CONTAINER_NAME} -p 80:8000 -v /usr/local/share/ca-certificates:/usr/local/share/ca-certificates:ro ${IMAGE_NAME} |
Tony Mack | aeefc66 | 2015-10-30 18:08:47 +0000 | [diff] [blame] | 22 | |
| 23 | .PHONY: runtosca |
Andy Bavier | f9e48bd | 2016-01-20 16:29:29 -0800 | [diff] [blame] | 24 | runtosca: ; sudo docker exec -it ${CONTAINER_NAME} /usr/bin/python /opt/xos/tosca/run.py padmin@vicci.org ${TOSCA_CONFIG_PATH} |
Tony Mack | aeefc66 | 2015-10-30 18:08:47 +0000 | [diff] [blame] | 25 | |
| 26 | .PHONY: stop |
Andy Bavier | f9e48bd | 2016-01-20 16:29:29 -0800 | [diff] [blame] | 27 | stop: ; sudo docker stop ${CONTAINER_NAME} |
Tony Mack | aeefc66 | 2015-10-30 18:08:47 +0000 | [diff] [blame] | 28 | |
Tony Mack | bfae0ea | 2015-10-31 18:12:38 +0000 | [diff] [blame] | 29 | .PHONY: rm |
Andy Bavier | f9e48bd | 2016-01-20 16:29:29 -0800 | [diff] [blame] | 30 | rm: ; sudo docker rm ${CONTAINER_NAME} |