mirror of
https://github.com/dokku/dokku.git
synced 2026-02-24 04:00:36 +01:00
build stack from master
This commit is contained in:
18
Makefile
18
Makefile
@@ -14,6 +14,12 @@ ifeq (vagrant-dokku,$(firstword $(MAKECMDGOALS)))
|
||||
$(eval $(RUN_ARGS):;@:)
|
||||
endif
|
||||
|
||||
ifeq ($(CIRCLECI),true)
|
||||
BUILD_STACK_TARGETS = circleci deps build
|
||||
else
|
||||
BUILD_STACK_TARGETS = build-in-docker
|
||||
endif
|
||||
|
||||
.PHONY: all apt-update install copyfiles man-db version plugins dependencies sshcommand pluginhook docker aufs stack count dokku-installer vagrant-acl-add vagrant-dokku
|
||||
|
||||
include tests.mk
|
||||
@@ -104,15 +110,17 @@ ifndef CI
|
||||
endif
|
||||
|
||||
stack:
|
||||
ifeq ($(shell test -e /var/run/docker.sock && touch -a -c /var/run/docker.sock && echo $$?),0)
|
||||
@echo "Start building herokuish"
|
||||
ifeq ($(shell test -e /var/run/docker.sock && touch -c /var/run/docker.sock && echo $$?),0)
|
||||
ifdef BUILD_STACK
|
||||
@docker images | grep gliderlabs/herokuish || (git clone ${STACK_URL} /tmp/herokuish && docker build -t gliderlabs/herokuish /tmp/herokuish && rm -rf /tmp/herokuish)
|
||||
@echo "Start building herokuish from source"
|
||||
docker images | grep gliderlabs/herokuish || (git clone ${STACK_URL} /tmp/herokuish && cd /tmp/herokuish && IMAGE_NAME=gliderlabs/herokuish BUILD_TAG=latest VERSION=master make -e ${BUILD_STACK_TARGETS} && rm -rf /tmp/herokuish)
|
||||
else
|
||||
ifeq ($(shell echo ${PREBUILT_STACK_URL} | egrep -q 'http.*://' && echo $$?),0)
|
||||
@docker images | grep gliderlabs/herokuish || curl --silent -L ${PREBUILT_STACK_URL} | gunzip -cd | docker import - gliderlabs/herokuish
|
||||
@echo "Start importing herokuish from ${PREBUILT_STACK_URL}"
|
||||
docker images | grep gliderlabs/herokuish || curl --silent -L ${PREBUILT_STACK_URL} | gunzip -cd | docker import - gliderlabs/herokuish
|
||||
else
|
||||
@docker pull ${PREBUILT_STACK_URL}
|
||||
@echo "Start pulling herokuish from ${PREBUILT_STACK_URL}"
|
||||
docker images | grep gliderlabs/herokuish || docker pull ${PREBUILT_STACK_URL}
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -eo pipefail; set -x
|
||||
|
||||
MODE="$1"; MODE=${MODE:="testing"}
|
||||
|
||||
setup_circle() {
|
||||
MAKE_ENV="CI=true"
|
||||
[[ "$1" == "buildstack" ]] && MAKE_ENV+=" BUILD_STACK=true "
|
||||
echo "setting up with MAKE_ENV: $MAKE_ENV"
|
||||
sudo -E CI=true make -e sshcommand
|
||||
# need to add the dokku user to the docker group
|
||||
sudo usermod -G docker dokku
|
||||
@@ -14,7 +13,8 @@ setup_circle() {
|
||||
sudo chown -R root:root ~root/.ssh/
|
||||
sudo sed --in-place 's:/home/ubuntu:/root:g' ~root/.ssh/config
|
||||
####
|
||||
sudo -E $MAKE_ENV make -e install
|
||||
[[ "$1" == "buildstack" ]] && BUILD_STACK=true make -e stack
|
||||
sudo -E CI=true make -e install
|
||||
sudo -E make -e setup-deploy-tests
|
||||
make -e ci-dependencies
|
||||
}
|
||||
@@ -22,25 +22,25 @@ setup_circle() {
|
||||
case "$CIRCLE_NODE_INDEX" in
|
||||
0)
|
||||
echo "=====> make unit-tests (1/2) on CIRCLE_NODE_INDEX: $CIRCLE_NODE_INDEX"
|
||||
[[ "$MODE" == "setup" ]] && setup_circle && exit 0
|
||||
[[ "$MODE" == "setup" ]] && (setup_circle ; exit $?)
|
||||
sudo -E UNIT_TEST_BATCH=1 make -e unit-tests
|
||||
;;
|
||||
|
||||
1)
|
||||
echo "=====> make unit-tests (2/2) on CIRCLE_NODE_INDEX: $CIRCLE_NODE_INDEX"
|
||||
[[ "$MODE" == "setup" ]] && setup_circle && exit 0
|
||||
[[ "$MODE" == "setup" ]] && (setup_circle ; exit $?)
|
||||
sudo -E UNIT_TEST_BATCH=2 make -e unit-tests
|
||||
;;
|
||||
|
||||
2)
|
||||
echo "=====> make deploy-tests (herokuish release) on CIRCLE_NODE_INDEX: $CIRCLE_NODE_INDEX"
|
||||
[[ "$MODE" == "setup" ]] && setup_circle && exit 0
|
||||
[[ "$MODE" == "setup" ]] && (setup_circle ; exit $?)
|
||||
sudo -E make -e deploy-tests
|
||||
;;
|
||||
|
||||
3)
|
||||
echo "=====> make deploy-tests (herokuish master) on CIRCLE_NODE_INDEX: $CIRCLE_NODE_INDEX"
|
||||
[[ "$MODE" == "setup" ]] && setup_circle buildstack && exit 0
|
||||
[[ "$MODE" == "setup" ]] && (setup_circle buildstack ; exit $?)
|
||||
sudo -E make -e deploy-tests
|
||||
;;
|
||||
esac
|
||||
|
||||
Reference in New Issue
Block a user