Compare commits

...

28 Commits

Author SHA1 Message Date
Jose Diaz-Gonzalez
5676dbc4c6 Release 0.3.26 2015-08-24 16:01:28 -04:00
Michael Hobbs
6d71c164f0 Merge pull request #1128 from progrium/1091_mh-switch-to-herokuish
switching to herokuish. closes #1091
2015-08-24 12:11:05 -07:00
Jose Diaz-Gonzalez
3f43a64430 Merge pull request #1399 from basicer/fix-multi-receive-app
Make dokku play nice when we have multiple receive-app hooks
2015-08-24 14:54:13 -04:00
Jose Diaz-Gonzalez
f20d24463f Merge pull request #1413 from progrium/mh-dokku-scale-with-comments
support comments in DOKKU_SCALE and print contents on deploy
2015-08-24 14:26:34 -04:00
Rob Blanckaert
98990b6885 Make dokku play nice when we have multiple receive-app hooks in various plugins. 2015-08-24 14:20:36 -04:00
Michael Hobbs
42905c345b support comments in DOKKU_SCALE and print contents on deploy 2015-08-24 09:22:07 -07:00
Michael Hobbs
d0623ea37b [ci skip] fix make count on OS X 2015-08-24 09:05:32 -07:00
Jose Diaz-Gonzalez
5717e3afef Merge pull request #1411 from progrium/josegonzalez-patch-2
Clarify `ps:scale` example
2015-08-23 20:52:32 -04:00
Jose Diaz-Gonzalez
268c8763b2 Clarify ps:scale example
[ci skip]
2015-08-23 20:52:26 -04:00
Jose Diaz-Gonzalez
cb0565eb56 Merge pull request #1410 from progrium/josegonzalez-patch-2
Clarify DOKKU_SCALE usage
2015-08-23 20:50:40 -04:00
Jose Diaz-Gonzalez
4cd40aef03 Clarify DOKKU_SCALE usage
refs #1409

[ci skip]
2015-08-23 20:50:35 -04:00
Jose Diaz-Gonzalez
198fe14b7b Merge pull request #1401 from progrium/1219-apt-transport-https
Install apt-transport-https before adding https-backed apt sources
2015-08-20 20:22:13 -04:00
Jose Diaz-Gonzalez
9409fc2ef0 Install apt-transport-https before adding https-backed apt sources
Refs #1219

[ci skip]
2015-08-20 20:21:06 -04:00
Jose Diaz-Gonzalez
ab6f49cebe Merge pull request #1400 from progrium/history-fix
Fix history formatting
2015-08-20 20:16:15 -04:00
Jose Diaz-Gonzalez
5492b0e4e0 Fix history formatting [ci skip] 2015-08-20 20:16:00 -04:00
Jose Diaz-Gonzalez
c6e4f95550 fix name of herokuish debian package 2015-08-19 20:45:58 -04:00
Michael Hobbs
d21caa4811 Merge branch 'master' into 1091_mh-switch-to-herokuish 2015-07-28 10:55:44 -07:00
Michael Hobbs
fd187ec837 [ci skip] remove unnecessary comments and update docs 2015-07-09 13:22:12 -07:00
Michael Hobbs
eebcfd85ab fix deprecated comments and include *-buildstep pluginhooks for point release 2015-07-09 13:15:57 -07:00
Michael Hobbs
ab2539e894 Merge branch 'master' into 1091_mh-switch-to-herokuish 2015-07-09 13:00:44 -07:00
Michael Hobbs
039cfdc7ba make ports tests more stable 2015-07-08 11:18:41 -07:00
Michael Hobbs
27b79222c1 catch test setup errors 2015-07-08 09:42:10 -07:00
Michael Hobbs
059ebcd9fc build stack from master 2015-07-08 09:17:29 -07:00
Michael Hobbs
1668f3bbc6 rename *-herokuish pluginhooks to *-buildpack 2015-07-06 12:45:37 -07:00
Michael Hobbs
f99f9cd5d7 fix typo 2015-07-06 12:42:44 -07:00
Michael Hobbs
2e9bb4eed1 need to call /build for herokuish 2015-07-06 12:41:54 -07:00
Michael Hobbs
a801592b56 [ci skip] update missed doc refs to buildstep 2015-07-06 12:41:54 -07:00
Michael Hobbs
0840d8fd1f initial pass at switching to herokuish. closes #1091 2015-07-06 12:41:54 -07:00
31 changed files with 201 additions and 152 deletions

View File

@@ -1,5 +1,25 @@
# History # History
## 0.3.26
This release has a few new features, the largest of which is switching from buildstep to herokuish for building containers. Going forward, this should help ensure that built containers are as close to heroku containers as possible, and also allow us to be on the cutting edge of heroku buildpack support. Props to @michaelshobbs for his work on herokuish.
### Bug Fixes
- #1401: @josegonzalez Install apt-transport-https before adding https-backed apt sources
### New Features
- #1128: @michaelshobbs Switch from buildstep to herokuish
- #1399: @basicer Make dokku play nice when there are multiple receive-app hooks
- #1413: @michaelshobbs support comments in DOKKU_SCALE and print contents on deploy
### Documentation
- #1400: @josegonzalez Fix HISTORY.md formatting
- #1410: @josegonzalez Clarify DOKKU_SCALE usage
- #1411: @josegonzalez Clarify `ps:scale` example
## 0.3.25 ## 0.3.25
This release is a bugfix release fixing a broken 0.3.25 apt-get installation. This release is a bugfix release fixing a broken 0.3.25 apt-get installation.
@@ -428,9 +448,10 @@ This release pegs Dokku to Docker 1.6.2. Docker 1.7.0 introduced changes in `doc
- 969aed87: @jfrazelle Fix double brackets issue in nginx-vhosts install - 969aed87: @jfrazelle Fix double brackets issue in nginx-vhosts install
- 42fee25f: @rhy-jot Mention 14.04 & 12.10 sunset - 42fee25f: @rhy-jot Mention 14.04 & 12.10 sunset
- 4f5fc586: @rhy-jot Update cipher list - 4f5fc586: @rhy-jot Update cipher list
- #276: @joliv Add dependencies hook - wingrunr21- #476: Added man page entry - #276: @wingrunr21 Add dependencies hook
- #476: @joliv Added man page entry
- #522: @wingrunr21 Improve SSL support and implement SPDY - #522: @wingrunr21 Improve SSL support and implement SPDY
- #544: @jfrazelle if dokku.conf has not been created, create it - #544: @jfrazelle if dokku.conf has not been created, create it
- #555: @jakubholynet Readme fix, Env vars only set at run time - #555: @jakubholynet Readme fix, Env vars only set at run time
- #562: @assaf Zero down-time deploy and server checks - #562: @assaf Zero down-time deploy and server checks
- #571: @joliv Added man page plugin command - #571: @joliv Added man page plugin command

View File

@@ -2,8 +2,8 @@ DOKKU_VERSION = master
SSHCOMMAND_URL ?= https://raw.github.com/progrium/sshcommand/master/sshcommand SSHCOMMAND_URL ?= https://raw.github.com/progrium/sshcommand/master/sshcommand
PLUGINHOOK_URL ?= https://s3.amazonaws.com/progrium-pluginhook/pluginhook_0.1.0_amd64.deb PLUGINHOOK_URL ?= https://s3.amazonaws.com/progrium-pluginhook/pluginhook_0.1.0_amd64.deb
STACK_URL ?= https://github.com/progrium/buildstep.git STACK_URL ?= https://github.com/gliderlabs/herokuish.git
PREBUILT_STACK_URL ?= https://github.com/progrium/buildstep/releases/download/2015-07-14/2015-07-14_1afb78e747.tar.gz PREBUILT_STACK_URL ?= gliderlabs/herokuish:latest
PLUGINS_PATH ?= /var/lib/dokku/plugins PLUGINS_PATH ?= /var/lib/dokku/plugins
# If the first argument is "vagrant-dokku"... # If the first argument is "vagrant-dokku"...
@@ -14,6 +14,12 @@ ifeq (vagrant-dokku,$(firstword $(MAKECMDGOALS)))
$(eval $(RUN_ARGS):;@:) $(eval $(RUN_ARGS):;@:)
endif 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 .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 include tests.mk
@@ -27,7 +33,7 @@ install: dependencies copyfiles plugin-dependencies plugins version
release: deb-all package_cloud packer release: deb-all package_cloud packer
package_cloud: package_cloud:
package_cloud push dokku/dokku/ubuntu/trusty buildstep*.deb package_cloud push dokku/dokku/ubuntu/trusty herokuish*.deb
package_cloud push dokku/dokku/ubuntu/trusty sshcommand*.deb package_cloud push dokku/dokku/ubuntu/trusty sshcommand*.deb
package_cloud push dokku/dokku/ubuntu/trusty pluginhook*.deb package_cloud push dokku/dokku/ubuntu/trusty pluginhook*.deb
package_cloud push dokku/dokku/ubuntu/trusty rubygem*.deb package_cloud push dokku/dokku/ubuntu/trusty rubygem*.deb
@@ -104,22 +110,28 @@ ifndef CI
endif endif
stack: stack:
ifeq ($(shell test -e /var/run/docker.sock && touch -a -c /var/run/docker.sock && echo $$?),0) ifeq ($(shell test -e /var/run/docker.sock && touch -c /var/run/docker.sock && echo $$?),0)
@echo "Start building buildstep"
ifdef BUILD_STACK ifdef BUILD_STACK
@docker images | grep progrium/buildstep || (git clone ${STACK_URL} /tmp/buildstep && docker build -t progrium/buildstep /tmp/buildstep && rm -rf /tmp/buildstep) @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 else
@docker images | grep progrium/buildstep || curl --silent -L ${PREBUILT_STACK_URL} | gunzip -cd | docker import - progrium/buildstep ifeq ($(shell echo ${PREBUILT_STACK_URL} | egrep -q 'http.*://' && echo $$?),0)
@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
@echo "Start pulling herokuish from ${PREBUILT_STACK_URL}"
docker images | grep gliderlabs/herokuish || docker pull ${PREBUILT_STACK_URL}
endif
endif endif
endif endif
count: count:
@echo "Core lines:" @echo "Core lines:"
@cat dokku bootstrap.sh | egrep -v "^$$" | wc -l @cat dokku bootstrap.sh | sed 's/^$$//g' | wc -l
@echo "Plugin lines:" @echo "Plugin lines:"
@find plugins -type f | xargs cat | egrep -v "^$$" | wc -l @find plugins -type f -not -name .DS_Store | xargs cat | sed 's/^$$//g' | wc -l
@echo "Test lines:" @echo "Test lines:"
@find tests -type f | xargs cat | egrep -v "^$$" |wc -l @find tests -type f -not -name .DS_Store | xargs cat | sed 's/^$$//g' | wc -l
dokku-installer: dokku-installer:
apt-get install -qq -y ruby apt-get install -qq -y ruby

View File

@@ -10,8 +10,8 @@ Docker powered mini-Heroku. The smallest PaaS implementation you've ever seen. S
To install the latest stable release, you can run the following commands as a user that has access to `sudo`: To install the latest stable release, you can run the following commands as a user that has access to `sudo`:
wget https://raw.github.com/progrium/dokku/v0.3.25/bootstrap.sh wget https://raw.github.com/progrium/dokku/v0.3.26/bootstrap.sh
sudo DOKKU_TAG=v0.3.25 bash bootstrap.sh sudo DOKKU_TAG=v0.3.26 bash bootstrap.sh
### Upgrading ### Upgrading

View File

@@ -45,11 +45,13 @@ dokku_install_package() {
curl -sSL https://get.docker.io/gpg | apt-key add - curl -sSL https://get.docker.io/gpg | apt-key add -
curl -sSL https://packagecloud.io/gpg.key | apt-key add - curl -sSL https://packagecloud.io/gpg.key | apt-key add -
apt-get update > /dev/null
apt-get install -qq -y "linux-image-extra-$(uname -r)" apt-transport-https
echo "deb https://get.docker.io/ubuntu docker main" > /etc/apt/sources.list.d/docker.list echo "deb https://get.docker.io/ubuntu docker main" > /etc/apt/sources.list.d/docker.list
echo "deb https://packagecloud.io/dokku/dokku/ubuntu/ trusty main" > /etc/apt/sources.list.d/dokku.list echo "deb https://packagecloud.io/dokku/dokku/ubuntu/ trusty main" > /etc/apt/sources.list.d/dokku.list
apt-get update > /dev/null apt-get update > /dev/null
apt-get install -qq -y "linux-image-extra-$(uname -r)" apt-transport-https
if [[ -n $DOKKU_CHECKOUT ]]; then if [[ -n $DOKKU_CHECKOUT ]]; then
apt-get install -qq -y dokku=$DOKKU_CHECKOUT apt-get install -qq -y dokku=$DOKKU_CHECKOUT

View File

@@ -21,7 +21,7 @@ if ARGV[0] == "onboot"
exit exit
end end
version = "v0.3.25" version = "v0.3.26"
dokku_root = ENV["DOKKU_ROOT"] || "/home/dokku" dokku_root = ENV["DOKKU_ROOT"] || "/home/dokku"
admin_keys = `cat /root/.ssh/authorized_keys`.split("\n") admin_keys = `cat /root/.ssh/authorized_keys`.split("\n")
hostname = `bash -c '[[ $(dig +short $HOSTNAME) ]] && echo $HOSTNAME || curl icanhazip.com'`.strip hostname = `bash -c '[[ $(dig +short $HOSTNAME) ]] && echo $HOSTNAME || curl icanhazip.com'`.strip

38
deb.mk
View File

@@ -1,8 +1,8 @@
BUILDSTEP_DESCRIPTION = 'Buildstep uses Docker and Buildpacks to build applications like Heroku' HEROKUISH_DESCRIPTION = 'Herokuish uses Docker and Buildpacks to build applications like Heroku'
BUILDSTEP_REPO_NAME ?= progrium/buildstep HEROKUISH_REPO_NAME ?= gliderlabs/herokuish
BUILDSTEP_VERSION ?= 0.0.2 HEROKUISH_VERSION ?= 0.0.1
BUILDSTEP_ARCHITECTURE = amd64 HEROKUISH_ARCHITECTURE = amd64
BUILDSTEP_PACKAGE_NAME = buildstep_$(BUILDSTEP_VERSION)_$(BUILDSTEP_ARCHITECTURE).deb HEROKUISH_PACKAGE_NAME = herokuish_$(HEROKUISH_VERSION)_$(HEROKUISH_ARCHITECTURE).deb
DOKKU_DESCRIPTION = 'Docker powered mini-Heroku in around 100 lines of Bash' DOKKU_DESCRIPTION = 'Docker powered mini-Heroku in around 100 lines of Bash'
DOKKU_REPO_NAME ?= progrium/dokku DOKKU_REPO_NAME ?= progrium/dokku
@@ -26,7 +26,7 @@ GOROOT = /usr/lib/go
GOBIN = /usr/bin/go GOBIN = /usr/bin/go
GOPATH = /home/vagrant/gocode GOPATH = /home/vagrant/gocode
.PHONY: install-from-deb deb-all deb-buildstep deb-dokku deb-gems deb-pluginhook deb-setup deb-sshcommand .PHONY: install-from-deb deb-all deb-herokuish deb-dokku deb-gems deb-pluginhook deb-setup deb-sshcommand
install-from-deb: install-from-deb:
echo "--> Initial apt-get update" echo "--> Initial apt-get update"
@@ -54,7 +54,7 @@ install-from-deb:
echo "--> Done!" echo "--> Done!"
deb-all: deb-buildstep deb-dokku deb-gems deb-pluginhook deb-sshcommand deb-all: deb-herokuish deb-dokku deb-gems deb-pluginhook deb-sshcommand
mv /tmp/*.deb . mv /tmp/*.deb .
echo "Done" echo "Done"
@@ -65,31 +65,31 @@ deb-setup:
command -v fpm > /dev/null || sudo gem install fpm --no-ri --no-rdoc command -v fpm > /dev/null || sudo gem install fpm --no-ri --no-rdoc
ssh -o StrictHostKeyChecking=no git@github.com || true ssh -o StrictHostKeyChecking=no git@github.com || true
deb-buildstep: deb-setup deb-herokuish: deb-setup
rm -rf /tmp/tmp /tmp/build $(BUILDSTEP_PACKAGE_NAME) rm -rf /tmp/tmp /tmp/build $(HEROKUISH_PACKAGE_NAME)
mkdir -p /tmp/tmp /tmp/build mkdir -p /tmp/tmp /tmp/build
echo "-> Creating deb files" echo "-> Creating deb files"
echo "#!/usr/bin/env bash" >> /tmp/tmp/post-install echo "#!/usr/bin/env bash" >> /tmp/tmp/post-install
echo "sleep 5" >> /tmp/tmp/post-install echo "sleep 5" >> /tmp/tmp/post-install
echo "count=\`sudo docker images | grep progrium/buildstep | wc -l\`" >> /tmp/tmp/post-install echo "count=\`sudo docker images | grep gliderlabs/herokuish | wc -l\`" >> /tmp/tmp/post-install
echo 'if [ "$$count" -ne 0 ]; then' >> /tmp/tmp/post-install echo 'if [ "$$count" -ne 0 ]; then' >> /tmp/tmp/post-install
echo " echo 'Removing old buildstep image'" >> /tmp/tmp/post-install echo " echo 'Removing old herokuish image'" >> /tmp/tmp/post-install
echo " sudo docker rmi progrium/buildstep" >> /tmp/tmp/post-install echo " sudo docker rmi gliderlabs/herokuish" >> /tmp/tmp/post-install
echo "fi" >> /tmp/tmp/post-install echo "fi" >> /tmp/tmp/post-install
echo "echo 'Importing buildstep into docker (around 5 minutes)'" >> /tmp/tmp/post-install echo "echo 'Importing herokuish into docker (around 5 minutes)'" >> /tmp/tmp/post-install
echo "sudo docker build -t progrium/buildstep /var/lib/buildstep 1> /dev/null" >> /tmp/tmp/post-install echo "sudo docker build -t gliderlabs/herokuish /var/lib/herokuish 1> /dev/null" >> /tmp/tmp/post-install
echo "-> Cloning repository" echo "-> Cloning repository"
git clone -q "git@github.com:$(BUILDSTEP_REPO_NAME).git" /tmp/tmp/buildstep > /dev/null git clone -q "git@github.com:$(HEROKUISH_REPO_NAME).git" /tmp/tmp/herokuish > /dev/null
rm -rf /tmp/tmp/buildstep/.git /tmp/tmp/buildstep/.gitignore rm -rf /tmp/tmp/herokuish/.git /tmp/tmp/herokuish/.gitignore
echo "-> Copying files into place" echo "-> Copying files into place"
mkdir -p "/tmp/build/var/lib" mkdir -p "/tmp/build/var/lib"
cp -rf /tmp/tmp/buildstep /tmp/build/var/lib/buildstep cp -rf /tmp/tmp/herokuish /tmp/build/var/lib/herokuish
echo "-> Creating $(BUILDSTEP_PACKAGE_NAME)" echo "-> Creating $(HEROKUISH_PACKAGE_NAME)"
sudo fpm -t deb -s dir -C /tmp/build -n buildstep -v $(BUILDSTEP_VERSION) -a $(BUILDSTEP_ARCHITECTURE) -p $(BUILDSTEP_PACKAGE_NAME) --deb-pre-depends 'lxc-docker-1.6.2' --after-install /tmp/tmp/post-install --url "https://github.com/$(BUILDSTEP_REPO_NAME)" --description $(BUILDSTEP_DESCRIPTION) --license 'MIT License' . sudo fpm -t deb -s dir -C /tmp/build -n herokuish -v $(HEROKUISH_VERSION) -a $(HEROKUISH_ARCHITECTURE) -p $(HEROKUISH_PACKAGE_NAME) --deb-pre-depends 'lxc-docker-1.6.2' --after-install /tmp/tmp/post-install --url "https://github.com/$(HEROKUISH_REPO_NAME)" --description $(HEROKUISH_DESCRIPTION) --license 'MIT License' .
mv *.deb /tmp mv *.deb /tmp
deb-dokku: deb-setup deb-dokku: deb-setup

2
debian/control vendored
View File

@@ -3,7 +3,7 @@ Version: 0.3.12
Section: base Section: base
Priority: optional Priority: optional
Architecture: amd64 Architecture: amd64
Depends: locales, git, make, curl, software-properties-common, lxc-docker-1.6.2, gcc, python-software-properties, man-db, buildstep, sshcommand, pluginhook Depends: locales, git, make, curl, software-properties-common, lxc-docker-1.6.2, gcc, python-software-properties, man-db, herokuish, sshcommand, pluginhook
Pre-Depends: nginx, dnsutils, ruby, ruby-dev, rubygem-rack, rubygem-rack-protection, rubygem-sinatra, rubygem-tilt, apparmor, cgroup-lite Pre-Depends: nginx, dnsutils, ruby, ruby-dev, rubygem-rack, rubygem-rack-protection, rubygem-sinatra, rubygem-tilt, apparmor, cgroup-lite
Maintainer: Jose Diaz-Gonzalez <dokku@josediazgonzalez.com> Maintainer: Jose Diaz-Gonzalez <dokku@josediazgonzalez.com>
Description: Docker powered mini-Heroku in around 100 lines of Bash Description: Docker powered mini-Heroku in around 100 lines of Bash

View File

@@ -32,14 +32,14 @@ chmod +x bootstrap.sh
sudo DOKKU_REPO=https://github.com/yourusername/dokku.git DOKKU_BRANCH=master ./bootstrap.sh sudo DOKKU_REPO=https://github.com/yourusername/dokku.git DOKKU_BRANCH=master ./bootstrap.sh
``` ```
## Custom buildstep build ## Custom herokuish build
Dokku ships with a pre-built version of version of the [buildstep](https://github.com/progrium/buildstep) component by default. If you want to build your own version you can specify that with an env variable. Dokku ships with a pre-built version of version of the [herokuish](https://github.com/gliderlabs/herokuish) component by default. If you want to build your own version you can specify that with an env variable.
```shell ```shell
git clone https://github.com/progrium/dokku.git git clone https://github.com/progrium/dokku.git
cd dokku cd dokku
sudo BUILD_STACK=true STACK_URL=https://github.com/progrium/buildstep.git make install sudo BUILD_STACK=true STACK_URL=https://github.com/gliderlabs/herokuish.git make install
``` ```
## Configuring ## Configuring

View File

@@ -25,7 +25,7 @@ You're done!
Dokku only supports deploying from its master branch, so if you'd like to deploy a different local branch use: ```git push dokku <local branch>:master``` Dokku only supports deploying from its master branch, so if you'd like to deploy a different local branch use: ```git push dokku <local branch>:master```
Right now Buildstep supports buildpacks for Node.js, Ruby, Python, [and more](https://github.com/progrium/buildstep#supported-buildpacks). It's not hard to add more, [go add more](https://github.com/progrium/buildstep#adding-buildpacks)! Right now Herokuish supports buildpacks for Node.js, Ruby, Python, [and more](https://github.com/gliderlabs/herokuish#buildpacks).
Please check the documentation for your particular build pack as you may need to include configuration files (such as a Procfile) in your project root. Please check the documentation for your particular build pack as you may need to include configuration files (such as a Procfile) in your project root.
## Deploying to server over SSH ## Deploying to server over SSH
@@ -48,7 +48,7 @@ ssh -T git@github.com
## Specifying a custom buildpack ## Specifying a custom buildpack
If buildpack detection isn't working well for you or you want to specify a custom buildpack for one repository you can create & commit a file in the root of your git repository named `.env` containing `export BUILDPACK_URL=<repository>` before pushing. This will tell buildstep to fetch the specified buildpack and use it instead of relying on the built-in buildpacks & their detection methods. If buildpack detection isn't working well for you or you want to specify a custom buildpack for one repository you can create & commit a file in the root of your git repository named `.env` containing `export BUILDPACK_URL=<repository>` before pushing. This will tell herokuish to fetch the specified buildpack and use it instead of relying on the built-in buildpacks & their detection methods.
## Dockerfile deployment ## Dockerfile deployment

View File

@@ -53,7 +53,7 @@ ATTEMPTS=6
git push dokku master git push dokku master
-----> Cleaning up... -----> Cleaning up...
-----> Building myapp from buildstep... -----> Building myapp from herokuish...
-----> Adding BUILD_ENV to build environment... -----> Adding BUILD_ENV to build environment...
-----> Ruby app detected -----> Ruby app detected
-----> Compiling Ruby/Rails -----> Compiling Ruby/Rails
@@ -124,7 +124,7 @@ ATTEMPTS=6
git push dokku master git push dokku master
-----> Cleaning up... -----> Cleaning up...
-----> Building myapp from buildstep... -----> Building myapp from herokuish...
-----> Adding BUILD_ENV to build environment... -----> Adding BUILD_ENV to build environment...
-----> Ruby app detected -----> Ruby app detected
-----> Compiling Ruby/Rails -----> Compiling Ruby/Rails

View File

@@ -1,7 +1,7 @@
# Components # Components
* [Docker](https://github.com/dotcloud/docker) - Container runtime and manager * [Docker](https://github.com/dotcloud/docker) - Container runtime and manager
* [Buildstep](https://github.com/progrium/buildstep) - Buildpack builder * [Herokuish](https://github.com/gliderlabs/herokuish) - Buildpack builder
* [pluginhook](https://github.com/progrium/pluginhook) - Shell based plugins and hooks * [pluginhook](https://github.com/progrium/pluginhook) - Shell based plugins and hooks
* [sshcommand](https://github.com/progrium/sshcommand) - Fixed commands over SSH * [sshcommand](https://github.com/progrium/sshcommand) - Fixed commands over SSH

View File

@@ -83,7 +83,7 @@ esac
```shell ```shell
#!/usr/bin/env bash #!/usr/bin/env bash
# Update the buildstep image from git source # Update the herokuish image from git source
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
@@ -180,9 +180,9 @@ for file in */REDIRECT; do
done done
``` ```
### `pre-build-buildstep` ### `pre-build-buildpack`
- Description: Allows you to run commands before the build image is created for a given app. For instance, this can be useful to add env vars to your container. Only applies to applications using buildstep. - Description: Allows you to run commands before the build image is created for a given app. For instance, this can be useful to add env vars to your container. Only applies to applications using buildpacks.
- Invoked by: `dokku build` - Invoked by: `dokku build`
- Arguments: `$APP` - Arguments: `$APP`
- Example: - Example:
@@ -195,9 +195,9 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
# TODO # TODO
``` ```
### `post-build-buildstep` ### `post-build-buildpack`
- Description: Allows you to run commands after the build image is create for a given app. Only applies to applications using buildstep. - Description: Allows you to run commands after the build image is create for a given app. Only applies to applications using buildpacks.
- Invoked by: `dokku build` - Invoked by: `dokku build`
- Arguments: `$APP` - Arguments: `$APP`
- Example: - Example:
@@ -240,9 +240,9 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
# TODO # TODO
``` ```
### `pre-release-buildstep` ### `pre-release-buildpack`
- Description: Allows you to run commands before environment variables are set for the release step of the deploy. Only applies to applications using buildstep. - Description: Allows you to run commands before environment variables are set for the release step of the deploy. Only applies to applications using buildpacks.
- Invoked by: `dokku release` - Invoked by: `dokku release`
- Arguments: `$APP` - Arguments: `$APP`
- Example: - Example:
@@ -266,9 +266,9 @@ test $(docker wait $ID) -eq 0
docker commit $ID $IMAGE > /dev/null docker commit $ID $IMAGE > /dev/null
``` ```
### `post-release-buildstep` ### `post-release-buildpack`
- Description: Allows you to run commands after environment variables are set for the release step of the deploy. Only applies to applications using buildstep. - Description: Allows you to run commands after environment variables are set for the release step of the deploy. Only applies to applications using buildpacks.
- Invoked by: `dokku release` - Invoked by: `dokku release`
- Arguments: `$APP` - Arguments: `$APP`
- Example: - Example:

View File

@@ -64,12 +64,12 @@
<p class="line"> <p class="line">
<span class="path">~</span> <span class="path">~</span>
<span class="prompt">$</span> <span class="prompt">$</span>
<span class="command">wget https://raw.github.com/progrium/dokku/v0.3.25/bootstrap.sh</span> <span class="command">wget https://raw.github.com/progrium/dokku/v0.3.26/bootstrap.sh</span>
</p> </p>
<p class="line"> <p class="line">
<span class="path">~</span> <span class="path">~</span>
<span class="prompt">$</span> <span class="prompt">$</span>
<span class="command">sudo DOKKU_TAG=v0.3.25 bash bootstrap.sh</span> <span class="command">sudo DOKKU_TAG=v0.3.26 bash bootstrap.sh</span>
</p> </p>
<p class="line"> <p class="line">
<span class="output"># =&gt; Go to your server's IP and follow the web installer</span> <span class="output"># =&gt; Go to your server's IP and follow the web installer</span>

View File

@@ -15,12 +15,12 @@
<p class="line"> <p class="line">
<span class="path">~</span> <span class="path">~</span>
<span class="prompt">$</span> <span class="prompt">$</span>
<span class="command">wget https://raw.github.com/progrium/dokku/v0.3.25/bootstrap.sh</span> <span class="command">wget https://raw.github.com/progrium/dokku/v0.3.26/bootstrap.sh</span>
</p> </p>
<p class="line"> <p class="line">
<span class="path">~</span> <span class="path">~</span>
<span class="prompt">$</span> <span class="prompt">$</span>
<span class="command">sudo DOKKU_TAG=v0.3.25 bash bootstrap.sh</span> <span class="command">sudo DOKKU_TAG=v0.3.26 bash bootstrap.sh</span>
</p> </p>
<p class="line"> <p class="line">
<span class="output"># =&gt; Go to your server's IP and follow the web installer</span> <span class="output"># =&gt; Go to your server's IP and follow the web installer</span>

View File

@@ -14,8 +14,8 @@ To install the latest stable version of dokku, you can run the following bootstr
```shell ```shell
# installs dokku via apt-get # installs dokku via apt-get
wget https://raw.github.com/progrium/dokku/v0.3.25/bootstrap.sh wget https://raw.github.com/progrium/dokku/v0.3.26/bootstrap.sh
sudo DOKKU_TAG=v0.3.25 bash bootstrap.sh sudo DOKKU_TAG=v0.3.26 bash bootstrap.sh
# By default, this will do cli-based setup, though you may *also* # By default, this will do cli-based setup, though you may *also*
# go to your server's IP and follow the web installer # go to your server's IP and follow the web installer

View File

@@ -20,19 +20,22 @@ ps:stop <app> Stop app container(s)
Dokku allows you to run multiple process types at different container counts. For example, if you had an app that contained 1 web app listener and 1 background job processor, dokku can, spin up 1 container for each process type defined in the Procfile. By default we will only start the web process. However, if you wanted 2 job processors running simultaneously, you can modify this behavior in a few ways. Dokku allows you to run multiple process types at different container counts. For example, if you had an app that contained 1 web app listener and 1 background job processor, dokku can, spin up 1 container for each process type defined in the Procfile. By default we will only start the web process. However, if you wanted 2 job processors running simultaneously, you can modify this behavior in a few ways.
## Include a DOKKU_SCALE file in your repo ### DOKKU_SCALE file
Dokku expects this file to contain one line for every process defined in your Procfile. Example: You can optionally create a `DOKKU_SCALE` file in the root of your repository. Dokku expects this file to contain one line for every process defined in your Procfile. Example:
``` ```
web=1 web=1
worker=2 worker=2
``` ```
### `ps:scale` command
Dokku can also manage scaling itself via the `ps:scale` command. This command can be used to scale multiple process types at the same time.
## Use the ps:scale command. Example:
``` ```
dokku ps:scale app_name web=1 worker=2 dokku ps:scale app_name web=1 worker=2
``` ```
*NOTE*: Dokku will always use the DOKKU_SCALE file that ships with the repo to override any local settings. *NOTE*: Dokku will always use the DOKKU_SCALE file that ships with the repo to override any local settings.

View File

@@ -27,9 +27,9 @@ A value of 64 would allow domains with up to 64 characters. Set it to 128 if you
Save the file and try stopping nginx and starting it again: Save the file and try stopping nginx and starting it again:
``` ```
root@dockerapps:~/dokku/buildstep# /etc/init.d/nginx stop root@dockerapps:~/dokku# /etc/init.d/nginx stop
* Stopping nginx nginx [ OK ] * Stopping nginx nginx [ OK ]
root@dockerapps:~/dokku/buildstep# /etc/init.d/nginx start root@dockerapps:~/dokku# /etc/init.d/nginx start
* Starting nginx nginx [ OK ] * Starting nginx nginx [ OK ]
``` ```
@@ -65,8 +65,8 @@ __Solution (Less solution, more helpful troubleshooting steps):__
Find the failed phase's container image (*077581956a92* in this example) Find the failed phase's container image (*077581956a92* in this example)
``` ```
root@dokku:~# docker ps -a | grep builder root@dokku:~# docker ps -a | grep build
94d9515e6d93 077581956a92 "/build/builder" 29 minutes ago Exited (0) 25 minutes ago cocky_bell 94d9515e6d93 077581956a92 "/build" 29 minutes ago Exited (0) 25 minutes ago cocky_bell
``` ```
Start a new container with the failed image and poke around (i.e. ensure you can access the internet from within the container or attempt the failed command, if known) Start a new container with the failed image and poke around (i.e. ensure you can access the internet from within the container or attempt the failed command, if known)
@@ -109,26 +109,6 @@ Also see [issue #116](https://github.com/progrium/dokku/issues/116)
*** ***
__Symptom:__ I want to deploy my nodejs app on dokku and use a postinstall script within the package.json but I keep getting this error:
npm WARN cannot run in wd app@1.0.0 echo blah (wd=/build/app)
__Solution:__
This is a permissions problem as dokku (buildstep) uses a root account for running the application. (This may change please see this thread: https://github.com/progrium/buildstep/pull/42).
To allow npm to work as root account one must set the configuration option of ```unsafe-perm``` to true. There are many ways to set this configuration option but the one I've found works most consistently with the heroku-nodejs-buildpack is as a .npmrc file. The file should contain
```
unsafe-perm = true
```
Note that this is NOT required on heroku as heroku does not use a root account for running the application.
Please see https://github.com/progrium/dokku/issues/420 and https://github.com/heroku/heroku-buildpack-nodejs/issues/92.
***
__Symptom:__ I successfully deployed my application with no deployment errors and receiving Bad Gateway when attempting to access the application __Symptom:__ I successfully deployed my application with no deployment errors and receiving Bad Gateway when attempting to access the application
__Solution:__ __Solution:__

View File

@@ -37,26 +37,26 @@ All changes will take effect upon next application deployment. To trigger a rebu
dokku ps:rebuildall dokku ps:rebuildall
``` ```
## Buildstep image ## Herokuish image
If dokku was installed via a debian package, you can upgrade buildstep via the following command: If dokku was installed via a debian package, you can upgrade herokuish via the following command:
```shell ```shell
sudo apt-get install buildstep sudo apt-get install Herokush
``` ```
For unattended upgrades, you may run the following command: For unattended upgrades, you may run the following command:
```shell ```shell
sudo apt-get install -qq -y buildstep sudo apt-get install -qq -y herokuish
``` ```
In some cases, it may be desirable to run a specific version of buildstep. To install/upgrade buildstep from source, run the following commands: In some cases, it may be desirable to run a specific version of herokuish. To install/upgrade herokuish from source, run the following commands:
```shell ```shell
cd /tmp cd /tmp
git clone https://github.com/progrium/buildstep.git git clone https://github.com/gliderlabs/herokuish.git
cd buildstep cd herokuish
git pull origin master git pull origin master
sudo make build IMAGE_NAME=gliderlabs/herokuish BUILD_TAG=latest VERSION=master make -e build-in-docker
``` ```

13
dokku
View File

@@ -3,7 +3,7 @@ set -eo pipefail
shopt -s nullglob shopt -s nullglob
export DOKKU_DISTRO=${DOKKU_DISTRO:="ubuntu"} export DOKKU_DISTRO=${DOKKU_DISTRO:="ubuntu"}
export DOKKU_IMAGE=${DOKKU_IMAGE:="progrium/buildstep"} export DOKKU_IMAGE=${DOKKU_IMAGE:="gliderlabs/herokuish"}
export DOKKU_ROOT=${DOKKU_ROOT:=~dokku} export DOKKU_ROOT=${DOKKU_ROOT:=~dokku}
export PLUGIN_PATH=${PLUGIN_PATH:="/var/lib/dokku/plugins"} export PLUGIN_PATH=${PLUGIN_PATH:="/var/lib/dokku/plugins"}
@@ -72,14 +72,15 @@ case "$1" in
pluginhook pre-deploy $APP pluginhook pre-deploy $APP
is_image_buildstep_based "$IMAGE" && DOKKU_BUILDSTEP=true is_image_herokuish_based "$IMAGE" && DOKKU_HEROKUISH=true
DOKKU_SCALE_FILE="$DOKKU_ROOT/$APP/DOKKU_SCALE" DOKKU_SCALE_FILE="$DOKKU_ROOT/$APP/DOKKU_SCALE"
oldids=$(get_app_container_ids $APP) oldids=$(get_app_container_ids $APP)
while read line || [ -n "$line" ] while read line || [ -n "$line" ]
do do
PROC_TYPE=${line%%=*} TRIM=${line%#*}
PROC_COUNT=${line#*=} PROC_TYPE=${TRIM%%=*}
PROC_COUNT=${TRIM#*=}
CONTAINER_INDEX=1 CONTAINER_INDEX=1
while [[ $CONTAINER_INDEX -le $PROC_COUNT ]];do while [[ $CONTAINER_INDEX -le $PROC_COUNT ]];do
@@ -94,9 +95,9 @@ case "$1" in
DOCKER_ARGS+=$(: | pluginhook docker-args-deploy $APP) DOCKER_ARGS+=$(: | pluginhook docker-args-deploy $APP)
BIND_EXTERNAL=$(pluginhook bind-external-ip $APP) BIND_EXTERNAL=$(pluginhook bind-external-ip $APP)
[[ -n "$DOKKU_BUILDSTEP" ]] && START_CMD="/start $PROC_TYPE" [[ -n "$DOKKU_HEROKUISH" ]] && START_CMD="/start $PROC_TYPE"
if [[ -z "$DOKKU_BUILDSTEP" ]];then if [[ -z "$DOKKU_HEROKUISH" ]];then
DOKKU_DOCKERFILE_PORT=$(dokku config:get $APP DOKKU_DOCKERFILE_PORT || true) DOKKU_DOCKERFILE_PORT=$(dokku config:get $APP DOKKU_DOCKERFILE_PORT || true)
START_CMD=$(dokku config:get $APP DOKKU_DOCKERFILE_START_CMD || $START_CMD) START_CMD=$(dokku config:get $APP DOKKU_DOCKERFILE_START_CMD || $START_CMD)
fi fi

View File

@@ -11,35 +11,37 @@ case "$1" in
pushd "$TMP_WORK_DIR" &> /dev/null pushd "$TMP_WORK_DIR" &> /dev/null
case "$IMAGE_SOURCE_TYPE" in case "$IMAGE_SOURCE_TYPE" in
buildstep) herokuish)
id=$(tar -c . | docker run -i -a stdin $DOKKU_IMAGE /bin/bash -c "mkdir -p /app && tar -xC /app") id=$(tar -c . | docker run -i -a stdin $DOKKU_IMAGE /bin/bash -c "mkdir -p /app && tar -xC /app")
test "$(docker wait $id)" -eq 0 test "$(docker wait $id)" -eq 0
docker commit $id $IMAGE > /dev/null docker commit $id $IMAGE > /dev/null
[[ -d $CACHE_DIR ]] || mkdir $CACHE_DIR [[ -d $CACHE_DIR ]] || mkdir $CACHE_DIR
# *DEPRECATED* in v0.4.0: `pluginhook pre-build` will be removed in future releases # *DEPRECATED* in v0.3.15: `pluginhook pre-build` will be removed in future releases
pluginhook pre-build "$APP" pluginhook pre-build "$APP"
# *DEPRECATED* in v0.3.22: `pluginhook pre-build-buildstep` will be removed in future releases
pluginhook pre-build-buildstep "$APP" pluginhook pre-build-buildstep "$APP"
pluginhook pre-build-buildpack "$APP"
# *DEPRECATED* in v0.3.14: `pluginhook docker-args` will be removed in future releases # *DEPRECATED* in v0.3.14: `pluginhook docker-args` will be removed in future releases
# https://github.com/progrium/dokku/issues/896 & https://github.com/progrium/dokku/issues/906 # https://github.com/progrium/dokku/issues/896 & https://github.com/progrium/dokku/issues/906
DOCKER_ARGS=$(: | pluginhook docker-args $APP build) DOCKER_ARGS=$(: | pluginhook docker-args $APP build)
DOCKER_ARGS+=$(: | pluginhook docker-args-build $APP) DOCKER_ARGS+=$(: | pluginhook docker-args-build $APP)
id=$(docker run -d -v $CACHE_DIR:/cache -e CACHE_PATH=/cache $DOCKER_ARGS $IMAGE /build/builder) id=$(docker run -d -v $CACHE_DIR:/cache -e CACHE_PATH=/cache $DOCKER_ARGS $IMAGE /build)
docker attach $id docker attach $id
test "$(docker wait $id)" -eq 0 test "$(docker wait $id)" -eq 0
docker commit $id $IMAGE > /dev/null docker commit $id $IMAGE > /dev/null
# *DEPRECATED* in v0.4.0: `pluginhook post-build` will be removed in future releases # *DEPRECATED* in v0.3.15: `pluginhook post-build` will be removed in future releases
pluginhook post-build "$APP" pluginhook post-build "$APP"
# *DEPRECATED* in v0.3.22: `pluginhook post-build-buildstep` will be removed in future releases
pluginhook post-build-buildstep "$APP" pluginhook post-build-buildstep "$APP"
pluginhook post-build-buildpack "$APP"
;; ;;
dockerfile) dockerfile)
# extract first port from Dockerfile # extract first port from Dockerfile
DOCKERFILE_PORT=$(get_dockerfile_exposed_port Dockerfile) DOCKERFILE_PORT=$(get_dockerfile_exposed_port Dockerfile)
[[ -n "$DOCKERFILE_PORT" ]] && dokku config:set-norestart $APP DOKKU_DOCKERFILE_PORT=$DOCKERFILE_PORT [[ -n "$DOCKERFILE_PORT" ]] && dokku config:set-norestart $APP DOKKU_DOCKERFILE_PORT=$DOCKERFILE_PORT
# buildstep pluginhooks don't necessarily make sense for dockerfiles. call the new breed!!!
pluginhook pre-build-dockerfile "$APP" pluginhook pre-build-dockerfile "$APP"
[[ "$DOKKU_DOCKERFILE_CACHE_BUILD" == "false" ]] && DOKKU_DOCKER_BUILD_OPTS="$DOKKU_DOCKER_BUILD_OPTS --no-cache" [[ "$DOKKU_DOCKERFILE_CACHE_BUILD" == "false" ]] && DOKKU_DOCKER_BUILD_OPTS="$DOKKU_DOCKER_BUILD_OPTS --no-cache"
@@ -57,10 +59,12 @@ case "$1" in
release) release)
APP="$2"; IMAGE="dokku/$APP"; IMAGE_SOURCE_TYPE="$3" APP="$2"; IMAGE="dokku/$APP"; IMAGE_SOURCE_TYPE="$3"
case "$IMAGE_SOURCE_TYPE" in case "$IMAGE_SOURCE_TYPE" in
buildstep) herokuish)
# *DEPRECATED* in v0.4.0: `pluginhook pre-release` will be removed in future releases # *DEPRECATED* in v0.3.15: `pluginhook pre-release` will be removed in future releases
pluginhook pre-release "$APP" pluginhook pre-release "$APP"
# *DEPRECATED* in v0.3.22: `pluginhook pre-release-buildstep` will be removed in future releases
pluginhook pre-release-buildstep "$APP" pluginhook pre-release-buildstep "$APP"
pluginhook pre-release-buildpack "$APP"
if [[ -f "$DOKKU_ROOT/ENV" ]]; then if [[ -f "$DOKKU_ROOT/ENV" ]]; then
id=$(docker run -i -a stdin $IMAGE /bin/bash -c "mkdir -p /app/.profile.d && cat > /app/.profile.d/00-global-env.sh" < "$DOKKU_ROOT/ENV") id=$(docker run -i -a stdin $IMAGE /bin/bash -c "mkdir -p /app/.profile.d && cat > /app/.profile.d/00-global-env.sh" < "$DOKKU_ROOT/ENV")
test "$(docker wait $id)" -eq 0 test "$(docker wait $id)" -eq 0
@@ -71,13 +75,14 @@ case "$1" in
test "$(docker wait $id)" -eq 0 test "$(docker wait $id)" -eq 0
docker commit $id $IMAGE > /dev/null docker commit $id $IMAGE > /dev/null
fi fi
# *DEPRECATED* in v0.4.0: `pluginhook post-release` will be removed in future releases # *DEPRECATED* in v0.3.15: `pluginhook post-release` will be removed in future releases
pluginhook post-release "$APP" pluginhook post-release "$APP"
# *DEPRECATED* in v0.3.22: `pluginhook post-release-buildstep` will be removed in future releases
pluginhook post-release-buildstep "$APP" pluginhook post-release-buildstep "$APP"
pluginhook post-release-buildpack "$APP"
;; ;;
dockerfile) dockerfile)
# buildstep pluginhooks don't necessarily make sense for dockerfiles. call the new breed!!!
pluginhook pre-release-dockerfile "$APP" pluginhook pre-release-dockerfile "$APP"
pluginhook post-release-dockerfile "$APP" pluginhook post-release-dockerfile "$APP"
;; ;;
@@ -170,7 +175,7 @@ case "$1" in
DOCKER_ARGS+=$(: | pluginhook docker-args-run $APP) DOCKER_ARGS+=$(: | pluginhook docker-args-run $APP)
[[ $DOKKU_RM_CONTAINER ]] && DOKKU_RUN_OPTS="--rm" [[ $DOKKU_RM_CONTAINER ]] && DOKKU_RUN_OPTS="--rm"
has_tty && DOKKU_RUN_OPTS+=" -i -t" has_tty && DOKKU_RUN_OPTS+=" -i -t"
is_image_buildstep_based "$IMAGE" && EXEC_CMD="/exec" is_image_herokuish_based "$IMAGE" && EXEC_CMD="/exec"
docker run $DOKKU_RUN_OPTS $DOCKER_ARGS $IMAGE $EXEC_CMD "$@" docker run $DOKKU_RUN_OPTS $DOCKER_ARGS $IMAGE $EXEC_CMD "$@"
;; ;;

View File

@@ -131,7 +131,7 @@ verify_image() {
fi fi
} }
is_image_buildstep_based() { is_image_herokuish_based() {
# circleci can't support --rm as they run lxc in lxc # circleci can't support --rm as they run lxc in lxc
[[ ! -f "/home/ubuntu/.circlerc" ]] && local DOCKER_ARGS="--rm" [[ ! -f "/home/ubuntu/.circlerc" ]] && local DOCKER_ARGS="--rm"
docker run --entrypoint="/bin/sh" $DOCKER_ARGS "$@" -c "test -f /exec" docker run --entrypoint="/bin/sh" $DOCKER_ARGS "$@" -c "test -f /exec"

View File

@@ -5,7 +5,7 @@ source "$(dirname $0)/../common/functions"
STDIN=$(cat); APP="$1"; IMAGE="dokku/$APP" STDIN=$(cat); APP="$1"; IMAGE="dokku/$APP"
DOCKERFILE_ENV_FILE="$DOKKU_ROOT/$APP/DOCKERFILE_ENV_FILE" DOCKERFILE_ENV_FILE="$DOKKU_ROOT/$APP/DOCKERFILE_ENV_FILE"
if ! is_image_buildstep_based "$IMAGE"; then if ! is_image_herokuish_based "$IMAGE"; then
> "$DOCKERFILE_ENV_FILE" > "$DOCKERFILE_ENV_FILE"
[[ -f "$DOKKU_ROOT/ENV" ]] && sed -e "s:^export ::g" -e "s:=':=:g" -e "s:'$::g" "$DOKKU_ROOT/ENV" > "$DOCKERFILE_ENV_FILE" [[ -f "$DOKKU_ROOT/ENV" ]] && sed -e "s:^export ::g" -e "s:=':=:g" -e "s:'$::g" "$DOKKU_ROOT/ENV" > "$DOCKERFILE_ENV_FILE"
[[ -f "$DOKKU_ROOT/$APP/ENV" ]] && sed -e "s:^export ::g" -e "s:=':=:g" -e "s:'$::g" "$DOKKU_ROOT/$APP/ENV" >> "$DOCKERFILE_ENV_FILE" [[ -f "$DOKKU_ROOT/$APP/ENV" ]] && sed -e "s:^export ::g" -e "s:=':=:g" -e "s:'$::g" "$DOKKU_ROOT/$APP/ENV" >> "$DOCKERFILE_ENV_FILE"

View File

@@ -23,7 +23,7 @@ git_build_app_repo() {
if [[ -f Dockerfile ]] && [[ "$([[ -f .env ]] && grep -q BUILDPACK_URL .env; echo $?)" != "0" ]] && [[ ! -f ".buildpacks" ]]; then if [[ -f Dockerfile ]] && [[ "$([[ -f .env ]] && grep -q BUILDPACK_URL .env; echo $?)" != "0" ]] && [[ ! -f ".buildpacks" ]]; then
dokku receive "$APP" "dockerfile" "$TMP_WORK_DIR" | sed -u "s/^/"$'\e[1G'"/" dokku receive "$APP" "dockerfile" "$TMP_WORK_DIR" | sed -u "s/^/"$'\e[1G'"/"
else else
dokku receive "$APP" "buildstep" "$TMP_WORK_DIR" | sed -u "s/^/"$'\e[1G'"/" dokku receive "$APP" "herokuish" "$TMP_WORK_DIR" | sed -u "s/^/"$'\e[1G'"/"
fi fi
} }
@@ -37,7 +37,7 @@ case "$1" in
# if block if you wish to run it for others as well. # if block if you wish to run it for others as well.
if [[ $refname = "refs/heads/master" ]] ; then if [[ $refname = "refs/heads/master" ]] ; then
# broken out into pluginhook so we might support other methods to receive an app # broken out into pluginhook so we might support other methods to receive an app
pluginhook receive-app $APP $newrev pluginhook -p receive-app $APP $newrev
else else
if test -f "$PLUGIN_PATH"/enabled/*/receive-branch; then if test -f "$PLUGIN_PATH"/enabled/*/receive-branch; then
pluginhook receive-branch $APP $newrev $refname pluginhook receive-branch $APP $newrev $refname

View File

@@ -4,4 +4,9 @@ source "$(dirname $0)/../common/functions"
APP="$1"; REV="$2" APP="$1"; REV="$2"
dokku git-build $APP $REV # Don't trigger git build if there is no git repository.
if [ ! -d "$DOKKU_ROOT/$APP/refs" ]; then
cat
else
dokku git-build $APP $REV
fi

View File

@@ -49,7 +49,7 @@ case "$1" in
verify_app_name "$2" verify_app_name "$2"
APP="$2" APP="$2"
pluginhook receive-app $APP pluginhook -p receive-app $APP
;; ;;
ps:rebuildall) ps:rebuildall)

View File

@@ -7,8 +7,8 @@ release_and_deploy() {
local APP="$1"; local IMAGE="dokku/$APP" local APP="$1"; local IMAGE="dokku/$APP"
if verify_image "$IMAGE"; then if verify_image "$IMAGE"; then
if is_image_buildstep_based "$IMAGE"; then if is_image_herokuish_based "$IMAGE"; then
IMAGE_SOURCE_TYPE="buildstep" IMAGE_SOURCE_TYPE="herokuish"
else else
IMAGE_SOURCE_TYPE="dockerfile" IMAGE_SOURCE_TYPE="dockerfile"
fi fi
@@ -23,18 +23,26 @@ release_and_deploy() {
fi fi
} }
print_dokku_scale_file(){
local APP="$1"; local DOKKU_SCALE_FILE="$DOKKU_ROOT/$APP/DOKKU_SCALE"
while read line || [ -n "$line" ]
do
dokku_log_info2_quiet "$line"
done < "$DOKKU_SCALE_FILE"
}
generate_scale_file() { generate_scale_file() {
local APP="$1"; local IMAGE="dokku/$APP"; local DOKKU_SCALE_FILE="$DOKKU_ROOT/$APP/DOKKU_SCALE" local APP="$1"; local IMAGE="dokku/$APP"; local DOKKU_SCALE_FILE="$DOKKU_ROOT/$APP/DOKKU_SCALE"
copy_from_image "$IMAGE" "/app/DOKKU_SCALE" "$DOKKU_ROOT/$APP" 2>/dev/null || true copy_from_image "$IMAGE" "/app/DOKKU_SCALE" "$DOKKU_ROOT/$APP" 2>/dev/null || true
if [[ ! -f $DOKKU_SCALE_FILE ]]; then if [[ ! -f $DOKKU_SCALE_FILE ]]; then
dokku_log_info1_quiet "DOKKU_SCALE not found in app image. Defaulting to a single web process" dokku_log_info1_quiet "DOKKU_SCALE file not found in app image. Defaulting to a single web process"
echo "web=1" >> $DOKKU_SCALE_FILE echo "web=1" >> $DOKKU_SCALE_FILE
dokku_log_info1_quiet "New DOKKU_SCALE file generated" dokku_log_info1_quiet "New DOKKU_SCALE file generated"
while read line || [ -n "$line" ]
do else
dokku_log_info2_quiet "$line" dokku_log_info1_quiet "DOKKU_SCALE file found"
done < "$DOKKU_SCALE_FILE" print_dokku_scale_file $APP
fi fi
} }

View File

@@ -0,0 +1,2 @@
# test comment
web=1

View File

@@ -1,3 +1,3 @@
This is a sample application to test heroku buildpack multi for integrating with buildstep: https://github.com/progrium/buildstep/pull/75 This is a sample application to test heroku buildpack multi for integrating with herokuish: https://github.com/gliderlabs/herokuish
I am choosing to use the python, nodejs, and ruby buildpacks to create a very simple flask app that performs a bower install and a simple grunt task using compass. I am choosing to use the python, nodejs, and ruby buildpacks to create a very simple flask app that performs a bower install and a simple grunt task using compass.

View File

@@ -1,11 +1,11 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -eo pipefail
MODE="$1"; MODE=${MODE:="testing"} MODE="$1"; MODE=${MODE:="testing"}
setup_circle() { setup_circle() {
MAKE_ENV="CI=true" echo "=====> setup_circle on CIRCLE_NODE_INDEX: $CIRCLE_NODE_INDEX"
[[ "$1" == "buildstack" ]] && MAKE_ENV+=" BUILD_STACK=true "
echo "setting up with MAKE_ENV: $MAKE_ENV"
sudo -E CI=true make -e sshcommand sudo -E CI=true make -e sshcommand
# need to add the dokku user to the docker group # need to add the dokku user to the docker group
sudo usermod -G docker dokku sudo usermod -G docker dokku
@@ -14,33 +14,43 @@ setup_circle() {
sudo chown -R root:root ~root/.ssh/ sudo chown -R root:root ~root/.ssh/
sudo sed --in-place 's:/home/ubuntu:/root:g' ~root/.ssh/config 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 sudo -E make -e setup-deploy-tests
make -e ci-dependencies make -e ci-dependencies
} }
if [[ -n "$CIRCLE_NODE_INDEX" ]] && [[ "$MODE" == "setup" ]]; then
case "$CIRCLE_NODE_INDEX" in
3)
setup_circle buildstack
exit $?
;;
*)
setup_circle
exit $?
;;
esac
fi
case "$CIRCLE_NODE_INDEX" in case "$CIRCLE_NODE_INDEX" in
0) 0)
echo "=====> make unit-tests (1/2) on CIRCLE_NODE_INDEX: $CIRCLE_NODE_INDEX" echo "=====> make unit-tests (1/2) on CIRCLE_NODE_INDEX: $CIRCLE_NODE_INDEX"
[[ "$MODE" == "setup" ]] && setup_circle && exit 0
sudo -E UNIT_TEST_BATCH=1 make -e unit-tests sudo -E UNIT_TEST_BATCH=1 make -e unit-tests
;; ;;
1) 1)
echo "=====> make unit-tests (2/2) on CIRCLE_NODE_INDEX: $CIRCLE_NODE_INDEX" echo "=====> make unit-tests (2/2) on CIRCLE_NODE_INDEX: $CIRCLE_NODE_INDEX"
[[ "$MODE" == "setup" ]] && setup_circle && exit 0
sudo -E UNIT_TEST_BATCH=2 make -e unit-tests sudo -E UNIT_TEST_BATCH=2 make -e unit-tests
;; ;;
2) 2)
echo "=====> make deploy-tests (buildstep release) on CIRCLE_NODE_INDEX: $CIRCLE_NODE_INDEX" echo "=====> make deploy-tests (herokuish release) on CIRCLE_NODE_INDEX: $CIRCLE_NODE_INDEX"
[[ "$MODE" == "setup" ]] && setup_circle && exit 0
sudo -E make -e deploy-tests sudo -E make -e deploy-tests
;; ;;
3) 3)
echo "=====> make deploy-tests (buildstep master) on CIRCLE_NODE_INDEX: $CIRCLE_NODE_INDEX" echo "=====> make deploy-tests (herokuish master) on CIRCLE_NODE_INDEX: $CIRCLE_NODE_INDEX"
[[ "$MODE" == "setup" ]] && setup_circle buildstack && exit 0
sudo -E make -e deploy-tests sudo -E make -e deploy-tests
;; ;;
esac esac

View File

@@ -95,7 +95,7 @@ teardown() {
assert_output "" assert_output ""
} }
@test "(config) global config (buildstep)" { @test "(config) global config (herokuish)" {
deploy_app deploy_app
run bash -c "dokku run $TEST_APP env | egrep '^global_test=true'" run bash -c "dokku run $TEST_APP env | egrep '^global_test=true'"
echo "output: "$output echo "output: "$output

View File

@@ -10,7 +10,7 @@ teardown() {
destroy_app destroy_app
} }
# @test "(ps) buildstep" { # @test "(ps) herokuish" {
# # CI support: 'Ah. I just spoke with our Docker expert -- # # CI support: 'Ah. I just spoke with our Docker expert --
# # looks like docker exec is built to work with docker-under-libcontainer, # # looks like docker exec is built to work with docker-under-libcontainer,
# # but we're using docker-under-lxc. I don't have an estimated time for the fix, sorry # # but we're using docker-under-lxc. I don't have an estimated time for the fix, sorry
@@ -21,7 +21,7 @@ teardown() {
# assert_success # assert_success
# } # }
@test "(ps) buildstep" { @test "(ps) herokuish" {
deploy_app deploy_app
run bash -c "dokku ps:stop $TEST_APP" run bash -c "dokku ps:stop $TEST_APP"
echo "output: "$output echo "output: "$output
@@ -68,7 +68,7 @@ teardown() {
done done
} }
@test "(ps:scale) buildstep" { @test "(ps:scale) herokuish" {
run bash -c "dokku ps:scale $TEST_APP web=2 worker=2" run bash -c "dokku ps:scale $TEST_APP web=2 worker=2"
echo "output: "$output echo "output: "$output
echo "status: "$status echo "status: "$status