Compare commits

...

444 Commits

Author SHA1 Message Date
rhy-jot
63f45e37ff Merge pull request #521 from ElliotChong/patch-1
Adding note re: pushing to master for deployments.
2014-04-09 16:00:53 -07:00
rhy-jot
1f4c1b5871 Merge pull request #522 from wingrunr21/improve_ssl_support
Improve SSL support and implement SPDY
2014-04-09 15:59:52 -07:00
rhy-jot
9432a380d0 Merge pull request #535 from assaf/docker-0.10
CHANGED use namespace dokku for docker 0.10 compatibility
2014-04-09 14:09:52 -07:00
Assaf Arkin
2474844856 CHANGED use namespace dokku for docker 0.10 compatibility 2014-04-09 13:06:52 -07:00
Stafford Brunk
1d7422efb9 Add note about HSTS header to README 2014-04-08 06:53:30 -06:00
Stafford Brunk
e2135a2c5f Change cert folder name from ssl to tls 2014-04-08 06:48:50 -06:00
Stafford Brunk
1d16541362 Update the TLS documentation for how to enable and for SPDY support 2014-04-03 10:44:28 -06:00
Stafford Brunk
22c25dc40a Implement nginx spdy support 2014-04-03 07:20:18 -06:00
Stafford Brunk
dfac47cbe2 Allow symlinks for SSL cert detection in nginx-vhosts post-deploy 2014-04-03 07:15:21 -06:00
Stafford Brunk
bd5b2b210c Factor common SSL settings out to the http block 2014-04-03 07:05:30 -06:00
Stafford Brunk
e33f5c94a5 Use listen 443 ssl instead of ssl on in vhost conf file 2014-04-03 07:04:35 -06:00
Elliot Chong
80d6188032 Adding note re: pushing to master for deployments. 2014-04-02 17:57:38 -07:00
rhy-jot
6d82792508 Merge pull request #516 from eitland/patch-1
Add details on how to use wildcard ssls
2014-03-31 21:29:09 -04:00
eitland
e2a5e92cf7 s/ssl/TLS/g + domain name must match for wildcards
* Updated ssl to TLS as requested.
* Added information that names must match
2014-03-31 22:53:01 +02:00
eitland
9e49bc12ed Add details on how to use wildcard ssls
After reading the source code for hints on how to deploy wildcard ssls I found it was already supported.

The proposed change should make this feature easier to find.
2014-03-31 21:27:19 +02:00
rhy-jot
4907c3c684 Merge pull request #488 from lucaswilric/ip-regex
Validate vhosts names more strictly
2014-03-12 15:13:32 -04:00
Lucas Wilson-Richter
69c13f1bd3 Improve IP detection regex so it isn't fooled by domains that
look like IP addresses.
2014-03-12 07:47:21 +11:00
Lucas Wilson-Richter
3fcc49ff00 Validate vhosts names more strictly
There was a bug in the setup page where valid domains that start with a number
would be captured by the validation check designed to detect IP
addresses. This check detects IPs by comparing the host name to a regex,
instead of simply detecting whether the first character is a number.
2014-03-10 17:05:37 +11:00
rhy-jot
0c49481282 Merge pull request #481 from elia/master
Ensure the app is really running before killing it
2014-03-08 17:45:20 -05:00
rhy-jot
900fe6fe8c Delete test application when finished with it 2014-03-08 17:33:04 -05:00
rhy-jot
2368f2d65d Add test for the multi buildpack, courtesy of https://github.com/AlJohri 2014-03-08 13:28:02 -08:00
rhy-jot
f6b7b62b15 Update PREBUILT_STACK_URL 2014-03-08 13:25:09 -08:00
rhy-jot
a9af04db81 Merge pull request #476 from joliv/master
Man page
2014-03-08 18:27:41 +00:00
joliv
c5665e1e83 Moved addman in Makefile as to not break everything 2014-03-08 12:23:22 -05:00
joliv
09610c1e4e Added manpage installation 2014-03-08 11:46:46 -05:00
joliv
dd4c390168 Added man page 2014-03-08 11:29:25 -05:00
Elia Schito
b1267ebf56 Ensure the app is really running before killing it 2014-03-07 00:54:54 +01:00
rhy-jot
7fc7a46ed3 Merge pull request #475 from alimony/patch-1
Fix typo.
2014-03-03 21:12:40 +00:00
Markus Amalthea Magnuson
0e46eba05b Fix typo.
prefered -> preferred
2014-03-03 21:37:36 +01:00
rhy-jot
c2ae9fabe0 No need for bin/. (see also: acf2dfa73a) 2014-02-28 16:41:21 -08:00
rhy-jot
ee7d3295c9 Follow redirects 2014-02-28 16:40:12 -08:00
rhy-jot
082ba1dc96 Update PREBUILT_STACK_URL 2014-02-28 16:39:51 -08:00
rhy-jot
ceeff6d09f Update stable's version 2014-02-28 23:52:19 +00:00
rhy-jot
25f4a81b71 Merge pull request #467 from silasb/fixing-log-tail
Using logs --follow instead of attaching to instance
2014-02-27 15:16:56 -08:00
silasb
37f977a68d If passing -t for tail, use logs --follow else just get last 100 lines 2014-02-25 21:23:01 -05:00
silasb
75286cdfa1 Using logs --follow instead of attaching to instance 2014-02-24 18:48:46 -05:00
rhy-jot
217d00a1bc Merge pull request #440 from imchairmanm/patch-1
Bump version number in dokku-installer.rb
2014-02-17 10:00:09 -08:00
rhy-jot
12c907b148 Merge pull request #443 from gdi2290/patch-1
update copyright year
2014-02-17 09:59:54 -08:00
rhy-jot
8c237153d2 Merge pull request #454 from dmyers/vagrant-memory
Added option to set memory size for vagrant
2014-02-17 09:59:19 -08:00
Derek Myers
4ec4354b0a Added option to set memory size for vagrant 2014-02-15 17:06:39 -06:00
PatrickJS
59dfe6b529 update copyright year 2014-02-03 22:53:56 -08:00
rhy-jot
f4d3d80075 SSL -> TLS 2014-02-03 10:13:09 -08:00
rhy-jot
af8e103bb3 Recommend 12.04 due to 13.04's EOL 2014-02-03 10:05:41 -08:00
imchairmanm
0272e87433 Bump version number in dokku-installer.rb
Just bumping the version number to bring it up-to-date with the rest of the project.
2014-02-02 13:00:53 -05:00
Paul Lietar
c5b7a63c8d Merge pull request #415 from JasonPunyon/patch-1
Fix typo in README.md
2014-01-12 09:43:06 -08:00
Jason Punyon
88433433dc Fix typo in README.md
aditional -> additional
2014-01-11 19:36:29 -05:00
rhy-jot
8fca2204ed Merge pull request #407 from banyan/specify-docker-version
Add $DOCKER_VERSION to specify docker version
2014-01-08 13:27:30 -08:00
Paul Lietar
acb226cb86 Merge pull request #400 from aegypius/suppress-git-output-unless-dokku-trace-is-enabled
Suppress git "detached HEAD" notice output
2014-01-07 05:32:34 -08:00
aegypius
d208e53649 Suppress git advice related to detached HEAD 2014-01-07 14:30:29 +01:00
Kohei Hasegawa
57906fa562 Add $DOCKER_VERSION to specify docker version 2014-01-07 00:21:58 +09:00
Paul Lietar
3a3b56c7ab Merge pull request #405 from AlJohri/master
Fix docker build for docker v0.7.3
2014-01-06 04:04:12 -08:00
Al Johri
a892a920a8 Docker build no longer works with github url
Change default URL for progrium/buildstep to include full git clone url
2014-01-06 06:00:42 -06:00
rhy-jot
f0c41e3a81 Merge pull request #370 from jazzzz/submodules
Submodule support
2013-12-28 19:50:23 -08:00
Jazz
7b28307306 Added submodules test 2013-12-28 16:10:50 +01:00
Jazz
7f0591fa1e Submodules support 2013-12-28 16:10:13 +01:00
rhy-jot
419efc2cf1 Merge pull request #391 from mikexstudios/receive-predir-fix
Fix edge case: app directory is created before first app push
2013-12-23 19:13:32 -08:00
Michael Huynh
d9ed1e07eb Fix edge case: app directory is created before first app push
When an app directory (i.e. `/home/dokku/myapp`) is created before the
app is pushed for the first time (which may occur if config files such
as `ENV` are added before the initial push), then the app directory will
not be initialized to a bare git repo nor will the pre-receive hook be
installed because `plugins/git/commands` assumes that if `$APP_PATH`
exists, then the directory must also be git initialized too. This fix
checks for `$APP_PATH/refs` instead.
2013-12-23 21:50:49 -05:00
rhy-jot
3ee694d3ea Merge pull request #383 from colnpanic/features/notify-non-master-push
notify user when pushing to non-master branch
2013-12-22 14:09:08 -08:00
jay becker
7eae3b063c notify user when pushing to non-master branch 2013-12-22 14:30:51 -06:00
rhy-jot
c16afaa338 Merge pull request #390 from rhy-jot/2013-12-20/java-test
Add Java test
2013-12-20 11:45:09 -08:00
rhy-jot
921bdc48a6 Add Java test 2013-12-20 11:35:00 -08:00
rhy-jot
b602cd3127 Update dig command
Was changed in da11349e81
2013-12-19 20:22:07 -08:00
rhy-jot
d72b79a18d Update stable’s bootstrap command 2013-12-19 18:07:20 -08:00
rhy-jot
723cf1d43d Merge pull request #382 from joliv/patch-1
README grammar
2013-12-18 17:23:15 -08:00
rhy-jot
693800d709 Merge pull request #321 from mikexstudios/remove-image-var
For #313: Do not specify both `$APP` and `$IMAGE` for base commands.
2013-12-18 14:18:51 -08:00
Michael Huynh
28de3ecaa3 For #313: Do not specify both $APP and $IMAGE for base commands.
As discussed in #313, dokku base commands such as build, release, and
deploy require specifying both `$APP` and `$IMAGE` as arguments where
`IMAGE="app/$APP"`. Thus, the `$IMAGE` parameter is currently redudant.

This patch removes the need to specify `$IMAGE` for these base commands
and is backwards compatible. If, in the future, the base commands expect
and `$IMAGE` different than `app/$APP`, then the `$IMAGE` parameter will
be re-added for those specific commands.
2013-12-18 17:01:56 -05:00
Paul Lietar
bd21149e8d Merge pull request #381 from alexanderbeletsky/post-build
Add a post-build hook
2013-12-17 00:40:50 -08:00
Paul Lietar
c2aaa94523 Merge pull request #384 from colnpanic/features/notify-kill-failed
Ignore failures when trying to stop containers.
2013-12-17 00:26:32 -08:00
jay becker
1050f350c0 do not exit when docker fails 2013-12-16 16:55:16 -06:00
joliv
ec9e61d2bc README grammar
Some confused me as I was scrolling through the docs (missing pronouns) and others were more nit-picky.
2013-12-14 20:13:04 -05:00
rhy-jot
74dfb605d7 Print datestamp before doing anything
This lets easily see if Travis' "restart build" feature is working properly
2013-12-14 11:28:46 -08:00
alexanderbeletsky
b206c2b4f5 added post-build hook 2013-12-14 18:26:39 +02:00
rhy-jot
8210323ece Mention LTS support & additional instruction 2013-12-12 22:01:43 -08:00
Paul Lietar
fff066b120 Merge pull request #373 from plietar/tests-hooks
Allow tests to have a setup phase.
2013-12-11 20:17:53 -08:00
Paul Lietar
48b4e330a3 Add a config test. 2013-12-12 03:54:39 +00:00
Paul Lietar
baefdabdfc Allow tests to have a setup phase. 2013-12-12 03:54:39 +00:00
Paul Lietar
acf2dfa73a Use the node binary from the PATH.
The new nodejs buildpack has changed the location of the node binary.
Using the PATH make the test pass on both buildpacks.
refs #371
2013-12-12 03:51:39 +00:00
Paul Lietar
9876561fa9 Merge pull request #355 from plietar/static-test
Add a static website test.
2013-12-03 11:21:45 -08:00
Paul Lietar
2f97afb3f0 Add a static website test. 2013-12-03 19:13:14 +00:00
rhy-jot
776c7c38af Merge pull request #363 from progrium/2013-12-03/reenable-go
Reenable go test
2013-12-03 10:01:29 -08:00
rhy-jot
f64e27f32e Reenable go test 2013-12-03 09:51:47 -08:00
rhy-jot
6718094237 Merge pull request #361 from plietar/backup-check
Backup check
2013-12-02 15:34:55 -08:00
rhy-jot
c77cbf1d3a Merge pull request #358 from dyson/DOCKER_ARGS
For #304: Add $DOCKER_ARGS and docker-args pluginhook to dokku deploy and command run.
2013-12-02 12:59:52 -08:00
Dyson Simmons
1e76aba0af Pipe no op into docker-args plugin-hooks to avoid problems when running over ssh w/o a pty. 2013-12-01 00:14:01 +11:00
Paul Lietar
5c58a5e8e7 Add a backup-check to avoid reimporting apps. 2013-11-30 02:46:42 +00:00
Paul Lietar
a4451e82ac Merge ssh keys rather than overwriting them. 2013-11-30 02:45:58 +00:00
Paul Lietar
4e737e739f Add a backup-check used to validate the archive.
This allows plugins to refuse a backup, before the import process starts.
Users can force the import using -f.
2013-11-30 02:45:32 +00:00
Dyson Simmons
aaa4f0fade Add $DOCKER_ARGS and docker-args pluginhook to dokku deploy and command run. 2013-11-29 15:52:26 +11:00
Lukas Schauer
56de22a3c8 conditional installation of python-software-properties 2013-11-28 16:09:47 -08:00
rhy-jot
1705307081 Link to freenode's webchat 2013-11-28 12:57:22 -08:00
rhy-jot
dd356d02ee Clean up first. This allows users to get logs from failed runs before they're wiped out. Ref: #354 2013-11-28 11:20:09 -08:00
rhy-jot
c317dca558 Merge pull request #342 from plietar/no-container
Don't fail if CONTAINER is inexistant.
2013-11-27 13:18:31 -08:00
rhy-jot
9eff936676 Remove outdated sed. Fixes #346
Starting apps on daemon start has been handed by the upstart 'dokku-redeploy' script for a while. (Also, the format of /etc/init/docker.conf changed and rendered the sed useless.)
2013-11-27 12:50:22 -08:00
rhy-jot
882e7ac5fe Merge pull request #348 from progrium/no-root
Drop root privileges if necessary.
2013-11-27 12:39:33 -08:00
Lukas Schauer
95c9656fc8 nginx vhost ipv6 compatibility
IPv6 Compatibility (Nginx Default Site is IPv6 compatible, resulting in not-working vhosts when AAAA DNS entry is set)
2013-11-27 12:03:38 -08:00
Paul Lietar
432aec67d5 Update HISTORY.md to reflect the v0.2 release. 2013-11-27 03:36:50 +00:00
Paul Lietar
2ed527bedc Drop root privileges if necessary.
This makes it possible to call dokku commands as root.
2013-11-25 23:04:35 +00:00
rhy-jot
698e5e5d0e Add stable installation instructions 2013-11-23 17:22:51 -08:00
Paul Lietar
10a8c75224 Add an empty help message to the nginx-vhosts plugin.
Not doing anything just destroys the help message coming from previous
plugins. Run cat to forward stdin into stdout.
2013-11-23 00:10:30 +00:00
Paul Lietar
8a9182c859 Don't fail if CONTAINER is inexistant. 2013-11-22 22:58:02 +00:00
rhy-jot
e42c028d18 Merge pull request #344 from plietar/commandfix
Fix commands, the easy way.
2013-11-22 14:54:07 -08:00
Paul Lietar
7ed57b285c Close stdin before running the backup-export hooks.
This avoids hanging when we're not in a pty.
2013-11-22 22:46:54 +00:00
Paul Lietar
99e0a43f81 Remove known issues and add note about ForceTTY
These issues are fixed by this PR.
2013-11-22 22:22:20 +00:00
Paul Lietar
e126da0db2 Don't explicitly specify streams to docker run.
Now that "docker run" always has an stdin, we don't need to explicitly
specify stdout and stderr.
2013-11-22 21:42:48 +00:00
Paul Lietar
455be29249 Fix commands, the easy way.
Don't use pluginhook to run the commands hook, just run all the scripts
in a loop.
2013-11-22 21:42:39 +00:00
rhy-jot
3f487b2291 Merge pull request #341 from plietar/known-issues
Add a list of known issues.
2013-11-21 15:31:12 -08:00
Paul Lietar
9ec7501940 Add a list of known issues. 2013-11-21 21:01:08 +00:00
Jeff Lindsay
a9e0a7b57e remove any default enabled sites for nginx 2013-11-21 13:03:55 -06:00
rhy-jot
f4018db310 Use $DOKKU_ROOT instead of $HOME 2013-11-21 10:48:55 -08:00
rhy-jot
cb781f9ce1 Merge pull request #337 from ryanseys/patch-1
Fix capitalization for consistency
2013-11-20 18:05:19 -08:00
Ryan Seys
ad9fe82bc7 Fix capitalization for consistency 2013-11-20 20:59:00 -05:00
rhy-jot
dfcc46b1d2 Merge pull request #334 from plietar/version
Add a version command.
2013-11-20 16:46:45 -08:00
Paul Lietar
4bc45256ff Add the date and time of installation if version is hardcoded. 2013-11-21 00:41:03 +00:00
Paul Lietar
725a2e02da Use a hardcoded version if git revision is not available. 2013-11-21 00:27:56 +00:00
Paul Lietar
252b1ed8b6 Add a version command.
The git tag/revision is saved when running "make install", and can be
displayed using "dokku version".
2013-11-21 00:02:02 +00:00
rhy-jot
9953030478 Merge pull request #333 from rhy-jot/2013-11-20/backup-find-to-glob
backup:export: find -> glob
2013-11-20 15:48:35 -08:00
rhy-jot
e8037da726 Use globs, set nullglob, and remove stdout redirection for import 2013-11-20 15:40:50 -08:00
Paul Lietar
e85ab7bab4 Add support for DOKKU_TAG in bootstrap.sh
Fixes #330
Refs #329
2013-11-20 23:40:42 +00:00
Alexander
d11f732595 Merge branch 'history'
* history:
  Update HISTORY.md
2013-11-20 23:53:21 +01:00
Alexander
f9db09fb21 Update HISTORY.md 2013-11-20 23:51:27 +01:00
Paul Lietar
557d555858 Delete the /cache directory's contents from inside the container.
Fixes #322.
Buildpacks write into /cache as root, which made the delete command unable
to delete it.
Its contents are now deleted using "docker run", and thus as root.
2013-11-20 20:42:15 +00:00
Alexander
e1560888f8 Merge pull request #325 from ugurthemaster/patch-1
Update bootstrap.sh
2013-11-20 03:45:08 -08:00
ugurthemaster
25b2cd7dc5 Update bootstrap.sh
A typo has been corrected.
2013-11-20 13:33:25 +02:00
rhy-jot
ab978fab4e Provide more feedback for backup import 2013-11-19 21:16:01 -08:00
rhy-jot
6d64edc16a Update headers 2013-11-19 21:15:29 -08:00
rhy-jot
dae4e55f25 Merge pull request #265 from asm89/backup
Introduce `backup` plugin to export/import settings
2013-11-19 21:07:20 -08:00
Paul Lietar
f92e7a59d9 Force connection of stdin and stderr in the run command.
If stdin is closed, which is the case when pluginhook is called from an
interactive session, "docker run" does not connect stdin and stderr by default.
Fixes #323
2013-11-20 00:45:41 +00:00
rhy-jot
4ad0c6bb7c Update buildstep URL and reenable PHP test 2013-11-19 15:13:09 -08:00
rhy-jot
aed9968265 Revert "Reenable PHP test"
This reverts commit 7ecacd5d98.
2013-11-18 17:59:18 -08:00
rhy-jot
e641fda68e Merge pull request #318 from rhy-jot/2013-11-18/reenable-php
Reenable PHP test
2013-11-18 17:56:03 -08:00
rhy-jot
7ecacd5d98 Reenable PHP test 2013-11-18 17:53:00 -08:00
Paul Lietar
bc9dbf6127 Merge pull request #309 from plietar/make-phony
Make targets in the Makefile part of PHONY.
2013-11-18 13:56:01 -08:00
rhy-jot
5e1e903d51 Merge pull request #317 from plietar/master
Enable tracing in hooks when DOKKU_TRACE is set.
2013-11-18 13:23:44 -08:00
Paul Lietar
158c3d215b Enable DOKKU_TRACE when running travis tests. 2013-11-18 21:02:41 +00:00
Paul Lietar
83ce81fc51 Enable tracing in hooks when DOKKU_TRACE is set.
This makes it much easier to debug plugins.
Also source the 'dokkurc' file when starting dokku. This makes it easy
to define DOKKU_TRACE over ssh.
2013-11-18 20:59:48 +00:00
rhy-jot
805c5a27c6 Don't overwrite $DOKKU_ROOT/{HOSTNAME,VHOST} 2013-11-18 11:50:28 -08:00
Paul Lietar
584ddf9044 Make targets in the Makefile part of PHONY. 2013-11-15 10:00:30 +00:00
rhy-jot
da11349e81 Merge pull request #310 from plietar/fqdn
Use the FQDN to setup the HOSTNAME and VHOST files.
2013-11-14 22:56:05 -08:00
Paul Lietar
ea663d13d3 Set the hostname of the ci receiver correctly. 2013-11-15 03:08:14 +00:00
Paul Lietar
a06d27ab45 Use the FQDN to setup the HOSTNAME and VHOST files.
The HOSTNAME environment var only contains the first part of the domain
name. Use the fqdn to have it entirely.
2013-11-15 03:07:51 +00:00
Alexander
2219044114 Introduce DOKKU_ROOT and import now in git plugin 2013-11-14 23:51:35 +01:00
Alexander
682229baae Specify current backup version at the top of the script 2013-11-14 21:52:49 +01:00
Alexander
8981b9e613 Introduce backup plugin to export/import settings 2013-11-14 21:52:49 +01:00
rhy-jot
59ef6510bc Merge pull request #307 from mmalecki/patch-1
dotcloud/docker#1869 is closed and released
2013-11-13 15:33:47 -08:00
Maciej Małecki
1d3ae29ba6 dotcloud/docker#1869 is closed and released 2013-11-13 23:33:14 +01:00
rhy-jot
7281daaa5e Merge pull request #303 from kkurian/patch-1
spelling
2013-11-12 16:19:32 -08:00
Kerry Ivan Kurian
f8fb8e104a spelling 2013-11-12 19:10:43 -05:00
rhy-jot
be97ee6019 Add upgrade instructions for users pre-27d4bc8c3c 2013-11-12 11:00:29 -08:00
rhy-jot
dd0fe5eeb1 Update environment variable section to reflect new config plugin 2013-11-11 21:05:11 -08:00
rhy-jot
a0b7831b08 Pull the advanced installation sections into their own document 2013-11-11 20:45:30 -08:00
rhy-jot
d829135d78 Remove ideas for improvement (they're complete or near completion) and mention Flynn. 2013-11-11 18:56:16 -08:00
rhy-jot
f308025694 receiver no longer exists 2013-11-11 11:42:15 -08:00
rhy-jot
ba6393fadd Merge pull request #289 from mikexstudios/vagrantfix
Set Ubuntu Raring cloud box `--ostype=Ubuntu_64` to fix virtualbox boot
2013-11-11 11:36:20 -08:00
rhy-jot
d41f88fd22 Configure user.name & user.email 2013-11-08 16:27:15 -08:00
rhy-jot
09fa06beaa Orphaning 2013-11-08 16:13:50 -08:00
Jeff Lindsay
b59e36af3f wait longer for host to be running gitreceive 2013-11-08 15:28:25 -08:00
Jeff Lindsay
a2fb231810 be sure to push to master 2013-11-08 15:25:15 -08:00
Jeff Lindsay
2ac9996b27 kill it 2013-11-08 15:17:53 -08:00
Jeff Lindsay
a159c5a708 new travis config 2013-11-08 15:15:06 -08:00
Jeff Lindsay
a3c561c69d disabling php 2013-11-08 14:47:14 -08:00
Jeff Lindsay
48aba9567f changes to the environment 2013-11-08 14:43:30 -08:00
Jeff Lindsay
960f9503e3 remove build dir if exists. use absolute paths 2013-11-08 14:22:21 -08:00
Jeff Lindsay
75a5466650 boot is now an image setup script. receiver updated to work with gitreceive-next 2013-11-08 14:19:30 -08:00
Jeff Lindsay
986acb28b5 gopath 2013-11-08 14:01:51 -08:00
Jeff Lindsay
b732fc58c0 ci stuff 2013-11-08 13:45:12 -08:00
Jeff Lindsay
94b77a8c8b more obvious/standard/short 2013-11-07 08:32:20 -08:00
Jeff Lindsay
0e0135284c doc stub 2013-11-07 08:31:10 -08:00
Jeff Lindsay
beea0935e3 Merge pull request #290 from Jeewes/patch-1
Deprecated statement in installation guide.
2013-11-04 12:06:08 -08:00
Jeewes
3cf7fbae06 Falsy statement in installation guide.
It says:
"Almost done! For next steps on configuration:
  https://github.com/progrium/dokku#configuring"
after bootstrapping..
2013-11-04 22:01:54 +02:00
Michael Huynh
d2426530f3 Set Ubuntu Raring cloud box --ostype=Ubuntu_64 to fix virtualbox boot issue. 2013-11-03 13:09:32 -05:00
rhy-jot
d71cd77f7a Merge pull request #273 from plietar/logs-f
Add an option to follow the logs.
2013-10-31 15:00:22 -07:00
rhy-jot
407c5b2875 Merge pull request #279 from alhafoudh/master
Fixed port redirection issues
2013-10-31 14:53:33 -07:00
Ahmed Al Hafoudh
9aa5f7a85b Fixed port redirection issues 2013-10-31 16:13:57 +01:00
Paul Lietar
28c78300db Improve the logs command.
Check for application's existence, and add an optional -t option, to
make it behave like "tail -f" or "heroku logs -t"
2013-10-31 10:50:58 +00:00
rhy-jot
0da5065429 Mention issues with 13.10 2013-10-30 19:37:02 -07:00
Jeff Lindsay
d457aaae99 an "installer" (really just config/setup) for prebuilt images (at least for now) 2013-10-30 19:39:20 -05:00
rhy-jot
3c1666076e Silence nginx reloading 2013-10-30 17:17:53 -07:00
rhy-jot
3321186ffe Remove newly introduced '0.0.0.0:' from docker port 2013-10-30 17:02:36 -07:00
rhy-jot
fc11d5b8e9 Merge pull request #275 from progrium/shebang-pipefail
normalizing shebang and bash options + long-term fix for bootstrap instructions
2013-10-30 15:41:39 -07:00
Jeff Lindsay
483860e429 reorganizing deploy readme 2013-10-30 17:31:59 -05:00
Jeff Lindsay
b64fe76ec0 adding a DOKKU_TRACE env var to enable "set -x" 2013-10-29 17:44:36 -05:00
Jeff Lindsay
df7507d1be normalizing shebang and bash options. also added long-term fix for bootstrap instructions 2013-10-29 17:13:02 -05:00
rhy-jot
14b71cec87 Merge pull request #270 from plietar/git-plugin
Replace gitreceive by a git plugin.
2013-10-29 13:07:55 -07:00
Paul Lietar
bca5a99b1d Don't allow the push if building failed. 2013-10-28 21:15:17 +00:00
Paul Lietar
b5c8dd7436 Use DOKKU_ROOT instead of HOME.
HOME is not consistent if dokku is ran e.g. as root (for setup).
The DOKKU_ROOT variable will also make it possible to have the repositories stored in an arbitrary location (works-ish right now)
2013-10-28 21:15:17 +00:00
Paul Lietar
e04f271d8e Remove "remote:" in the git hook output 2013-10-28 21:15:17 +00:00
Paul Lietar
27d4bc8c3c Replace gitreceive by a git plugin.
This removes the need for two distinct users.
Git pushes and dokku commands are sent using the same user.
2013-10-28 21:15:17 +00:00
Alexander
6350f373be Preserve cache directory between builds 2013-10-28 08:54:30 +01:00
rhy-jot
7b74935210 Merge pull request #262 from josegonzalez/app-deletion
App deletion
2013-10-27 15:29:46 -07:00
Jose Diaz-Gonzalez
01d57ef0dc New command: dokku delete <app>
Two new hooks are implemented:

- pre-delete $APP
- post-delete $APP

The following are implemented in the `post-delete` hook:

- `$APP` directory deletion (00_dokku-standard)
- nginx reload (nginx-vhosts)

The following command can be executed by either the `dokku` or `git` user as `sudo`:

    sudo /etc/init.d/nginx reload

Refs #124
Closes #186
2013-10-27 17:49:11 -04:00
Jose Diaz-Gonzalez
bcfaefa896 Enable 'nginx reload' support for git and dokku user. Refs #124. Refs #186 2013-10-25 02:42:49 -04:00
Alexander
85f14baad5 Introduce URL for app. Plugins can override this.
fixes #242
2013-10-24 13:44:05 +02:00
Alexander
c0a2683744 Merge branch 'support-for-cached-stack-tarball-on-vagrant'
* support-for-cached-stack-tarball-on-vagrant:
  Allow bootstraping Vagrant VM with a cached stack tarball
2013-10-24 13:25:51 +02:00
Fabio Rehm
96f0d8e2fa Allow bootstraping Vagrant VM with a cached stack tarball 2013-10-24 12:46:09 +02:00
rhy-jot
c90fd9406a Merge pull request #258 from mikexstudios/master
Made `commands` in config plugin executable to use with pluginhook.
2013-10-22 15:35:18 -07:00
Michael Huynh
7e201e9eb0 Made commands in config plugin executable to use with pluginhook. 2013-10-22 18:25:21 -04:00
rhy-jot
faac15bddb Added completed items from 0.2.0 roadmap (#55) to HISTORY.md 2013-10-21 18:27:47 -07:00
Alexander
98168b0e0b Merge pull request #244 from josegonzalez/patch-1
heroku-like configuration handling for dokku
2013-10-17 14:49:01 -07:00
Jose Diaz-Gonzalez
a308ff6546 heroku-like configuration handling for dokku
refs #55
superscedes #188
2013-10-17 17:47:19 -04:00
rhy-jot
2d76bfb9d3 Merge pull request #249 from bit/master
use http for docker apt repository
2013-10-17 13:33:29 -07:00
j
d617b73ece use http for docker apt repository 2013-10-17 22:25:29 +02:00
Alexander
13cda0fd16 make all -> make install 2013-10-15 22:49:56 +02:00
Alexander
b5ce871da4 Merge pull request #241 from musicglue/pre-build-hook
add pre-build hook
2013-10-14 13:21:26 -07:00
Alexander
fb3051d108 Merge pull request #240 from jaseg/authors
Added myself to AUTHORS - jaseg
2013-10-14 13:18:04 -07:00
Alexander
925a0b0f05 Merge pull request #219 from jaseg/patch-1
Update Makefile: Do not try to install on "make" or "make all"
2013-10-14 13:17:36 -07:00
Lee Henson
c05007a9d2 normalise 'build' function args to match 'release' and 'deploy' 2013-10-10 18:23:52 +01:00
jaseg
d8cd86fa8b Added myself to AUTHORS - jaseg 2013-10-09 22:02:38 +02:00
jaseg
c1c96e22ce Update Makefile: Do not try to install on "make" or "make all"
To be consistent with usual makefile usage and to not surprise people too much, only do permanent changes to the system when explicitely prompted to do so via "make install" instead of on any "make" or "make all" invocation, which is usually used for *building*, not *installing* things.
2013-10-09 21:54:56 +02:00
Alexander
04e7934104 Merge pull request #221 from jaseg/patch-3
receiver: fix shebang for non-standard bash locations
2013-10-09 12:39:06 -07:00
Alexander
3048c181e7 Merge pull request #220 from jaseg/patch-2
bootstrap.sh: Add shebang, Error out when apt-get is not found
2013-10-09 12:20:23 -07:00
Alexander
657e6fd543 Merge pull request #237 from rajivm/make-run-interactive-236
resolves #236, adding support for dokku run commands to be interactive
2013-10-09 12:15:34 -07:00
Rajiv Makhijani
ce81497156 added myself to authors 2013-10-09 14:03:26 -05:00
Rajiv Makhijani
4f8604777a resolves #236, adding support for dokku run commands to be interactive 2013-10-08 20:48:22 -05:00
jaseg
83e4744fa5 Support non-standard bash locations 2013-10-04 14:47:23 +02:00
jaseg
85ab9944fa bootstrap.sh: Add shebang, Error out when apt-get is not found
...to fail more gracefully on systems without apt.
2013-10-04 14:38:34 +02:00
Alexander
68bbf0d888 Merge pull request #215 from kanterov/master
Handle pipe failures
2013-10-02 13:50:37 -07:00
Alexander
2b2c68ddd7 Use pre-built buildstep image from s3. Add option to build your own. 2013-09-30 22:48:27 +02:00
Gleb Kanterov
681de274a7 Handle pipe failures 2013-09-14 14:16:46 +07:00
rhy-jot
9b4fe6badd Merge pull request #204 from statianzo/forwarded-proto
Set X-Forwarded-Proto Header
2013-09-09 19:17:03 -07:00
Jason Staten
ba1f1bc30d Add X-Forwarded-Port and X-Request-Start
Adding additional proxy headers to match what Heroku provides. Also,
X-Request-Start is compatible with NewRelic's latest agent[1].

[1]: http://blog.newrelic.com/2013/02/21/using-new-relic-on-heroku-read-how-our-new-ruby-agent-measures-queue-time/
2013-09-09 15:46:19 -06:00
Jason Staten
7f4f46a1e2 Set X-Forwarded-Proto Header
Heroku passes the X-Forwarded-Proto header to indicate the protocol of
the incoming request[1]. Ruby's rack relies on this header to
determine if a request is HTTPS[2].

Also, the X-Scheme header was removed to eliminate redundant passing of
the scheme.

[1]: https://devcenter.heroku.com/articles/http-routing#heroku-headers
[2]: https://github.com/rack/rack/blob/master/lib/rack/request.rb#L77
2013-09-09 12:12:01 -06:00
Alexander
3a111a8308 Merge pull request #189 from jeffutter/patch-1
Add nginx configure hook
2013-08-27 07:53:40 -07:00
Jeffery Utter
1a7d68a3fc Add nginx configure hook
This adds a pluginhook for nginx-configure to be called after the main nginx configuration is called and before nginx is reloaded. This will allow other plugins to modify the nginx configuration
2013-08-27 09:47:41 -05:00
rhy-jot
6a7de8d7e8 Restore software-properties-common 2013-08-24 11:21:55 -07:00
rhy-jot
fbf2b28512 Install docker from dotCloud's new repository 2013-08-23 17:58:07 -07:00
Alexander
774b1f3c45 Merge pull request #180 from asm89/add-run-cmd
Add dokku run command to run commands in the app env
2013-08-21 14:47:51 -07:00
Alexander
7b8b8172e8 Add run command to README 2013-08-21 23:46:35 +02:00
Alexander
3e9e6127a7 run-cli -> run, fix help formatting 2013-08-21 00:02:52 +02:00
Alexander
6ead1ab943 Fix that only the output the last plugin command is shown
Plugin "commands" should end with "cat" because the output of each
plugin's command is piped through the next one by pluginhook
2013-08-19 21:22:18 +02:00
Alexander
2563581f49 Update help command 2013-08-18 14:32:14 +02:00
Alexander
c773e52508 Add dokku run-cli command to run commands in the app env 2013-08-18 14:30:16 +02:00
Alexander
4b5b86173f Remove redundant command from dokku-standard plugin 2013-08-18 14:27:38 +02:00
rhy-jot
8359b9613d Merge pull request #179 from kubenstein/master
Remove leading 'remote:' from git output
2013-08-17 13:17:54 -07:00
Jakub Niewczas
0254cb5907 remove leading 'remote:' from git output 2013-08-17 18:29:33 +02:00
rhy-jot
1c27f1b70a Merge pull request #168 from Kloadut/docker-build
Build image from Dockerfile instead of curling S3
2013-08-16 16:23:14 -07:00
Alexander
1751a4ad74 Merge pull request #134 from phaza/patch-1
I want to add env variables to new instances
2013-08-16 15:37:07 -07:00
rhy-jot
dfcb52a079 Merge pull request #178 from asm89/redeploy
Redeploy apps on reboot, fixes #82
2013-08-16 15:06:29 -07:00
Alexander
53395bfa08 Redeploy apps on reboot, fixes #82 2013-08-17 00:04:08 +02:00
rhy-jot
84cf39bf09 Merge pull request #145 from msumpter/patch-2
Added X-Forwarded-For to pass client IP to backend
2013-08-15 21:10:09 -07:00
Alexander
7c4f2fd801 Mention and link plugin page in the readme 2013-08-14 22:27:11 +02:00
Jeff Lindsay
772629279e Merge pull request #173 from rhy-jot/2013-08-13/docker-group
Add git & dokku to the docker group, creating it if it doesn't exist.
2013-08-13 21:31:47 -07:00
rhy-jot
5c0379f2b9 Add git & dokku to the docker group, creating it if it doesn't exist. 2013-08-13 20:23:29 -07:00
Kload
9be10ac2d9 Build image from Dockerfile instead of curl S3 2013-08-11 13:37:47 +02:00
Jeff Lindsay
2dfa0fac64 Merge pull request #146 from alexanderbeletsky/ssl2
issue #138: added wildcard support
2013-08-08 16:51:38 -07:00
Jeff Lindsay
b515ddbf01 Merge pull request #159 from amaltson/patch-2
Link to Heroku node.js sample app
2013-08-08 08:29:18 -07:00
Jeff Lindsay
6ecc94b4a2 Merge pull request #158 from amaltson/patch-1
Fix bootstrap on clean install
2013-08-08 08:28:27 -07:00
Arthur Maltson
d120ef4b13 Link to Heroku node.js sample app
Link to the app so users can easily follow along.
2013-08-08 09:42:00 -04:00
alexanderbeletsky
5ef7b00243 review comment by @rhy-jot 2013-08-08 10:17:39 +03:00
Arthur Maltson
584ad9d6d6 Fix bootstrap on clean install
On a clean Ubuntu 13.04 install, the bootstrap script fails with:
make: apt-add-repository: Command not found
make: *** [docker] Error 127

This happens because 'software-properties-common' needs to be installed.
2013-08-07 23:04:10 -04:00
Jeff Lindsay
bd269aad42 Merge pull request #154 from darkpixel/patch-1
Hint about build packs requiring config files.  Closes GH-141
2013-08-06 12:12:33 -07:00
Aaron C. de Bruyn
6eded2f099 Hint about build packs requiring config files
Add a hint to the README that buildpacks may require special configuration files (such as a Procfile) in order to deploy properly.
2013-08-06 12:01:02 -07:00
Jeff Lindsay
40fa670770 Merge pull request #150 from rhy-jot/master
Use apt to install lxc-docker vs downloading the .deb
2013-08-06 11:08:10 -07:00
rhy-jot
d56db3457b Use apt to install lxc-docker vs downloading the .deb 2013-08-05 13:47:44 -07:00
alexanderbeletsky
9e9cc0c96e issue #138: added wildcard support 2013-08-05 18:17:53 +03:00
Mat Sumpter
2f92d500f8 Added X-Forwarded-For to pass client IP to backend 2013-08-05 09:37:40 -04:00
Jeff Lindsay
7a24561194 Merge pull request #140 from chris-rock/hotfix/git_dependency
Hotfix/git dependency
2013-08-03 12:22:31 -07:00
Christoph Hartmann
ba8a84d422 moved git dependency to Vagrantfile 2013-08-03 09:33:15 +02:00
Jeff Lindsay
9b27a3faf6 Merge pull request #104 from alexanderbeletsky/ssl
issue #101: added ssl configuration
2013-08-02 19:47:34 -07:00
Jeff Lindsay
d26164f536 Merge pull request #132 from alexanderbeletsky/cleanup
No logs from cleanup step
2013-08-02 15:42:37 -07:00
Christoph Hartmann
3a80609166 add missing git dependency 2013-08-02 19:35:14 +02:00
Peter Haza
d3d6486169 I want to add env variables to new instances
I want all my deployments to have access to postgres, thus I'm creating a plugin which sets up a new user with access to a new database (on a postgres server in a different container). I want to expose the database access with an env variable, just like heroku does. To me it looks like release is the best place to put this hook.
2013-08-01 19:26:15 +02:00
alexanderbeletsky
33a3b85674 ssl ciphers config from @rhy-jot 2013-07-31 07:00:46 +03:00
alexanderbeletsky
4f82bc9d9a no logs from cleanup step 2013-07-30 12:50:14 +03:00
Jeff Lindsay
b44bf15c92 Merge pull request #127 from gaaady/patch-1
update readme to ubuntu 64
2013-07-29 18:32:13 -07:00
gaaady
e616da514c update readme to ubuntu 64 2013-07-28 16:24:24 +03:00
Jeff Lindsay
eb189d639c Merge pull request #121 from alexanderbeletsky/cleanup
issue #120 add step to clean up all dead instances and none used images
2013-07-26 08:12:09 -07:00
alexanderbeletsky
84337da262 ignoring all error messages from clean up 2013-07-26 10:47:40 +03:00
alexanderbeletsky
18db1cf7f6 issue #120 add step to clean up all dead instances and none used images 2013-07-26 10:26:05 +03:00
Jeff Lindsay
bb59f47cab Merge pull request #81 from eugeneware/remove_socket_file
Fix for nginx not reloading.
2013-07-24 16:02:29 -07:00
alexanderbeletsky
7f6e6ee8a4 review issues by @progrium 2013-07-24 12:13:50 +03:00
alexanderbeletsky
3bd0f6d3fb issue #101: added ssl configuration
- application folder /ssl is detected and ssl hginx config added
- readme corrections
2013-07-23 22:01:04 +03:00
Jeff Lindsay
a41bf80699 Merge pull request #113 from adelevie/master
fix readme typo (date => data)
2013-07-23 09:05:26 -07:00
Alan deLevie
fa34cb3eff fix readme typo (date => data) 2013-07-23 10:05:46 -04:00
Jeff Lindsay
5c25bd1557 Merge pull request #110 from TJC/enhancement/documentation_improvements
Documentation patch
2013-07-22 22:24:55 -07:00
Toby Corkindale
30d39d0da2 Add documentation on how to remove deployed apps 2013-07-23 15:20:23 +10:00
Toby Corkindale
9ebf453b72 Add docs on how to upgrade build step 2013-07-23 15:15:21 +10:00
Jeff Lindsay
25b04e12cc Merge pull request #109 from rhy-jot/patch-1
Fix typo, change up some wording
2013-07-22 22:08:02 -07:00
rhy-jot
7c6f7232d9 Fix typo, change up some wording 2013-07-22 21:06:09 -07:00
Jeff Lindsay
c4f6393946 Merge pull request #108 from k4ml/fix-readme
Fix #107
2013-07-22 20:34:00 -07:00
k4ml
2edc4e890d Fix #107 2013-07-23 11:22:23 +08:00
Jeff Lindsay
9aa64f4f6c Merge pull request #106 from rhy-jot/patch-1
Use HTTPS for DOCKER_BIN
2013-07-22 12:55:59 -07:00
rhy-jot
8d979b125e Use HTTPS for DOCKER_BIN 2013-07-22 12:51:32 -07:00
Jeff Lindsay
f89430535a Merge pull request #99 from alexanderbeletsky/environment
issue #92: inserting environment file to docker instance
2013-07-20 08:57:11 -07:00
alexanderbeletsky
ad6459a70c corrected after @progrium comments 2013-07-20 09:59:22 +03:00
Jeff Lindsay
6257ebdcfe Merge pull request #86 from eugeneware/domain_support
support for fully qualified domain names not just subdomains
2013-07-19 13:24:00 -07:00
alexanderbeletsky
eef39c30d3 issue #92: inserting environment file to docker instance 2013-07-19 09:17:41 +03:00
Jeff Lindsay
36c4f37ad6 Merge pull request #96 from unclejack/check_if_aufs_is_loaded_first
check if aufs is loaded before running modprobe
2013-07-18 09:05:38 -07:00
unclejack
fef5ee080d check if aufs is loaded before running modprobe 2013-07-18 13:31:55 +03:00
Jeff Lindsay
154d76e314 vagrant file uses local dokku checkout instead of pulling from repo via bootstrap. vagrant no longer uses the bootstrap script 2013-07-16 00:47:57 -07:00
Jeff Lindsay
39b05a1b20 disabling go since its now broken with docker 0.4.8 2013-07-16 00:47:11 -07:00
Jeff Lindsay
c8633db721 docker failed to connect to server immediately after installing, so maybe it needed a moment? 2013-07-16 02:05:34 -05:00
Jeff Lindsay
d160036954 docker 0.4.8 (but really basically 0.5.0) 2013-07-16 01:59:10 -05:00
Eugene Ware
f4cdc94209 don't use fully qualified name if a subdomain of $HOME/VHOST 2013-07-08 21:12:37 +10:00
Eugene Ware
3eadb0ae03 support for fully qualified domain names 2013-07-08 15:50:17 +10:00
Eugene Ware
6c6196fd5a check file exists before removing 2013-07-08 15:07:41 +10:00
Jeff Lindsay
b433626b4e use docker 0.4.8 deb, but 0.4.2 binary. sigh 2013-07-07 18:12:39 -07:00
Jeff Lindsay
3d1c8a30e9 Merge pull request #84 from hwartig/update-docker
Update docker to latest version 0.4.8-1 .
2013-07-07 12:50:38 -07:00
Harald Wartig
3aa6340c06 Update docker to latest version 0.4.8-1 . 2013-07-07 17:44:57 +02:00
Eugene Ware
1f4dab1fd8 make reloader service start on reload 2013-07-07 20:27:23 +10:00
Eugene Ware
ee40473a18 Remove socket file before listening for reload 2013-07-07 20:17:19 +10:00
Jeff Lindsay
ea14fb0543 Merge pull request #77 from asm89/bootstrap
Tune bootstrap/install script and documentation for advanced installation
2013-07-04 22:55:05 -07:00
Alexander
264d196eee Merge remote-tracking branch 'origin/master' into bootstrap
Conflicts:
	README.md
2013-07-05 07:42:01 +02:00
Jeff Lindsay
1f45937abc Merge pull request #71 from ekristen/master
Fixes http host header
2013-07-04 22:29:22 -07:00
Jeff Lindsay
c118c20b36 Merge pull request #75 from interstateone/wget-filename
Change filename used in Advanced Installation section of README
2013-07-04 22:24:42 -07:00
Jeff Lindsay
5493236d7e Merge pull request #79 from ema/master
Set right conf file name in README.md
2013-07-04 12:38:21 -07:00
Emanuele Rocca
bc852395cc Point to the right conf file for domain name
README.md states that the domain name should be set in ~git/DOMAIN. However,
~git/VHOST is the right file for that setting.
2013-07-04 17:01:42 +02:00
Alexander
49f1c444c4 cde -> cd 2013-07-03 09:06:08 +02:00
Alexander
621de7cbd1 We don't want the progrium version here ;) 2013-07-02 23:41:48 +02:00
Alexander
99dcacd991 Tune "Advanced installation" documentation 2013-07-02 23:28:14 +02:00
Alexander
713365f53d Make it possible to override dependency urls 2013-07-02 23:20:45 +02:00
Alexander
5065810bf0 Move copying of plugins to install target 2013-07-02 23:06:35 +02:00
Alexander
eaa486e888 Separate plugin-install command 2013-07-02 23:04:17 +02:00
Brandon Evans
04e0618833 Just use the non-redirected URL instead 2013-07-02 14:32:18 -06:00
Brandon Evans
30bd933e68 Change filename used in Advanced Installation section of README
wget uses the given url to name the downloaded file and doesn't take the redirect into account
2013-07-02 14:21:24 -06:00
Jeff Lindsay
67958431b0 Merge pull request #74 from asm89/patch-4
Fix typo
2013-07-02 12:54:58 -07:00
Alexander
e08aac8b46 Fix typo 2013-07-02 21:53:54 +02:00
Jeff Lindsay
65f1dd7072 Merge pull request #73 from asm89/patch-3
Add progrium/pluginhook to README
2013-07-02 12:52:47 -07:00
Alexander
a3cf19b9b5 Add progrium/pluginhook to README 2013-07-02 21:51:24 +02:00
Erik
a0eb48c32b ensure that the original http_host gets passed in the proxy to the app 2013-07-02 10:20:29 -04:00
Jeff Lindsay
bc249ef5ac lets avoid pointless redundancies 2013-07-02 03:20:29 -05:00
Jeff Lindsay
2dfe1e1b05 refactoring most of bootstrap into makefile. bootstrap supports branch checkouts, and using existing cloned dokku repos 2013-07-02 03:12:43 -05:00
Jeff Lindsay
19a0ee20e7 Merge pull request #70 from rhy-jot/master
Fix placement of my username
2013-07-01 16:58:17 -07:00
rhy-jot
e8e6267114 Fix placement of my username 2013-07-01 16:49:08 -07:00
Jeff Lindsay
ee80167c0c Merge pull request #69 from asm89/authors
Add me to authors and sort
2013-07-01 15:15:38 -07:00
Alexander
bcd3ba3c66 Add me to authors and sort 2013-07-02 00:09:49 +02:00
Jeff Lindsay
5e08d92040 Merge pull request #68 from asm89/vagrant-test-setup
Fix vagrant test setup
2013-07-01 15:09:47 -07:00
Alexander
5653eedac4 Fix vagrant test setup 2013-07-02 00:02:37 +02:00
Jeff Lindsay
407e3f04c4 Merge pull request #65 from asm89/makefile
Create separate copy target in Makefile
2013-07-01 14:32:43 -07:00
Jeff Lindsay
6d8232dc20 Merge pull request #62 from asm89/patch-1
Run apt-get update after adding ppa
2013-07-01 14:15:46 -07:00
Jeff Lindsay
9623b4c474 Merge pull request #64 from asm89/patch-2
Escape variable in nginx post-deploy script
2013-07-01 12:12:47 -07:00
Jeff Lindsay
47ca5bd4e0 Merge pull request #67 from asm89/pre-deploy-hook
[WIP] Add pre-deploy hook
2013-07-01 12:09:05 -07:00
Alexander
cf7a2a00d4 Add pre-deploy hook
Adds a pre-deploy hook passing the name of the app and the image. The
hook allows plugins to setup external resources (such as databases) and
modify the image (running pre-deployment script from the app) before the
application is deployed by dokku.
2013-07-01 13:54:34 +02:00
Alexander
1024492c3d Create separate copy target in Makefile 2013-07-01 11:38:38 +02:00
Alexander
4f07b7af1c Escape variable in nginx post-deploy script
`$http_upgrade` is supposed to be a variable set by nginx. It was now substituted by nothing.
2013-07-01 11:33:23 +02:00
Alexander
e75099d5e0 Run apt-get update after adding ppa 2013-07-01 11:08:46 +02:00
Jeff Lindsay
0b07e4e4e3 more specific line counts 2013-06-30 17:56:02 -05:00
Jeff Lindsay
4ecb13a918 disabling websocket test since its currently broken 2013-06-30 17:55:45 -05:00
Jeff Lindsay
1626b10539 Merge pull request #60 from grigio/master
+ AUTHORS
2013-06-30 15:36:40 -07:00
Luigi Maselli
7b9d180b2d me in AUTHORS 2013-07-01 00:33:01 +02:00
Jeff Lindsay
538925f7f4 Merge pull request #59 from grigio/master
Websocket support in NGINX ( ex: #45 )
2013-06-30 15:11:42 -07:00
Luigi Maselli
4d77b668b4 websocket test init 2013-06-30 23:59:06 +02:00
Luigi Maselli
de906a22aa websocket support in NGINX , see: #45 2013-06-30 23:44:58 +02:00
Jeff Lindsay
60f29cdb18 adding some basic help, also as another example of using plugin hooks 2013-06-30 15:51:41 -05:00
Jeff Lindsay
997d2dd09c only override url if vhost file exists 2013-06-30 12:02:52 -05:00
Jeff Lindsay
071c446315 Merge branch 'dev' 2013-06-30 11:46:11 -05:00
Jeff Lindsay
5c0f7320cf doing it the mike-park way 2013-06-30 11:45:27 -05:00
Jeff Lindsay
c4fd6d620b nginx vhosts as a plugin? 2013-06-30 11:39:05 -05:00
Jeff Lindsay
51dc343630 make sure to not fail 2013-06-30 11:15:13 -05:00
Jeff Lindsay
79b099e401 moving install hook trigger into make install 2013-06-30 11:13:23 -05:00
Jeff Lindsay
6be113f7de using absolute path for plugins 2013-06-30 11:02:40 -05:00
Jeff Lindsay
1ebfc9486a forgot how to use wget 2013-06-30 10:41:47 -05:00
Jeff Lindsay
17953fc5a0 initial attempt at plugins 2013-06-30 10:37:32 -05:00
Jeff Lindsay
98859df6d6 only run travis for master 2013-06-30 10:36:54 -05:00
Jeff Lindsay
c08f3233e9 rolled into dokku 2013-06-30 08:51:28 -05:00
Jeff Lindsay
183d8f6ed3 ppa still 0.4.6, so no luck testing 0.4.7 easily either 2013-06-30 08:50:10 -05:00
Jeff Lindsay
caa03d0554 forgot to offest args vars 2013-06-30 08:36:49 -05:00
Jeff Lindsay
6d2954d11b nope, no luck for testing branches 2013-06-30 08:29:40 -05:00
Jeff Lindsay
3ce4897264 hopefully get travis to test this particular branch 2013-06-30 08:17:34 -05:00
Jeff Lindsay
1ee35cb3b9 fairly major refactoring. consolidating code into dokku script. also, went back to installing docker from ppa 2013-06-30 08:04:50 -05:00
Jeff Lindsay
0d49424c45 source based roadmap file dropped in favor of issue tracked roadmaps. for example: https://github.com/progrium/dokku/issues/55 2013-06-30 02:29:28 -05:00
Jeff Lindsay
7ecdba7387 poor man's retry 2013-06-30 02:27:36 -05:00
Jeff Lindsay
fc396490dd exiting with 7 means could not connect. adding sleep to give container a second to spin up 2013-06-30 01:47:10 -05:00
Jeff Lindsay
65fb3c18c3 irc notifications 2013-06-30 01:30:14 -05:00
Jeff Lindsay
977d1269a7 excellent CI system catching my mistakes 2013-06-30 01:28:32 -05:00
Jeff Lindsay
70be1daec4 removing buildstep submodule and replacing it with the buildstep script that dokku actually uses. the buildstep project is otherwise completely separate other than the artifact it builds (the progrium/buildstep container) 2013-06-30 01:17:32 -05:00
Jeff Lindsay
dc2c4825d8 Update README.md 2013-06-29 16:13:00 -05:00
Jeff Lindsay
d5e264d5b5 Merge pull request #50 from dgryski/master
Fix go test
2013-06-28 17:08:53 -07:00
Damian Gryski
0d6d7cdbed tests: reenable go test 2013-06-24 21:50:46 +02:00
Damian Gryski
601bbc2efd tests: "something" doesn't like the app just being called 'go'
s/go/web/ in the heroku metadata files fixes this test.
2013-06-24 21:45:13 +02:00
Jeff Lindsay
b15b55f4af outputting result from curl for deploy debugging 2013-06-23 18:35:30 -07:00
Jeff Lindsay
964299d167 disabling go app since it is broken atm 2013-06-23 18:13:35 -07:00
Jeff Lindsay
02fa55342b include app name in repo name 2013-06-23 18:04:33 -07:00
Jeff Lindsay
5f1d2c4a3e remove debug output 2013-06-23 17:50:24 -07:00
Jeff Lindsay
0f230c3732 actually copy hidden/dot files. needed for .godir in go app 2013-06-23 17:33:17 -07:00
Jeff Lindsay
ef7ac5bbdb moving test apps into place with proper check_deploy scripts 2013-06-23 17:17:56 -07:00
Jeff Lindsay
67c727a935 testing failure 2013-06-23 16:57:17 -07:00
Jeff Lindsay
5af2055c82 moving around set -e to see if that changes anything 2013-06-23 16:39:00 -07:00
Jeff Lindsay
daebad9b88 should have used ssh-keygen 2013-06-23 16:30:59 -07:00
Jeff Lindsay
28651543ab output key before uploading to inspect it 2013-06-23 15:54:48 -07:00
Jeff Lindsay
2f74fc98c0 try and figure out why it silently fails 2013-06-23 04:15:28 -07:00
Jeff Lindsay
7da64d77c1 capture stderr to show errors on failure 2013-06-23 04:11:59 -07:00
Jeff Lindsay
1184dc39c6 make sure keys are uploaded correctly 2013-06-23 04:03:31 -07:00
Jeff Lindsay
4bd8331ee2 ugh, that line wasn't even necessary 2013-06-23 03:54:18 -07:00
Jeff Lindsay
c5ebc4a5dc ensuring git is configured 2013-06-23 03:45:45 -07:00
Jeff Lindsay
8a884f02f2 using proper template Xs 2013-06-23 03:37:00 -07:00
Jeff Lindsay
7fd8f4e437 a travis script, since its getting a little complex 2013-06-23 03:13:17 -07:00
Jeff Lindsay
5fab0a4c3a fixing file permissions for ssh identity 2013-06-23 02:59:12 -07:00
Jeff Lindsay
e94a9a47c7 use test private key identity 2013-06-23 02:55:38 -07:00
Jeff Lindsay
9d56c54d48 seriously, a typo in my own name... 2013-06-23 02:46:32 -07:00
Jeff Lindsay
9d1f04a9ba secret key has slashes in it, so need a different delimiter 2013-06-23 02:44:35 -07:00
Jeff Lindsay
c3c20716e4 proper quotes for variables to be used 2013-06-23 02:40:59 -07:00
Jeff Lindsay
93f8c5c46b point to .s3cfg in current path 2013-06-23 02:38:06 -07:00
Jeff Lindsay
4ece03abf6 fixes unterminated s command 2013-06-23 02:35:44 -07:00
Jeff Lindsay
79c3c5b85e sudo for apt-get on travis 2013-06-23 02:33:19 -07:00
Jeff Lindsay
946973b060 first pass at fully functional test infrastructure to work with travis ci 2013-06-23 02:31:32 -07:00
Jeff Lindsay
3a6d2c4442 exec bit 2013-06-23 01:14:33 -07:00
Jeff Lindsay
7a1b4be14e debug mode and better waiting for ssh 2013-06-23 01:07:21 -07:00
Jeff Lindsay
4bb66c6c63 some fixes and improvements to bootstrap 2013-06-23 01:05:59 -07:00
Jeff Lindsay
6244d81d0b temporarily requiring name of app as argument 2013-06-23 01:05:34 -07:00
Jeff Lindsay
0cfdcb66e4 use sshcommand to create dokku command user 2013-06-23 01:04:56 -07:00
Jeff Lindsay
6525b87850 will travis like this? 2013-06-22 23:04:43 -07:00
Jeff Lindsay
69c502a019 Merge branch 'master' of https://github.com/progrium/dokku 2013-06-22 22:59:33 -07:00
Jeff Lindsay
bff5342459 travis ci experiment 2013-06-22 22:59:24 -07:00
Jeff Lindsay
92f395dc5f Merge pull request #42 from rhy-jot/master
Run as superuser where appropriate, and fix up an example
2013-06-22 13:03:09 -07:00
rhy-jot
49ce9aa862 Run as superuser where appropriate, and fix up an example.
Pull request #25 introduced pulling the repositories as a normal user
and using sudo to esclate when necessary. This commit fixes broken
examples by adding sudo to the commands that will not work with limited
privileges. This commit also adds ./ to an example where needed.
2013-06-22 12:21:47 -07:00
Jeff Lindsay
dab5b7911b Merge pull request #41 from rnorth/auto_restart
Making docker automatically restart previously running containers
2013-06-22 11:01:45 -07:00
Richard North
e295c46672 Making docker automatically restart previously running containers 2013-06-22 15:53:09 +01:00
Jeff Lindsay
5855c75dd3 dropping ruby dependency and cleaning up a simple if statement 2013-06-21 16:43:02 -07:00
Jeff Lindsay
5fd7ac4fba replacing ruby json parsing 2013-06-21 13:40:59 -07:00
Jeff Lindsay
c3aa085fb3 Merge pull request #38 from fcoury/nginx_config
Enables nginx configuration server_names_hash_bucket_size
2013-06-21 11:46:28 -07:00
Felipe Coury
47c6b87e2b added myself to AUTHORS 2013-06-21 15:44:05 -03:00
Felipe Coury
c058c17f63 enables server_names_hash_bucket_size in nginx 2013-06-21 15:43:56 -03:00
Jeff Lindsay
bc828475e8 Merge pull request #34 from silasb/add-my-self-to-authors
Added myself to AUTHORS
2013-06-21 11:39:18 -07:00
Jeff Lindsay
f25c9eb3c8 Merge pull request #37 from fcoury/bootstrapping
Bootstrapping improvements
2013-06-21 11:33:59 -07:00
Felipe Coury
1f175f7d12 installs docker 0.4.2 instead of the latest available 2013-06-21 15:25:27 -03:00
Felipe Coury
d7a77ed2cd bumped buildstep submodule dependency to latest master 2013-06-21 15:25:05 -03:00
Jeff Lindsay
79a0bc001c Merge pull request #21 from unclejack/fix_bootstrap_script
Fix bootstrap script
2013-06-21 10:06:18 -07:00
silasb
f97fbef82f Added myself to AUTHORS 2013-06-21 08:00:55 -04:00
unclejack
c8baad638e add curl to the list of packages to be installed 2013-06-21 10:51:08 +03:00
unclejack
4634bf68b2 install kernel & python-software-properties separately
The bootstrap script was installing software-properties-common.
The package which contains add-apt-repository is:
python-software-properties

$ apt-file search add-apt-repository
python-software-properties: /usr/bin/add-apt-repository

The kernel failed to install for me in vagrant, so that step should be
done separately to not break the install. The system might already have
a kernel which is fully docker compatible.
2013-06-21 10:50:03 +03:00
Jeff Lindsay
8aad633606 Merge pull request #32 from kornnflake/upstream3
Add myself to authors
2013-06-20 23:16:15 -07:00
Your Name
1ca9e05be7 Add myself to authors 2013-06-21 08:08:01 +02:00
Jeff Lindsay
47aad38840 Merge pull request #31 from fcoury/test_apps
Added test apps for Go, PHP and Python
2013-06-20 23:04:50 -07:00
Felipe Coury
fa9757b784 added python test app 2013-06-21 03:03:17 -03:00
Felipe Coury
f9ffc72f5e added php test app 2013-06-21 03:03:17 -03:00
Felipe Coury
b31ef35ccc added go test app 2013-06-21 03:03:13 -03:00
Jeff Lindsay
e16be6096b Merge pull request #30 from rhy-jot/master
Add myself to authors
2013-06-20 21:15:58 -07:00
rhy-jot
3a724bae85 Add myself to authors 2013-06-20 20:59:43 -07:00
Jeff Lindsay
c6ed38512b Merge pull request #29 from rhy-jot/master
Use HTTPS when fetching external resources
2013-06-20 20:51:18 -07:00
rhy-jot
de78434086 Use HTTPS for DOKKU_STACK and BOX_URI 2013-06-20 20:20:37 -07:00
Jeff Lindsay
7fd0d797ab Merge pull request #26 from frio/master
Explicitly install dnsutils during installation
2013-06-20 17:20:31 -07:00
Jeff Lindsay
d690c5da43 Merge pull request #25 from kornnflake/upstream1
Run bootstrap.sh as super user
2013-06-20 17:19:06 -07:00
frio
f9d594bbe9 Explicitly installs dnsutils when bootstrapping
The dig command at line 19 requires dnsutils.  It's part of
ubuntu-standard, but my VM host doesn't install that by default.
Explicitly depending upon it fixes the installation.
2013-06-21 09:11:35 +12:00
Your Name
19c69a28fa Run bootstrap.sh as super user 2013-06-20 23:08:54 +02:00
Jeff Lindsay
bc29aeadc1 english is harder than code 2013-06-20 09:48:18 -07:00
Jeff Lindsay
a22c55a76b updated mention of supported buildpacks and link to more 2013-06-20 09:47:32 -07:00
Jeff Lindsay
8b7c8ad5eb helpful links 2013-06-19 17:43:51 -07:00
Jeff Lindsay
e5ba03eea0 the responsible thing to do 2013-06-19 17:33:56 -07:00
Jeff Lindsay
4674e83d47 Merge pull request #16 from silasb/master
Fix for JSON with docker inspect
2013-06-19 15:02:53 -07:00
silasb
6035737556 Root is element is an array not a hash 2013-06-19 09:46:25 -04:00
Jeff Lindsay
a2ee3d09b1 download builstep container (aka the stack) by default. it will be fast now 2013-06-17 19:55:45 -07:00
Jeff Lindsay
3e62268b98 hugely updated buildstep 2013-06-15 19:17:08 -07:00
Jeff Lindsay
66d8ff96fa stubbed dokku 2013-06-15 18:23:31 -07:00
Jeff Lindsay
c27dd1b9b8 initial roadmap 2013-06-15 15:19:38 -07:00
101 changed files with 1945 additions and 169 deletions

2
.gitignore vendored
View File

@@ -1 +1,3 @@
.vagrant
.DS_Store
stack.tgz

3
.gitmodules vendored
View File

@@ -1,3 +0,0 @@
[submodule "buildstep"]
path = buildstep
url = https://github.com/progrium/buildstep.git

38
.s3cfg Normal file
View File

@@ -0,0 +1,38 @@
[default]
access_key
secret_key
bucket_location = US
cloudfront_host = cloudfront.amazonaws.com
cloudfront_resource = /2010-07-15/distribution
default_mime_type = binary/octet-stream
delete_removed = False
dry_run = False
encoding = UTF-8
encrypt = False
follow_symlinks = False
force = False
get_continue = False
gpg_command = None
gpg_decrypt = %(gpg_command)s -d --verbose --no-use-agent --batch --yes --passphrase-fd %(passphrase_fd)s -o %(output_file)s %(input_file)s
gpg_encrypt = %(gpg_command)s -c --verbose --no-use-agent --batch --yes --passphrase-fd %(passphrase_fd)s -o %(output_file)s %(input_file)s
gpg_passphrase =
guess_mime_type = True
host_base = s3.amazonaws.com
host_bucket = %(bucket)s.s3.amazonaws.com
human_readable_sizes = False
list_md5 = False
log_target_prefix =
preserve_attrs = True
progress_meter = True
proxy_host =
proxy_port = 0
recursive = False
recv_chunk = 4096
reduced_redundancy = False
send_chunk = 4096
simpledb_host = sdb.amazonaws.com
skip_existing = False
socket_timeout = 300
urlencoding_mode = normal
use_https = False
verbosity = WARNING

16
.travis.yml Normal file
View File

@@ -0,0 +1,16 @@
---
branches:
only:
- master
script:
- echo "StrictHostKeyChecking=no" >> ~/.ssh/config
- export IP=$(curl -s http://dokku-ci.herokuapp.com/hosts | tail -1)
- git config --global user.email "travis-ci@exmaple.com"
- git config --global user.name "Travis CI"
- git checkout --orphan orphan HEAD
- git commit -am 'orphaned'
- git remote add runner ssh://test@$IP:2022/dokku
- sleep 8
- git push runner orphan:master
notifications:
irc: "chat.freenode.net#dokku"

17
AUTHORS
View File

@@ -1,6 +1,19 @@
# This file lists all individuals having contributed content to the repository.
# If you're submitting a patch, please add your name here in alphabetical order as part of the patch.
# This file lists all individuals having contributed content to the repository.
#
Alexander <iam.asm89@gmail.com>
Alexander Beletsky <alexander.beletsky@gmail.com>
Alexis Gavoty <kload@kload.fr>
Felipe Coury <felipe.coury@gmail.com>
Jeff Lindsay <progrium@gmail.com>
Richard North <rich.north@gmail.com>
Jose Diaz-Gonzalez <dokku@josediazgonzalez.com>
Leo Unbekandt <leo@unbekandt.eu>
Ludovic Perrine <jazzzz@gmail.com>
Luigi Maselli <grigio.org@gmail.com>
Martin Weiss <kornnflake@gmail.com>
Paul Lietar <paul@lietar.net>
Rajiv Makhijani <rajiv@blue-tech.org>
rhy-jot <rhy-jot@myeml.net>
Richard North <rich.north@gmail.com>
Sebastian Götte <github@jaseg.net>
Silas Baronda <silas.baronda@gmail.com>

View File

@@ -1,9 +1,30 @@
# History
## 0.3.0 (in progress)
* Added git submodules support
## 0.2.0 (2013-11-24)
* Added DOKKU_TRACE variable for verbose trace information
* Added an installer (for pre-built images)
* Application config (environment variable management)
* Backup/import plugin
* Basic hooks/plugin system
* Cache dir is preserved across builds
* Command to delete an application
* Exposed commands over SSH using sshcommand
* Git handling is moved to a plugin
* Integration test coverage
* Pulled nginx vhosts out into plugin
* Run command
* Separated dokku and buildstep more cleanly
* Uses latest version of Docker again
## 0.1.0 (2013-06-15)
* First release
* Bootstrap script for Ubuntu system
* Basic push / deploy with git
* Hostname support with Nginx
* Support for Java, Ruby, Node.js buildpacks
* Support for Java, Ruby, Node.js buildpacks

View File

@@ -1,7 +1,7 @@
Copyright (C) 2013 Jeff Lindsay
Copyright (C) 2014 Jeff Lindsay
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@@ -1,29 +1,72 @@
GITRECEIVE_URL = https://raw.github.com/progrium/gitreceive/master/gitreceive
SSHCOMMAND_URL = https://raw.github.com/progrium/sshcommand/master/sshcommand
DOKKU_VERSION = master
all: install
SSHCOMMAND_URL ?= https://raw.github.com/progrium/sshcommand/master/sshcommand
PLUGINHOOK_URL ?= https://s3.amazonaws.com/progrium-pluginhook/pluginhook_0.1.0_amd64.deb
STACK_URL ?= https://github.com/progrium/buildstep.git
PREBUILT_STACK_URL ?= https://github.com/progrium/buildstep/releases/download/2014-03-08/2014-03-08_429d4a9deb.tar.gz
DOKKU_ROOT ?= /home/dokku
install: submodule gitreceive sshcommand
.PHONY: all install copyfiles version plugins dependencies sshcommand pluginhook docker aufs stack count
all:
# Type "make install" to install.
install: dependencies stack copyfiles plugins version
copyfiles: addman
cp dokku /usr/local/bin/dokku
cp receiver /home/git/receiver
cp deploystep /home/git/deploystep
cp buildstep/buildstep /home/git/buildstep
cp nginx-app-conf /home/git/nginx-app-conf
cp nginx-reloader.conf /etc/init/nginx-reloader.conf
echo "include /home/git/*/nginx.conf;" > /etc/nginx/conf.d/dokku.conf
mkdir -p /var/lib/dokku/plugins
cp -r plugins/* /var/lib/dokku/plugins
submodule:
git submodule init
git submodule update
addman:
mkdir -p /usr/local/share/man/man1
cp dokku.1 /usr/local/share/man/man1/dokku.1
mandb
gitreceive:
wget -qO /usr/local/bin/gitreceive ${GITRECEIVE_URL}
chmod +x /usr/local/bin/gitreceive
gitreceive init
version:
git describe --tags > ${DOKKU_ROOT}/VERSION 2> /dev/null || echo '~${DOKKU_VERSION} ($(shell date -uIminutes))' > ${DOKKU_ROOT}/VERSION
plugins: pluginhook docker
dokku plugins-install
dependencies: sshcommand pluginhook docker stack
sshcommand:
wget -qO /usr/local/bin/sshcommand ${SSHCOMMAND_URL}
chmod +x /usr/local/bin/sshcommand
sshcommand create dokku /usr/local/bin/dokku
pluginhook:
wget -qO /tmp/pluginhook_0.1.0_amd64.deb ${PLUGINHOOK_URL}
dpkg -i /tmp/pluginhook_0.1.0_amd64.deb
docker: aufs
egrep -i "^docker" /etc/group || groupadd docker
usermod -aG docker dokku
curl https://get.docker.io/gpg | apt-key add -
echo deb http://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list
apt-get update
ifdef DOCKER_VERSION
apt-get install -y lxc-docker-${DOCKER_VERSION}
else
apt-get install -y lxc-docker
endif
sleep 2 # give docker a moment i guess
aufs:
lsmod | grep aufs || modprobe aufs || apt-get install -y linux-image-extra-`uname -r`
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)
else
@docker images | grep progrium/buildstep || curl -L ${PREBUILT_STACK_URL} | gunzip -cd | docker import - progrium/buildstep
endif
count:
cat receiver deploystep bootstrap.sh nginx-app-conf nginx-reloader.conf | wc -l
@echo "Core lines:"
@cat dokku bootstrap.sh | wc -l
@echo "Plugin lines:"
@find plugins -type f | xargs cat | wc -l
@echo "Test lines:"
@find tests -type f | xargs cat | wc -l

166
README.md
View File

@@ -2,102 +2,180 @@
Docker powered mini-Heroku. The smallest PaaS implementation you've ever seen.
[![Build Status](https://travis-ci.org/progrium/dokku.png?branch=master)](https://travis-ci.org/progrium/dokku)
## Requirements
Assumes Ubuntu 13 right now. Ideally have a domain ready to point to your host. It's designed for and is probably
Assumes Ubuntu 13 or 12.04 x64 right now. Ideally have a domain ready to point to your host. It's designed for and is probably
best to use a fresh VM. The bootstrapper will install everything it needs.
**Note: There are known issues with docker and Ubuntu 13.10 ([1](https://github.com/dotcloud/docker/issues/1300), [2](https://github.com/dotcloud/docker/issues/1906)) - use of 12.04 is recommended until these issues are resolved.**
## Installing
$ wget -qO- j.mp/dokku-bootstrap | bash
### Stable
$ wget -qO- https://raw.github.com/progrium/dokku/v0.2.2/bootstrap.sh | sudo DOKKU_TAG=v0.2.2 bash
**Note**: Users on 12.04 will need to run `apt-get install -y python-software-properties` before bootstrapping stable.
### Development
$ wget -qO- https://raw.github.com/progrium/dokku/master/bootstrap.sh | sudo bash
This may take around 5 minutes. Certainly better than the several hours it takes to bootstrap Cloud Foundry.
You may also wish to take a look at the [advanced installation](http://progrium.viewdocs.io/dokku/advanced-installation) document for additional installation options.
## Configuring
Set up a domain and a wildcard domain pointing to that host. Make sure `/home/git/DOMAIN` is set to this domain.
By default it's set to whatever the hostname the host has.
Set up a domain and a wildcard domain pointing to that host. Make sure `/home/dokku/VHOST` is set to this domain. By default it's set to whatever hostname the host has. This file is only created if the hostname can be resolved by dig (`dig +short $(hostname -f)`). Otherwise you have to create the file manually and set it to your preferred domain. If this file still is not present when you push your app, dokku will publish the app with a port number (i.e. `http://example.com:49154` - note the missing subdomain).
You'll have to add a public key associated with a username as it says at the end of the bootstrapper. You'll do something
like this from your local machine:
You'll have to add a public key associated with a username by doing something like this from your local machine:
$ cat ~/.ssh/id_rsa.pub | ssh root@progriumapp.com "gitreceive upload-key progrium"
$ cat ~/.ssh/id_rsa.pub | ssh progriumapp.com "sudo sshcommand acl-add dokku progrium"
That's it!
## Deploy an App
Right now Buildstep supports the Node.js, Ruby, and Java buildpacks. It's not hard to add more, [go add more](https://github.com/progrium/buildstep#adding-buildpacks)! Let's deploy
the Heroku Node.js sample app. All you have to do is add a remote to name the app. It's created on-the-fly.
Now you can deploy apps on your Dokku. Let's deploy the [Heroku Node.js sample app](https://github.com/heroku/node-js-sample). All you have to do is add a remote to name the app. It's created on-the-fly.
$ cd node-js-sample
$ git remote add progrium git@progriumapp.com:node-js-app
$ git remote add progrium dokku@progriumapp.com:node-js-app
$ git push progrium master
Counting objects: 296, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (254/254), done.
Writing objects: 100% (296/296), 193.59 KiB, done.
Total 296 (delta 25), reused 276 (delta 13)
remote: -----> Building node-js-app ...
remote: Node.js app detected
remote: -----> Resolving engine versions
-----> Building node-js-app ...
Node.js app detected
-----> Resolving engine versions
... blah blah blah ...
remote: -----> Application deployed:
remote: http://node-js-app.progriumapp.com
-----> Application deployed:
http://node-js-app.progriumapp.com
You're done!
## Advanced installation (for development)
Dokku only supports deploying from its master branch, so if you'd like to deploy a different local branch use: ```git push progrium <local branch>:master```
The bootstrap script allows source URLs to be overridden to include customizations from your own
repositories. The GITRECEIVE_URL and DOKKU_REPO environment variables
may be set to override the defaults (see the bootstrap.sh script for how these apply). Example:
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)!
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.
## Remote commands
Dokku commands can be run over ssh. Anywhere you would run `dokku <command>`, just run `ssh -t dokku@progriumapp.com <command>`
The `-t` is used to request a pty. It is highly recommended to do so.
To avoid the need to type the `-t` option each time, simply create/modify a section in the `.ssh/config` on the client side, as follows :
Host progriumapp.com
RequestTTY yes
## Run a command in the app environment
It's possible to run commands in the environment of the deployed application:
$ dokku run node-js-app ls -alh
$ dokku run <app> <cmd>
## Plugins
Dokku itself is built out of plugins. Checkout the wiki for information about
creating your own and a list of existing plugins:
https://github.com/progrium/dokku/wiki/Plugins
## Removing a deployed app
SSH onto the server, then execute:
$ dokku delete myapp
## Environment variable management
Typically an application will require some environment variables to run properly. Environment variables may contain private data, such as passwords or API keys, so it is not recommend to store them in your application's repository.
The `config` plugin provides the following commands to manage your variables:
```
config <app> - display the config vars for an app
config:get <app> KEY - display a config value for an app
config:set <app> KEY1=VALUE1 [KEY2=VALUE2 ...] - set one or more config vars
config:unset <app> KEY1 [KEY2 ...] - unset one or more config vars
```
## TLS/SPDY support
Dokku provides easy TLS/SPDY support out of the box. This can be done app-by-app or for all subdomains at once. Note that whenever TLS support is enabled SPDY is also enabled.
### Per App
To enable TLS connection to to one of your applications, copy or symlink the `.crt`/`.pem` and `.key` files into the application's `/home/dokku/:app/tls` folder (create this folder if it doesn't exist) as `server.crt` and `server.key` respectively.
Redeployment of the application will be needed to apply TLS configuration. Once it is redeployed, the application will be accessible by `https://` (redirection from `http://` is applied as well).
### All Subdomains
To enable TLS connections for all your applications at once you will need a wildcard TLS certificate.
To enable TLS across all apps, copy or symlink the `.crt`/`.pem` and `.key` files into the `/home/dokku/tls` folder (create this folder if it doesn't exist) as `server.crt` and `server.key` respectively. Then, enable the certificates by editing `/etc/nginx/conf.d/dokku.conf` and uncommenting these two lines (remove the #):
ssl_certificate /home/dokku/tls/server.crt;
ssl_certificate_key /home/dokku/tls/server.key;
The nginx configuration will need to be reloaded in order for the updated TLS configuration to be applied. This can be done either via the init system or by re-deploying the application. Once TLS is enabled, the application will be accessible by `https://` (redirection from `http://` is applied as well).
**Note**: TLS will not be enabled unless the application's VHOST matches the certificate's name. (i.e. if you have a cert for *.example.com TLS won't be enabled for something.example.org or example.net)
### HSTS Header
The [HSTS header](https://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security) is an HTTP header that can inform browsers that all requests to a given site should be made via HTTPS. dokku does not, by default, enable this header. It is thus left up to you, the user, to enable it for your site.
Beware that if you enable the header and a subsequent deploy of your application results in an HTTP deploy (for whatever reason), the way the header works means that a browser will not attempt to request the HTTP version of your site if the HTTPS version fails.
$ wget j.mp/dokku-bootstrap
$ chmod +x bootstrap.sh
$ DOKKU_REPO=https://github.com/yourusername/dokku.git bootstrap.sh
## Upgrading
Dokku is in active development. You can update the deployment step and the build step separately.
**Note**: If you are upgrading from a revision prior to [27d4bc8c3c](https://github.com/progrium/dokku/commit/27d4bc8c3c19fe580ef3e65f2f85b85101cd83e4), follow the instructions in [this wiki entry](https://github.com/progrium/dokku/wiki/Migrating-to-Dokku-0.2.0).
To update the deploy step (this is updated less frequently):
$ cd ~/dokku
$ git pull origin master
$ make install
More frequently, the build step is updated. This is where the app "stack" lives and where buildpacks
are supported. You can update this by running:
$ cd ~/dokku/buildstep
$ git pull origin master
$ make build
$ sudo make install
Nothing needs to be restarted. Changes will take effect on the next push / deployment.
To update the build step:
$ git clone https://github.com/progrium/buildstep.git
$ cd buildstep
$ git pull origin master
$ sudo make build
This will build a fresh Ubuntu Quantal image, install a number of packages, and
eventually replace the Docker image for buildstep.
## Support
You can use [Github Issues](https://github.com/progrium/dokku/issues), check [Troubleshooting](https://github.com/progrium/dokku/wiki/Troubleshooting) on the wiki, or join us on [freenode in #dokku](https://webchat.freenode.net/?channels=%23dokku)
## Components
* [Docker](https://github.com/dotcloud/docker) - Container runtime and manager
* [Buildstep](https://github.com/progrium/buildstep) - Buildpack builder
* [gitreceive](https://github.com/progrium/gitreceive) - Git push interface
* [pluginhook](https://github.com/progrium/pluginhook) - Shell based plugins and hooks
* [sshcommand](https://github.com/progrium/sshcommand) - Fixed commands over SSH
## Ideas for Improvements
* Custom domain support for apps
* HTTPS support on default domain
* Support more buildpacks (see Buildstep)
* Use dokku as the system user instead of git
* Heroku-ish commands to be run via SSH (like [Dokuen](https://github.com/peterkeen/dokuen#available-app-sub-commands))
Looking to keep codebase as simple and hackable as possible, so try to keep your line count down.
## Things this project won't do
* **Multi-host.** Not a huge leap, but this isn't the project for it. Maybe as Super Dokku.
* **Multitenancy.** It's ready for it, but again, probably for Super Dokku.
* **Multi-host.** Not a huge leap, but this isn't the project for it. Have a look at [Flynn](https://flynn.io/).
* **Multitenancy.** It's ready for it, but again, have a look at [Flynn](https://flynn.io/).
* **Client app.** Given the constraints, running commands remotely via SSH is fine.
## License

19
Vagrantfile vendored
View File

@@ -2,19 +2,32 @@
# vi: set ft=ruby :
BOX_NAME = ENV["BOX_NAME"] || "raring"
BOX_URI = ENV["BOX_URI"] || "http://cloud-images.ubuntu.com/vagrant/raring/current/raring-server-cloudimg-amd64-vagrant-disk1.box"
BOX_URI = ENV["BOX_URI"] || "https://cloud-images.ubuntu.com/vagrant/raring/current/raring-server-cloudimg-amd64-vagrant-disk1.box"
BOX_MEMORY = ENV["BOX_MEMORY"] || "512"
DOKKU_DOMAIN = ENV["DOKKU_DOMAIN"] || "dokku.me"
DOKKU_IP = ENV["DOKKU_IP"] || "10.0.0.2"
PREBUILT_STACK_URL = File.exist?("#{File.dirname(__FILE__)}/stack.tgz") ? 'file:///root/dokku/stack.tgz' : nil
make_cmd = "make install"
if PREBUILT_STACK_URL
make_cmd = "PREBUILT_STACK_URL='#{PREBUILT_STACK_URL}' #{make_cmd}"
end
Vagrant::configure("2") do |config|
config.vm.box = BOX_NAME
config.vm.box_url = BOX_URI
config.vm.provision :shell, :path => "bootstrap.sh"
config.vm.synced_folder File.dirname(__FILE__), "/root/dokku"
config.vm.network :forwarded_port, guest: 80, host: 8080
config.vm.hostname = "#{DOKKU_DOMAIN}"
config.vm.network :private_network, ip: DOKKU_IP
config.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
# Ubuntu's Raring 64-bit cloud image is set to a 32-bit Ubuntu OS type by
# default in Virtualbox and thus will not boot. Manually override that.
vb.customize ["modifyvm", :id, "--ostype", "Ubuntu_64"]
vb.customize ["modifyvm", :id, "--memory", BOX_MEMORY]
end
config.vm.provision :shell, :inline => "apt-get -y install git && cd /root/dokku && #{make_cmd}"
end

View File

@@ -1,19 +1,31 @@
DOKKU_REPO=${DOKKU_REPO:-"https://github.com/progrium/dokku.git"}
#!/usr/bin/env bash
set -eo pipefail
export DEBIAN_FRONTEND=noninteractive
export DOKKU_REPO=${DOKKU_REPO:-"https://github.com/progrium/dokku.git"}
apt-get install -y linux-image-extra-`uname -r` software-properties-common
add-apt-repository -y ppa:dotcloud/lxc-docker
apt-get update && apt-get install -y lxc-docker git ruby nginx make
if ! which apt-get &>/dev/null
then
echo "This installation script requires apt-get. For manual installation instructions, consult https://github.com/progrium/dokku ."
exit 1
fi
cd ~ && git clone ${DOKKU_REPO}
cd dokku && make install
cd buildstep && make build
apt-get update
apt-get install -y git make curl software-properties-common
/etc/init.d/nginx start
start nginx-reloader
[[ `lsb_release -sr` == "12.04" ]] && apt-get install -y python-software-properties
[[ $(dig +short $HOSTNAME) ]] && HOSTFILE=DOMAIN || HOSTFILE=HOSTNAME
echo $HOSTNAME > /home/git/$HOSTFILE
cd ~ && test -d dokku || git clone $DOKKU_REPO
cd dokku
git fetch origin
if [[ -n $DOKKU_BRANCH ]]; then
git checkout origin/$DOKKU_BRANCH
elif [[ -n $DOKKU_TAG ]]; then
git checkout $DOKKU_TAG
fi
make install
echo
echo "Be sure to upload a public key for your user:"
echo " cat ~/.ssh/id_rsa.pub | ssh root@$HOSTNAME \"gitreceive upload-key progrium\""
echo "Almost done! For next steps on configuration:"
echo " https://github.com/progrium/dokku#configuring"

Submodule buildstep deleted from 7853644156

122
contrib/dokku-installer.rb Executable file
View File

@@ -0,0 +1,122 @@
#!/usr/bin/env ruby
require "sinatra"
require "open3"
if ARGV[0] == "onboot"
File.open("/etc/init/dokku-installer.conf", "w") do |f|
f.puts "start on runlevel [2345]"
f.puts "exec #{File.absolute_path(__FILE__)} selfdestruct"
end
File.open("/etc/nginx/conf.d/dokku-installer.conf", "w") do |f|
f.puts "upstream dokku-installer { server 127.0.0.1:2000; }"
f.puts "server {"
f.puts " listen 80;"
f.puts " location / {"
f.puts " proxy_pass http://dokku-installer;"
f.puts " }"
f.puts "}"
end
`rm /etc/nginx/sites-enabled/*`
puts "Installed Upstart service and default Nginx virtualhost for installer to run on boot."
exit
end
version = "v0.2.1"
dokku_root = ENV["DOKKU_ROOT"] || "/home/dokku"
admin_key = `cat /root/.ssh/authorized_keys`.split("\n").first
hostname = `bash -c '[[ $(dig +short $HOSTNAME) ]] && echo $HOSTNAME || curl icanhazip.com'`.strip
template = DATA.read
set :port, 2000
set :environment, :production
disable :protection
get "/" do
ERB.new(template).result binding
end
post "/setup" do
if params[:vhost] == "true"
File.open("#{dokku_root}/VHOST", "w") {|f| f.write params[:hostname] }
else
`rm #{dokku_root}/VHOST`
end
File.open("#{dokku_root}/HOSTNAME", "w") {|f| f.write params[:hostname] }
Open3.capture2("sshcommand acl-add dokku admin", :stdin_data => params[:key])
Thread.new {
`rm /etc/nginx/conf.d/dokku-installer.conf && /etc/init.d/nginx stop && /etc/init.d/nginx start`
`rm /etc/init/dokku-installer.conf && stop dokku-installer`
}.run if ARGV[0] == "selfdestruct"
end
__END__
<html>
<head>
<title>Dokku Setup</title>
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" />
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
</head>
<body>
<div class="container" style="width: 640px;">
<form id="form" role="form">
<h1>Dokku Setup <small><%= version %></small></h1>
<div class="form-group">
<h3><small style="text-transform: uppercase;">Admin Access</small></h3>
<label for="key">Public Key</label><br />
<textarea class="form-control" name="key" rows="7" id="key"><%= admin_key %></textarea>
</div>
<div class="form-group">
<h3><small style="text-transform: uppercase;">Hostname Configuration</small></h3>
<div class="form-group">
<label for="hostname">Hostname</label>
<input class="form-control" type="text" id="hostname" name="hostname" value="<%= hostname %>" />
</div>
<div class="checkbox">
<label><input id="vhost" name="vhost" type="checkbox" value="true"> Use <abbr title="Nginx will be run on port 80 and backend to your apps based on hostname">virtualhost naming</abbr> for apps</label>
</div>
<p>Your app URLs will look like:</p>
<pre id="example">http://hostname:port</pre>
</div>
<button type="button" onclick="setup()" class="btn btn-primary">Finish Setup</button> <span style="padding-left: 20px;" id="result"></span>
</form>
</div>
<div id="error-output"></div>
<script>
function setup() {
if ($.trim($("#key").val()) == "") {
alert("Your admin public key cannot be blank.")
return
}
if ($.trim($("#hostname").val()) == "") {
alert("Your hostname cannot be blank.")
return
}
data = $("#form").serialize()
$("input,textarea,button").prop("disabled", true);
$.post('/setup', data)
.done(function() {
$("#result").html("Success!")
window.location.href = "https://github.com/progrium/dokku#deploy-an-app";
})
.fail(function(data) {
$("#result").html("Something went wrong...")
$("#error-output").html(data.responseText)
});
}
function update() {
if ($("#vhost").is(":checked") && $("#hostname").val().match(/^(\d{1,3}\.){3}\d{1,3}$/)) {
alert("In order to use virtualhost naming, the hostname must not be an IP but a valid domain name.")
$("#vhost").prop('checked', false);
}
if ($("#vhost").is(':checked')) {
$("#example").html("http://&lt;app-name&gt;."+$("#hostname").val())
} else {
$("#example").html("http://"+$("#hostname").val()+":&lt;app-port&gt;")
}
}
$("#vhost").change(update);
$("#hostname").change(update);
update();
</script>
</body>
</html>

View File

@@ -1,25 +0,0 @@
#!/bin/bash
APP="$1"; CONTAINER="$2"
if [[ ! -f "$HOME/$APP/PORT" ]]; then
# First deploy
ID=$(docker run -d -p 5000 -e PORT=5000 $CONTAINER /bin/bash -c "/start web")
echo $ID > "$HOME/$APP/CONTAINER"
PORT=$(docker inspect $ID | ruby -e 'require"json";puts JSON.parse(STDIN.read)["NetworkSettings"]["PortMapping"]["5000"]')
echo $PORT > "$HOME/$APP/PORT"
if [[ -f "$HOME/DOMAIN" ]]; then
HOSTNAME="${APP/\//-}.$(< "$HOME/DOMAIN")"
$HOME/nginx-app-conf ${APP/\//-} $PORT $HOSTNAME > $HOME/$APP/nginx.conf
nc -U $HOME/reload-nginx
else
HOSTNAME="$(< "$HOME/HOSTNAME"):$PORT"
fi
echo $HOSTNAME > "$HOME/$APP/HOSTNAME"
else
# Regular deploy
OLDID=$(< "$HOME/$APP/CONTAINER")
docker kill $OLDID > /dev/null
PORT=$(< "$HOME/$APP/PORT")
ID=$(docker run -d -p ":$PORT" -e "PORT=$PORT" $CONTAINER /bin/bash -c "/start web")
echo $ID > "$HOME/$APP/CONTAINER"
fi

View File

@@ -0,0 +1,38 @@
#Advanced installation
## Development
If you plan on developing dokku, the easiest way to install from your own repository is cloning
the repository and calling the install script. Example:
$ git clone https://github.com/yourusername/dokku.git
$ cd dokku
$ sudo make install
The `Makefile` allows source URLs to be overridden to include customizations from your own
repositories. The `DOCKER_URL`, `PLUGINHOOK_URL`, `SSHCOMMAND_URL` and `STACK_URL`
environment variables may be set to override the defaults (see the `Makefile` for how these
apply). Example:
$ sudo SSHCOMMAND_URL=https://raw.github.com/yourusername/sshcommand/master/gitreceive make install
## Bootstrap a server from your own repository
The bootstrap script allows the dokku repository URL to be overridden to bootstrap a host from
your own clone of dokku using the `DOKKU_REPO` environment variable. Example:
$ wget https://raw.github.com/progrium/dokku/master/bootstrap.sh
$ chmod +x bootstrap.sh
$ sudo DOKKU_REPO=https://github.com/yourusername/dokku.git ./bootstrap.sh
## Custom buildstep build
Dokku ships with a pre-built version of version of the [buildstep] component by
default. If you want to build your own version you can specify that with an env
variable.
$ git clone https://github.com/progrium/dokku.git
$ cd dokku
$ sudo BUILD_STACK=true make install
[buildstep]: https://github.com/progrium/buildstep

3
docs/index.md Normal file
View File

@@ -0,0 +1,3 @@
# Dokku Documentation
Docs go here.

114
dokku Executable file
View File

@@ -0,0 +1,114 @@
#!/usr/bin/env bash
set -eo pipefail
export DOKKU_ROOT=${DOKKU_ROOT:="/home/dokku"}
export PLUGIN_PATH=${PLUGIN_PATH:="/var/lib/dokku/plugins"}
[[ -f $DOKKU_ROOT/dokkurc ]] && source $DOKKU_ROOT/dokkurc
[[ $DOKKU_TRACE ]] && set -x
if [[ $(id -un) != "dokku" && $1 != "plugins-install" ]]; then
sudo -u dokku -H $0 "$@"
exit
fi
case "$1" in
receive)
APP="$2"; IMAGE="dokku/$APP"
echo "-----> Cleaning up ..."
dokku cleanup
echo "-----> Building $APP ..."
cat | dokku build $APP
echo "-----> Releasing $APP ..."
dokku release $APP
echo "-----> Deploying $APP ..."
dokku deploy $APP
echo "=====> Application deployed:"
echo " $(dokku url $APP)"
echo
;;
build)
APP="$2"; IMAGE="dokku/$APP"; CACHE_DIR="$DOKKU_ROOT/$APP/cache"
id=$(cat | docker run -i -a stdin progrium/buildstep /bin/bash -c "mkdir -p /app && tar -xC /app")
test $(docker wait $id) -eq 0
docker commit $id $IMAGE > /dev/null
[[ -d $CACHE_DIR ]] || mkdir $CACHE_DIR
pluginhook pre-build $APP
id=$(docker run -d -v $CACHE_DIR:/cache $IMAGE /build/builder)
docker attach $id
test $(docker wait $id) -eq 0
docker commit $id $IMAGE > /dev/null
pluginhook post-build $APP
;;
release)
APP="$2"; IMAGE="dokku/$APP"
pluginhook pre-release $APP
if [[ -f "$DOKKU_ROOT/$APP/ENV" ]]; then
id=$(cat "$DOKKU_ROOT/$APP/ENV" | docker run -i -a stdin $IMAGE /bin/bash -c "mkdir -p /app/.profile.d && cat > /app/.profile.d/app-env.sh")
test $(docker wait $id) -eq 0
docker commit $id $IMAGE > /dev/null
fi
pluginhook post-release $APP
;;
deploy)
APP="$2"; IMAGE="dokku/$APP"
pluginhook pre-deploy $APP
# kill the app when running
if [[ -f "$DOKKU_ROOT/$APP/CONTAINER" ]]; then
oldid=$(< "$DOKKU_ROOT/$APP/CONTAINER")
docker inspect $oldid &> /dev/null && docker kill $oldid > /dev/null
fi
# start the app
DOCKER_ARGS=$(: | pluginhook docker-args $APP)
id=$(docker run -d -p 5000 -e PORT=5000 $DOCKER_ARGS $IMAGE /bin/bash -c "/start web")
echo $id > "$DOKKU_ROOT/$APP/CONTAINER"
port=$(docker port $id 5000 | sed 's/0.0.0.0://')
echo $port > "$DOKKU_ROOT/$APP/PORT"
echo "http://$(< "$DOKKU_ROOT/HOSTNAME"):$port" > "$DOKKU_ROOT/$APP/URL"
pluginhook post-deploy $APP $port
;;
cleanup)
# delete all non-running container
docker ps -a | grep 'Exit' | awk '{print $1}' | xargs docker rm &> /dev/null &
# delete unused images
docker images | grep '<none>' | awk '{print $3}' | xargs docker rmi &> /dev/null &
;;
plugins)
ls -1 -d $PLUGIN_PATH/*/
;;
plugins-install)
pluginhook install
;;
# temporary hack for https://github.com/progrium/dokku/issues/82
deploy:all)
for app in $(ls -d $DOKKU_ROOT/*/); do
APP=$(basename $app);
dokku deploy $APP
done
;;
help)
cat<<EOF | pluginhook commands help | sort
help Print the list of commands
plugins Print active plugins
plugins-install Install active plugins
EOF
;;
*)
for script in $(ls -d /var/lib/dokku/plugins/*/commands); do
$script "$@"
done
;;
esac

58
dokku.1 Normal file
View File

@@ -0,0 +1,58 @@
.TH DOKKU 1 2014-03-08
.\"Make sure to change that date when you commit a change!
.\"
.SH NAME
dokku \- configure and get information from your dokku installation
.\"
.SH SYNOPSIS
.B dokku
.I <command>
.\"
.SH DESCRIPTION
.B dokku
is a catch-all command to configure your apps,
work with plugins and inspect the current state of your server.
.\"
.SH OPTIONS
.TP
.BI backup:import " file"
Import dokku config files.
.TP
.BI backup:export " file"
Export dokku config files.
.TP
.BI config " <app>"
Display the config vars for an app.
.TP
.BI config:get " <app> KEY"
Display a specific config var for an app.
.TP
.BI config:set " <app> KEY1=VAL1" \fR\ (KEY2=VAL2\ \.\.\.)
Set one or more config vars for an app.
.TP
.BI config:unset " <app> KEY1" \fR\ (KEY2\ \.\.\.)
Remove one or more config vars from an app.
.TP
.BI delete " <app>"
Delete an application.
.TP
.B help
Print the list of commands.
.TP
.B logs \ \fI<app> \fR[\fI-t\fR]
Show the last logs for an application (-t follows)
.TP
.B plugins-install
Install active plugins.
.TP
.B plugins
Print active plugins.
.TP
.BI run " <app> command"
Run a command in the environment of an app.
.TP
.BI url " <app>"
Show the url for an app.
.TP
.B version
Print dokku's version.

View File

@@ -1,10 +0,0 @@
#!/bin/bash
APP="$1"; PORT="$2"; HOSTNAME="$3"
cat<<EOF
upstream $APP { server 127.0.0.1:$PORT; }
server {
listen 80;
server_name $HOSTNAME;
location / { proxy_pass http://$APP; }
}
EOF

View File

@@ -1,4 +0,0 @@
script
echo | sudo -u git nc -l -U /home/git/reload-nginx && /etc/init.d/nginx reload
end script
respawn

View File

@@ -0,0 +1,18 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
VERSION="$1"
IMPORT_DIR="$2"
TARGET_DIR="$3"
APPS="$(< $4 )"
ret=0
for app in $APPS; do
if [[ -d $TARGET_DIR/$app ]]; then
ret=1
echo "Trying to import application $app which already exists." 2>&1
fi
done
exit $ret

View File

@@ -0,0 +1,10 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
VERSION="$1"
BASE_DIR="$2"
cat;
[[ -f $BASE_DIR/.sshcommand ]] && echo "$BASE_DIR/.sshcommand"
[[ -f $BASE_DIR/.ssh/authorized_keys ]] && echo "$BASE_DIR/.ssh/authorized_keys"
[[ -f $BASE_DIR/HOSTNAME ]] && echo "$BASE_DIR/HOSTNAME"
[[ -f $BASE_DIR/VHOST ]] && echo "$BASE_DIR/VHOST"

View File

@@ -0,0 +1,15 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
VERSION="$1"
IMPORT_DIR="$2"
TARGET_DIR="$3"
[[ -f $IMPORT_DIR/.sshcommand ]] && mv $IMPORT_DIR/.sshcommand $TARGET_DIR/.sshcommand
if [[ -f $IMPORT_DIR/.ssh/authorized_keys ]]; then
mkdir -p $TARGET_DIR/.ssh
cat $IMPORT_DIR/.ssh/authorized_keys $TARGET_DIR/.ssh/authorized_keys | uniq > $TARGET_DIR/.ssh/authorized_keys
chmod 0700 $TARGET_DIR/.ssh
chmod 0600 $TARGET_DIR/.ssh/*
fi
[[ -f $IMPORT_DIR/HOSTNAME ]] && mv $IMPORT_DIR/HOSTNAME $TARGET_DIR/HOSTNAME
[[ -f $IMPORT_DIR/VHOST ]] && mv $IMPORT_DIR/VHOST $TARGET_DIR/VHOST

View File

@@ -0,0 +1,97 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
case "$1" in
delete)
if [[ -z $2 ]]; then
echo "Please specify an app to delete"
exit 1
fi
APP="$2"; IMAGE="dokku/$APP";
if [[ ! -d "$DOKKU_ROOT/$APP" ]]; then
echo "App does not exist"
exit 1
fi
pluginhook pre-delete $APP
if [[ -f "$DOKKU_ROOT/$APP/CONTAINER" ]]; then
ID=$(< "$DOKKU_ROOT/$APP/CONTAINER")
docker stop $ID > /dev/null || true
docker rm $ID > /dev/null || true
fi
docker images | grep $IMAGE | awk '{print $3}' | xargs docker rmi &> /dev/null &
pluginhook post-delete $APP
;;
logs)
if [[ -z $2 ]]; then
echo "Please specify an app to run the command on"
exit 1
fi
APP="$2";
if [[ ! -d "$DOKKU_ROOT/$APP" ]]; then
echo "App $APP does not exist"
exit 1
fi
if [[ -f "$DOKKU_ROOT/$APP/CONTAINER" ]]; then
CONTAINER=$(<$DOKKU_ROOT/$APP/CONTAINER)
if [[ $3 == "-t" ]]; then
docker logs --follow $CONTAINER
else
docker logs $CONTAINER | tail -n 100
fi
else
echo "Application's container not found"
fi
;;
run)
if [[ -z $2 ]]; then
echo "Please specify an app to run the command on"
exit 1
fi
APP="$2"; IMAGE="dokku/$APP"
if [[ ! -d "$DOKKU_ROOT/$APP" ]]; then
echo "App $APP does not exist"
exit 1
fi
shift 2
DOCKER_ARGS=$(: | pluginhook docker-args $APP)
docker run -i -t $DOCKER_ARGS $IMAGE /exec "$@"
;;
url)
APP="$2";
if [[ ! -d "$DOKKU_ROOT/$APP" ]]; then
echo "App $APP does not exist"
exit 1
fi
if [[ -f "$DOKKU_ROOT/$APP/URL" ]]; then
echo $(< "$DOKKU_ROOT/$APP/URL")
fi
;;
version)
cat "$DOKKU_ROOT/VERSION" || {
echo "Unable to determine dokku's version" 2>&1
exit 1
}
;;
help)
cat && cat<<EOF
delete <app> Delete an application
logs <app> [-t] Show the last logs for an application (-t follows)
run <app> <cmd> Run a command in the environment of an application
url <app> Show the URL for an application
version Print dokku's version
EOF
;;
esac

View File

@@ -0,0 +1,19 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
if [[ ! -f "$DOKKU_ROOT/HOSTNAME" ]]; then
echo $(hostname -f) > $DOKKU_ROOT/HOSTNAME
fi
# temporary hack for https://github.com/progrium/dokku/issues/82
# redeploys all apps after a reboot
cat<<EOF > /etc/init/dokku-redeploy.conf
description "Dokku app redeploy service"
start on (started docker)
script
sleep 2 # give docker some time
sudo -i -u dokku /usr/local/bin/dokku deploy:all
end script
EOF

View File

@@ -0,0 +1,3 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
[[ -n $1 ]] && rm -r "$DOKKU_ROOT/$1" > /dev/null

View File

@@ -0,0 +1,10 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
APP="$1"
IMAGE=dokku/"$1"
CACHE_DIR="$DOKKU_ROOT/$APP/cache"
docker run -v $CACHE_DIR:/cache $IMAGE find /cache -depth -mindepth 1 -maxdepth 1 -exec rm -Rf {} \;

2
plugins/WARNING Normal file
View File

@@ -0,0 +1,2 @@
Please note that the hooks in Dokku are experimental and are likely to change quite a bit.

94
plugins/backup/commands Executable file
View File

@@ -0,0 +1,94 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
CURRENT_BACKUP_VERSION=1
set -e; case "$1" in
backup:export)
OUTPUT_FILE="$2"
BACKUP_DIR="$DOKKU_ROOT"
BACKUP_TMP_DIR=$(mktemp -d)
BACKUP_TMP_FILE="$BACKUP_TMP_DIR/backup.tar"
: | pluginhook backup-export 1 $BACKUP_DIR | tar -cf $BACKUP_TMP_FILE --files-from -
pushd $BACKUP_DIR > /dev/null
ls -d */ | grep -oE '[^/]+' > "$BACKUP_TMP_DIR/.dokku_backup_apps"
popd > /dev/null
# we want to insert the files in the root of the tar
pushd $BACKUP_TMP_DIR > /dev/null
echo $CURRENT_BACKUP_VERSION > .dokku_backup_version
tar --append -f $BACKUP_TMP_FILE .dokku_backup_version
tar --append -f $BACKUP_TMP_FILE .dokku_backup_apps
popd > /dev/null
# if no file specified, output to stdout
if [[ -z $OUTPUT_FILE ]]; then
cat $BACKUP_TMP_FILE
else
mv $BACKUP_TMP_FILE $OUTPUT_FILE
fi
rm -rf $BACKUP_TMP_DIR
;;
backup:import)
if [[ $2 == "-f" ]]; then
force=true
shift
else
force=false
fi
INPUT_FILE="$2"
[[ -z $INPUT_FILE ]] && INPUT_FILE="-"
BACKUP_TMP_DIR=$(mktemp -d)
tar xf $INPUT_FILE --directory=$BACKUP_TMP_DIR
if [[ ! -f $BACKUP_TMP_DIR/.dokku_backup_version ]]; then
echo "Unable to determine backup version"
exit 1
fi
VERSION=$(< $BACKUP_TMP_DIR/.dokku_backup_version)
if [[ $VERSION -ne 1 ]]; then
echo "Unknown format version $VERSION"
exit 1
fi
echo "Importing a version $VERSION backup..."
BACKUP_ROOT="$BACKUP_TMP_DIR""$DOKKU_ROOT"
TARGET_DIR="$DOKKU_ROOT"
if ! pluginhook backup-check $VERSION "$BACKUP_ROOT" "$TARGET_DIR" "$BACKUP_TMP_DIR/.dokku_backup_apps"; then
if $force; then
echo "-f used. Ignoring warnings."
else
echo "Archive did not pass sanity checks. Use -f to import anyway" >&2
exit 1
fi
fi
# create all the app directories
while read app; do mkdir "$TARGET_DIR/$app"; echo "Imported $app"; done < $BACKUP_TMP_DIR/.dokku_backup_apps
# have the plugins import their stuff
pluginhook backup-import $VERSION "$BACKUP_ROOT" $TARGET_DIR "$BACKUP_TMP_DIR/.dokku_backup_apps"
rm -rf $BACKUP_TMP_DIR
echo "Import complete."
;;
help)
cat && cat<<EOF
backup:export [file] Export dokku configuration files
backup:import [file] Import dokku configuration files
EOF
;;
esac

7
plugins/config/backup-export Executable file
View File

@@ -0,0 +1,7 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
shopt -s nullglob
VERSION="$1"
BASE_DIR="$2"
cat; for i in $BASE_DIR/*/ENV; do echo $i; done

11
plugins/config/backup-import Executable file
View File

@@ -0,0 +1,11 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
shopt -s nullglob
VERSION="$1"
IMPORT_DIR="$2"
TARGET_DIR="$3"
cd $IMPORT_DIR
for file in */ENV; do
cp $file "$TARGET_DIR/$file"
done

174
plugins/config/commands Executable file
View File

@@ -0,0 +1,174 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
# Check if name is specified
if [[ $1 == config ]] || [[ $1 == config:* ]]; then
if [[ -z $2 ]]; then
echo "You must specify an app name"
exit 1
else
APP="$2"
ENV_FILE="$DOKKU_ROOT/$APP/ENV"
# Check if app exists with the same name
if [ ! -d "$DOKKU_ROOT/$APP" ]; then
echo "App $APP does not exist"
exit 1
fi
[ -f $ENV_FILE ] || {
echo "-----> Creating $ENV_FILE"
touch $ENV_FILE
}
fi
fi
config_styled_hash () {
vars=`echo -e "$1"`
longest=""
for word in $vars; do
KEY=`echo $word | cut -d"=" -f1`
if [ ${#KEY} -gt ${#longest} ]; then
longest=$KEY
fi
done
for word in $vars; do
KEY=`echo $word | cut -d"=" -f1`
VALUE=`echo $word | cut -d"=" -f2-`
num_zeros=$((${#longest} - ${#KEY}))
zeros=" "
while [ $num_zeros -gt 0 ]; do
zeros="$zeros "
num_zeros=$(($num_zeros - 1))
done
echo "$KEY:$zeros$VALUE"
done
}
config_restart_app() {
APP="$1";
echo "-----> Releasing $APP ..."
dokku release $APP
echo "-----> Release complete!"
echo "-----> Deploying $APP ..."
dokku deploy $APP
echo "-----> Deploy complete!"
}
case "$1" in
config)
APP="$2"
if [ ! -f $ENV_FILE ] || [ ! -s $ENV_FILE ] ; then
echo "$APP has no config vars"
exit 1
fi
VARS=`cat $ENV_FILE | grep -Eo "export ([a-zA-Z_][a-zA-Z0-9_]*=.*)" | cut -d" " -f2`
for var in "$@"; do
if [[ "$var" == "--shell" ]]; then
echo $VARS
exit 0
fi
done
echo "=== $APP config vars ==="
config_styled_hash "$VARS"
;;
config:get)
if [[ -z $3 ]]; then
echo "Usage: dokku config:get APP KEY"
echo "Must specify KEY."
exit 1
fi
if [ ! -f $ENV_FILE ] || [ ! -s $ENV_FILE ] ; then
exit 1
fi
KEY="$3"
cat $ENV_FILE | grep -Eo "export ([a-zA-Z_][a-zA-Z0-9_]*=.*)" | cut -d" " -f2 | grep "^$KEY=" | cut -d"=" -f2-
;;
config:set)
if [[ -z "${*:3}" ]]; then
echo "Usage: dokku config:set APP KEY1=VALUE1 [KEY2=VALUE2 ...]"
echo "Must specify KEY and VALUE to set."
exit 1
fi
APP="$2"; APP_DIR="$DOKKU_ROOT/$APP"
ENV_ADD=""
ENV_TEMP=`cat "${ENV_FILE}"`
RESTART=false
VARS="${*:3}"
for var in $VARS; do
if [[ $var != *"="* ]]; then
echo "Usage: dokku config:set APP KEY1=VALUE1 [KEY2=VALUE2 ...]"
echo "Must specify KEY and VALUE to set."
exit 1
fi
done
for var in $VARS; do
KEY=`echo ${var} | cut -d"=" -f1`
VALUE=`echo ${var} | cut -d"=" -f2-`
if [[ $KEY == [a-zA-Z_][a-zA-Z0-9_]* ]]; then
RESTART_APP=true
ENV_TEMP=$(echo -e "${ENV_TEMP}" | sed "/^export $KEY=/ d")
ENV_TEMP="${ENV_TEMP}\nexport ${var}"
ENV_ADD=$(echo -e "${ENV_ADD}" | sed "/^$KEY=/ d")
ENV_ADD="${ENV_ADD}\n${var}"
fi
done
if [ $RESTART_APP ]; then
echo "-----> Setting config vars and restarting $APP"
config_styled_hash "$ENV_ADD"
echo -e "$ENV_TEMP" | sed '/^$/d' | sort > $ENV_FILE
config_restart_app $APP
fi
;;
config:unset)
if [[ -z $3 ]]; then
echo "Usage: dokku config:unset APP KEY1 [KEY2 ...]"
echo "Must specify KEY to unset."
exit 1
fi
APP="$2"; APP_DIR="$DOKKU_ROOT/$APP"
ENV_TEMP=`cat "${ENV_FILE}"`
VARS="${*:3}"
for var in $VARS; do
echo "-----> Unsetting $var and restarting $APP"
ENV_TEMP=$(echo -e "${ENV_TEMP}" | sed "/^export $var=/ d")
echo -e "$ENV_TEMP" | sed '/^$/d' | sort > $ENV_FILE
config_restart_app $APP
done
;;
help)
cat && cat<<EOF
config <app> display the config vars for an app
config:get <app> KEY display a config value for an app
config:set <app> KEY1=VALUE1 [KEY2=VALUE2 ...] set one or more config vars
config:unset <app> KEY1 [KEY2 ...] unset one or more config vars
EOF
;;
esac

18
plugins/git/backup-import Executable file
View File

@@ -0,0 +1,18 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
VERSION="$1"
IMPORT_DIR="$2"
TARGET_DIR="$3"
APPS="$4"
while read APP; do
APP_PATH="$TARGET_DIR/$APP";
git init --bare $APP_PATH > /dev/null
PRERECEIVE_HOOK="$APP_PATH/hooks/pre-receive"
cat > $PRERECEIVE_HOOK <<EOF
#!/usr/bin/env bash
set -e; set -o pipefail;
cat | DOKKU_ROOT="$DOKKU_ROOT" dokku git-hook $APP
EOF
chmod +x $PRERECEIVE_HOOK
done < $APPS > /dev/null

61
plugins/git/commands Executable file
View File

@@ -0,0 +1,61 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
git_archive_all() {
APP=$1; REV=$2
TMP_WORK_DIR=$(mktemp -d)
chmod 755 $TMP_WORK_DIR
unset GIT_DIR GIT_WORK_TREE
git clone $DOKKU_ROOT/$APP $TMP_WORK_DIR > /dev/null
pushd $TMP_WORK_DIR > /dev/null
git config advice.detachedHead false
git checkout $REV > /dev/null
git submodule update --init --recursive > /dev/null
find -name .git -prune -exec rm -rf {} \; > /dev/null
tar c .
popd > /dev/null
rm -rf $TMP_WORK_DIR > /dev/null
}
case "$1" in
git-hook)
APP=$2
while read oldrev newrev refname
do
# Only run this script for the master branch. You can remove this
# if block if you wish to run it for others as well.
if [[ $refname = "refs/heads/master" ]] ; then
git_archive_all $APP $newrev | dokku receive $APP | sed -u "s/^/"$'\e[1G'"/"
else
echo $'\e[1G\e[K'"-----> WARNING: deploy did not complete, you must push to master."
echo $'\e[1G\e[K'"-----> for example, try 'git push <dokku> ${refname/refs\/heads\/}:master'"
fi
done
;;
git-*)
APP="$(echo $2 | perl -pe 's/(?<!\\)'\''//g' | sed 's/\\'\''/'\''/g')"
APP_PATH=$DOKKU_ROOT/$APP
if [[ $1 == "git-receive-pack" && ! -d "$APP_PATH/refs" ]]; then
git init --bare $APP_PATH > /dev/null
PRERECEIVE_HOOK="$APP_PATH/hooks/pre-receive"
cat > $PRERECEIVE_HOOK <<EOF
#!/usr/bin/env bash
set -e; set -o pipefail;
cat | DOKKU_ROOT="$DOKKU_ROOT" dokku git-hook $APP
EOF
chmod +x $PRERECEIVE_HOOK
fi
args=$@
git-shell -c "$args"
;;
help)
cat
;;
esac

View File

@@ -0,0 +1,7 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
shopt -s nullglob
VERSION="$1"
BASE_DIR="$2"
cat; for i in $BASE_DIR/*/ssl/server.*; do echo $i; done

View File

@@ -0,0 +1,13 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
shopt -s nullglob
VERSION="$1"
IMPORT_DIR="$2"
TARGET_DIR="$3"
cd $IMPORT_DIR
for file in */ssl/server.*; do
mkdir -p $(dirname $TARGET_DIR$file)
cp $file $TARGET_DIR$file
done

9
plugins/nginx-vhosts/commands Executable file
View File

@@ -0,0 +1,9 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
case "$1" in
help)
cat
;;
esac

36
plugins/nginx-vhosts/install Executable file
View File

@@ -0,0 +1,36 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
# latest stable NGINX 1.4.x with websocket support
add-apt-repository -y ppa:nginx/stable
apt-get update
apt-get install -y nginx dnsutils
if ! grep -q dokku-nginx-reload "/etc/sudoers"; then
touch /etc/sudoers.tmp
cp /etc/sudoers /tmp/sudoers.new
echo "%dokku ALL=(ALL)NOPASSWD:/etc/init.d/nginx reload # dokku-nginx-reload" >> /tmp/sudoers.new
EDITOR="cp /tmp/sudoers.new" visudo
rm /tmp/sudoers.new
fi
cat<<EOF > /etc/nginx/conf.d/dokku.conf
include $DOKKU_ROOT/*/nginx.conf;
ssl_session_cache shared:SSL:20m;
ssl_session_timeout 10m;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-RC4-SHA:ECDHE-RSA-AES128-SHA:AES128-GCM-SHA256:RC4:HIGH:!MD5:!aNULL:!EDH:!CAMELLIA;
ssl_protocols TLSv1.2 TLSv1.1 TLSv1;
ssl_prefer_server_ciphers on;
#ssl_certificate $DOKKU_ROOT/tls/server.crt;
#ssl_certificate_key $DOKKU_ROOT/tls/server.key;
EOF
sed -i 's/# server_names_hash_bucket_size/server_names_hash_bucket_size/' /etc/nginx/nginx.conf
if [[ ! -f "$DOKKU_ROOT/VHOST" ]]; then
[[ $(dig +short $(< "$DOKKU_ROOT/HOSTNAME")) ]] && cp "$DOKKU_ROOT/HOSTNAME" "$DOKKU_ROOT/VHOST"
fi
/etc/init.d/nginx start

View File

@@ -0,0 +1,3 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
sudo /etc/init.d/nginx reload > /dev/null

View File

@@ -0,0 +1,89 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
APP="$1"; PORT="$2"
WILDCARD_SSL="$DOKKU_ROOT/tls"
SSL="$DOKKU_ROOT/$APP/tls"
if [[ -f "$DOKKU_ROOT/VHOST" ]]; then
VHOST=$(< "$DOKKU_ROOT/VHOST")
SUBDOMAIN=${APP/%\.${VHOST}/}
if [[ "$APP" == *.* ]] && [[ "$SUBDOMAIN" == "$APP" ]]; then
hostname="${APP/\//-}"
else
hostname="${APP/\//-}.$VHOST"
fi
if [[ -e "$SSL/server.crt" ]] && [[ -e "$SSL/server.key" ]]; then
SSL_INUSE="$SSL"
SSL_DIRECTIVES=$(cat <<EOF
ssl_certificate $SSL_INUSE/server.crt;
ssl_certificate_key $SSL_INUSE/server.key;
EOF
)
elif [[ -e "$WILDCARD_SSL/server.crt" ]] && [[ -e "$WILDCARD_SSL/server.key" ]] && [[ $hostname = `openssl x509 -in $WILDCARD_SSL/server.crt -noout -subject | tr '/' '\n' | grep CN= | cut -c4-` ]]; then
SSL_INUSE="$WILDCARD_SSL"
SSL_DIRECTIVES=""
fi
# ssl based nginx.conf
if [[ -n "$SSL_INUSE" ]]; then
cat<<EOF > $DOKKU_ROOT/$APP/nginx.conf
upstream $APP { server 127.0.0.1:$PORT; }
server {
listen [::]:80;
listen 80;
server_name $hostname;
return 301 https://\$host\$request_uri;
}
server {
listen [::]:443 ssl spdy;
listen 443 ssl spdy;
server_name $hostname;
$SSL_DIRECTIVES
keepalive_timeout 70;
add_header Alternate-Protocol 443:npn-spdy/2;
location / {
proxy_pass http://$APP;
proxy_http_version 1.1;
proxy_set_header Upgrade \$http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host \$http_host;
proxy_set_header X-Forwarded-Proto \$scheme;
proxy_set_header X-Forwarded-For \$remote_addr;
proxy_set_header X-Forwarded-Port \$server_port;
proxy_set_header X-Request-Start \$msec;
}
}
EOF
echo "https://$hostname" > "$DOKKU_ROOT/$APP/URL"
else
# default nginx.conf
cat<<EOF > $DOKKU_ROOT/$APP/nginx.conf
upstream $APP { server 127.0.0.1:$PORT; }
server {
listen [::]:80;
listen 80;
server_name $hostname;
location / {
proxy_pass http://$APP;
proxy_http_version 1.1;
proxy_set_header Upgrade \$http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host \$http_host;
proxy_set_header X-Forwarded-Proto \$scheme;
proxy_set_header X-Forwarded-For \$remote_addr;
proxy_set_header X-Forwarded-Port \$server_port;
proxy_set_header X-Request-Start \$msec;
}
}
EOF
echo "http://$hostname" > "$DOKKU_ROOT/$APP/URL"
fi
pluginhook nginx-pre-reload $APP
sudo /etc/init.d/nginx reload > /dev/null
fi

View File

@@ -1,14 +0,0 @@
#!/bin/bash
set -e
APP="$1"
CONTAINER="app/$APP"
echo "-----> Building $APP ..."
cat | $HOME/buildstep $CONTAINER
echo "-----> Build complete!"
echo "-----> Deploying $APP ..."
$HOME/deploystep $APP $CONTAINER
echo "-----> Application deployed:"
echo " http://$(< "$HOME/$APP/HOSTNAME")"
echo

View File

@@ -0,0 +1 @@
web: node app.js

View File

@@ -0,0 +1 @@
node websocket demo

View File

@@ -0,0 +1,75 @@
var express = require('express')
, exphbs = require('express3-handlebars')
, http = require('http')
, connect = require('connect')
, io = require('socket.io');
var app = express();
app.engine('handlebars',exphbs({extname: ".html", layoutsDir:"views/", defaultLayout: 'layout'}));
app.set('view engine', 'handlebars');
/* NOTE: We'll need to refer to the sessionStore container later. To
* accomplish this, we'll create our own and pass it to Express
* rather than letting it create its own. */
var sessionStore = new connect.session.MemoryStore();
/* NOTE: We'll need the site secret later too, so let's factor it out.
* The security implications of this are left to the reader. */
var SITE_SECRET = 'I am not wearing any pants';
// app.configure(function(){
// app.set('view engine', 'handlebars');
// // app.set("view options", { layout: false })
// });
app.set('views', __dirname + '/views');
// app.register('.html', require('handlebars'));
/*
* ... skipping some of your app settings ...
*/
app.use(express.bodyParser());
/* NOTE: Pass the cookieParser the site secret. It used to be that
* express.session() got the secret, but in Express 3 that's
* no longer the case. */
app.use(express.cookieParser(SITE_SECRET));
/* NOTE: We'll need to know the key used to store the session, so
* we explicitly define what it should be. Also, we pass in
* our sessionStore container here. */
app.use(express.session({
key: 'express.sid'
, store: sessionStore
}));
app.use(express.static('public'));
/*
* ... skipping the rest of your app settings ...
*/
app.get('/', function(req, res){
res.render('index', {socket_url:"ciaourl"});
});
var server = http.createServer(app);
var app_port = process.env.PORT || 3000;
server.listen(app_port, function(){
console.log("Express server listening on port "+ app_port);
});
/**
* Socket.io
*/
var sio = io.listen(server);
sio.sockets.on('connection', function (socket) {
// temperature
setInterval(function () {
var val = (new Date).getTime();
socket.emit('new value', { val: "I'm a websocket message: "+val });
}, 2000);
});

View File

@@ -0,0 +1,2 @@
#!/bin/bash
set -e; output="$(curl -s -i -N -H \"Connection: Upgrade\" -H \"Upgrade: websocket\" -H \"Host: $1\" -H \"Origin: $1\" $1 -m 2)"; echo $output; test "$output" == "bazingaa"

View File

@@ -0,0 +1,16 @@
{
"name": "node-websocket-app",
"version": "0.0.0",
"description": "a basic webscket demo",
"author": "Luigi Maselli",
"dependencies": {
"express": "3.1.x",
"connect": "*",
"handlebars": "~1.0.9",
"socket.io": "~0.9.13",
"express3-handlebars": "~0.2.3"
},
"engines": {
"node": "0.10.x"
}
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,5 @@
<h2>I'm a static HTTP message</h2>
<h1 id="display">
No messages
</h1>
<p>If you get many GET messages in your console it isn't websocket but socket.io fallback mode</p>

View File

@@ -0,0 +1,25 @@
<html>
<head>
<title>Websocket demo Socket.io</title>
<script src="./socket.io/socket.io.js"></script>
<script src="./jquery.min.js"></script>
</head>
<body>
<script>
$(document).ready(function () {
var socket = io.connect( window.location.origin ); // transparent HTTP / Websocket upgrade
socket.on('new value', function (data) {
console.log("RECV:"+ JSON.stringify(data));
$('#display').html(data.val);
});
});
</script>
{{{body}}}
</body>
</html>

View File

@@ -0,0 +1 @@
web: node web.js

3
tests/apps/config/check_deploy Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/bash
set -e; output="$(curl -s $1)"; echo $output; test "$output" == "config-test"

8
tests/apps/config/post-deploy Executable file
View File

@@ -0,0 +1,8 @@
#!/bin/bash
set -ex;
REMOTE=$1
REPO=$2
ssh $REMOTE config:set $REPO CONFTEST=config-test

12
tests/apps/config/web.js Normal file
View File

@@ -0,0 +1,12 @@
var express = require('express');
var app = express.createServer(express.logger());
app.get('/', function(request, response) {
response.send(process.env.CONFTEST);
});
var port = process.env.PORT || 5000;
app.listen(port, function() {
console.log("Listening on " + port);
});

View File

@@ -0,0 +1 @@
web: node node-js-sample/web.js

View File

@@ -0,0 +1,2 @@
#!/bin/bash
set -e; output="$(curl -s $1)"; echo $output; test "$output" == "Hello World!"

View File

@@ -0,0 +1,11 @@
{
"name": "node-example",
"version": "0.0.1",
"dependencies": {
"express": "~3.3.4"
},
"engines": {
"node": "0.10.x",
"npm": "1.3.x"
}
}

View File

@@ -0,0 +1,2 @@
#!/bin/bash
git submodule add https://github.com/heroku/node-js-sample.git node-js-sample

1
tests/apps/go/.godir Normal file
View File

@@ -0,0 +1 @@
web

1
tests/apps/go/Procfile Normal file
View File

@@ -0,0 +1 @@
web: web

2
tests/apps/go/check_deploy Executable file
View File

@@ -0,0 +1,2 @@
#!/bin/bash
set -e; test "$(curl -s $1)" == "go"

20
tests/apps/go/web.go Normal file
View File

@@ -0,0 +1,20 @@
package main
import (
"fmt"
"net/http"
"os"
)
func main() {
http.HandleFunc("/", hello)
fmt.Println("listening...")
err := http.ListenAndServe(":"+os.Getenv("PORT"), nil)
if err != nil {
panic(err)
}
}
func hello(res http.ResponseWriter, req *http.Request) {
fmt.Fprintln(res, "go")
}

1
tests/apps/java/Procfile Normal file
View File

@@ -0,0 +1 @@
web: java -cp target/classes:target/dependency/* HelloWorld

2
tests/apps/java/check_deploy Executable file
View File

@@ -0,0 +1,2 @@
#!/usr/bin/env bash
set -e; output="$(curl -s $1)"; echo $output; test "$output" == "Hello from Java!"

37
tests/apps/java/pom.xml Normal file
View File

@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<version>1.0-SNAPSHOT</version>
<artifactId>helloworld</artifactId>
<dependencies>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-servlet</artifactId>
<version>7.6.0.v20120127</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals><goal>copy-dependencies</goal></goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@@ -0,0 +1,22 @@
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.*;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.servlet.*;
public class HelloWorld extends HttpServlet {
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
resp.getWriter().print("Hello from Java!\n");
}
public static void main(String[] args) throws Exception{
Server server = new Server(Integer.valueOf(System.getenv("PORT")));
ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS);
context.setContextPath("/");
server.setHandler(context);
context.addServlet(new ServletHolder(new HelloWorld()),"/*");
server.start();
server.join();
}
}

View File

@@ -0,0 +1,3 @@
{
"directory": "static/components"
}

View File

@@ -0,0 +1,3 @@
https://github.com/heroku/heroku-buildpack-ruby
https://github.com/heroku/heroku-buildpack-nodejs
https://github.com/heroku/heroku-buildpack-python

6
tests/apps/multi/.gitignore vendored Normal file
View File

@@ -0,0 +1,6 @@
node_modules
static/components
static/.tmp
.sass-cache
.bundle
.DS_Store

1
tests/apps/multi/.npmrc Normal file
View File

@@ -0,0 +1 @@
unsafe-perm = true

6
tests/apps/multi/Gemfile Normal file
View File

@@ -0,0 +1,6 @@
source "https://rubygems.org"
ruby '1.9.3'
gem 'compass'
gem 'sass-globbing'

View File

@@ -0,0 +1,19 @@
GEM
remote: https://rubygems.org/
specs:
chunky_png (1.3.0)
compass (0.12.3)
chunky_png (~> 1.2)
fssm (>= 0.2.7)
sass (= 3.2.14)
fssm (0.2.10)
sass (3.2.14)
sass-globbing (1.1.0)
sass (>= 3.1)
PLATFORMS
ruby
DEPENDENCIES
compass
sass-globbing

View File

@@ -0,0 +1,43 @@
'use strict';
module.exports = function (grunt) {
require('load-grunt-tasks')(grunt);
grunt.initConfig({
compass: {
options: {
sassDir: 'static/styles',
cssDir: 'static/.tmp/styles',
generatedImagesDir: 'static/.tmp/images/generated',
imagesDir: 'static/images',
javascriptsDir: 'static/scripts',
fontsDir: 'static/styles/fonts',
importPath: 'static/components',
httpImagesPath: '/images',
httpGeneratedImagesPath: '/images/generated',
httpFontsPath: '/styles/fonts',
relativeAssets: false,
assetCacheBuster: false,
bundleExec: true,
raw: 'Sass::Script::Number.precision = 10\n'
},
dist: {
options: {
// generatedImagesDir: '<%= yeoman.dist %>/static/images/generated'
}
},
server: {
options: {
debugInfo: false
}
}
}
});
grunt.registerTask('heroku', [
'compass:server'
]);
};

View File

@@ -0,0 +1 @@
web: python app.py

View File

@@ -0,0 +1,3 @@
This is a sample application to test heroku buildpack multi for integrating with buildstep: https://github.com/progrium/buildstep/pull/75
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.

15
tests/apps/multi/app.py Normal file
View File

@@ -0,0 +1,15 @@
import os
from flask import Flask, render_template
from werkzeug.wsgi import SharedDataMiddleware
app = Flask(__name__)
@app.route('/')
def hello_world():
return render_template('index.html')
app.wsgi_app = SharedDataMiddleware(app.wsgi_app, { '/': os.path.join(os.path.dirname(__file__), 'static') })
app.wsgi_app = SharedDataMiddleware(app.wsgi_app, { '/': os.path.join(os.path.dirname(__file__), 'static/.tmp') })
if __name__ == '__main__':
app.run(host='0.0.0.0', debug=True)

View File

@@ -0,0 +1,20 @@
{
"name": "test-buildpack-multi",
"version": "0.0.0",
"authors": [
"Al Johri <al.johri@gmail.com>"
],
"license": "MIT",
"private": true,
"directory": "static/components",
"ignore": [
"**/.*",
"node_modules",
"statc/components",
"test",
"tests"
],
"dependencies": {
"bootstrap-sass": "twbs/bootstrap-sass#~3.1.1"
}
}

2
tests/apps/multi/check_deploy Executable file
View File

@@ -0,0 +1,2 @@
#!/bin/bash
set -e; curl -s $1 | grep -q "Heroku Multi Buildpack on Dokku"

View File

@@ -0,0 +1,17 @@
{
"name": "test-buildpack-multi",
"version": "0.0.0",
"description": "Test application for heroku multi buildpack.",
"author": "Al Johri",
"license": "ISC",
"dependencies": {
"bower": "~1.2.8",
"grunt": "~0.4.1",
"grunt-cli": "~0.1.13",
"load-grunt-tasks": "~0.2.0",
"grunt-contrib-compass": "~0.6.0"
},
"scripts": {
"postinstall": "./node_modules/bower/bin/bower --allow-root install && ./node_modules/grunt-cli/bin/grunt heroku"
}
}

View File

@@ -0,0 +1 @@
Flask==0.10.1

View File

@@ -0,0 +1,6 @@
// override scss variables within bootsrap by delaring them
// before importing bootstrap
$brand-primary: #428bca !default;
@import "bootstrap-sass/vendor/assets/stylesheets/bootstrap";

View File

@@ -0,0 +1,34 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Sample Webpage</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<link rel="stylesheet" type="text/css" href="/styles/main.css">
<script type="text/javascript" src="/components/bootstap-sass/vendor/assets/javascripts/bootstrap/bootstrap.js"></script>
</head>
<body>
<div class="container">
<div class="row clearfix">
<div class="col-md-12 column">
<div class="jumbotron">
<h1>
Hello, world!
</h1>
<p>
This is a sample website using the Heroku Multi Buildpack on Dokku. It uses the python, ruby, and node buildpacks. The node buildpack is for using bower and grunt. The ruby buildpack is for running compass. And last but not last, the python buildpack is to run the flask application.
</p>
<p>
<a class="btn btn-primary btn-large" href="#">Learn more</a>
</p>
</div>
</div>
</div>
</div>
</body>
</html>

View File

@@ -0,0 +1 @@
web: node web.js

View File

@@ -0,0 +1,2 @@
#!/bin/bash
set -e; output="$(curl -s $1)"; echo $output; test "$output" == "nodejs/express"

View File

@@ -0,0 +1,11 @@
{
"name": "node-example",
"version": "0.0.1",
"dependencies": {
"express": "2.5.x"
},
"engines": {
"node": "0.8.x",
"npm": "1.1.x"
}
}

2
tests/apps/php/check_deploy Executable file
View File

@@ -0,0 +1,2 @@
#!/bin/bash
set -e; output="$(curl -s $1)"; echo $output; test "$output" == "<html><h3>php</h3></html>"

1
tests/apps/php/index.php Normal file
View File

@@ -0,0 +1 @@
<html><?php echo '<h3>php</h3>'; ?></html>

View File

@@ -0,0 +1 @@
web: gunicorn hello:app

View File

@@ -0,0 +1,2 @@
#!/bin/bash
set -e; output="$(curl -s $1)"; echo $output; test "$output" == "python/flask"

View File

@@ -0,0 +1,8 @@
import os
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello():
return 'python/flask'

View File

@@ -0,0 +1,5 @@
Flask==0.9
Jinja2==2.6
Werkzeug==0.8.3
gunicorn==0.17.2

0
tests/apps/static/.nginx Normal file
View File

2
tests/apps/static/check_deploy Executable file
View File

@@ -0,0 +1,2 @@
#!/bin/bash
set -e; output="$(curl -s $1)"; echo $output; test "$output" == "<html><h3>Static Page</h3></html>"

View File

@@ -0,0 +1 @@
<html><h3>Static Page</h3></html>

37
tests/ci/receiver Executable file
View File

@@ -0,0 +1,37 @@
#!/usr/bin/env bash
set -eo pipefail
export PATH=/usr/local/sbin:/usr/sbin:/sbin:/bin:/usr/bin:/usr/local/bin
unset GIT_DIR
if [[ $2 == *dokku* ]]; then
date -uIseconds
rm -rf /tmp/build
mkdir /tmp/build
cd /tmp/build
tar -xf -
echo "-----> Installing dependencies"
DEBIAN_FRONTEND=noninteractive apt-get install -y git make curl software-properties-common
echo "-----> Set hostname to dokku.me"
hostname dokku.me
echo "-----> Enabling tracing"
mkdir -p /home/dokku
echo "export DOKKU_TRACE=1" >> /home/dokku/dokkurc
echo "-----> Running make install"
DEBIAN_FRONTEND=noninteractive make install
echo "-----> Generating keypair..."
echo -e "y\n" | ssh-keygen -f /root/.ssh/id_rsa -t rsa -N ''
echo "-----> Installing SSH public key..."
cat /root/.ssh/id_rsa.pub | sudo sshcommand acl-add dokku test
echo "-----> Intitial SSH connection to populate known_hosts..."
ssh -o StrictHostKeyChecking=no dokku@dokku.me help > /dev/null
echo "-----> Running tests"
cd tests
for app_path in apps/*; do
app=$(basename $app_path)
echo "-----> Running test deploy of $app..."
./test_deploy $app_path dokku.me $FORWARDED_PORT
done
else
echo "-----> Repository invalid."
fi

27
tests/ci/setup.sh Executable file
View File

@@ -0,0 +1,27 @@
#!/usr/bin/env bash
set -eo pipefail
export DEBIAN_FRONTEND=noninteractive
apt-get install -y git make curl
cd /tmp
wget http://j.mp/godeb
tar -zxvf ./godeb
./godeb install 1.1.2
export GOPATH=/root/go
git clone https://github.com/flynn/gitreceive-next.git
cd gitreceive-next && make install
ssh-keygen -f $HOME/.ssh/id_rsa -t rsa -N ''
cat<<EOF > /etc/init/gitreceived.conf
start on runlevel [2345]
exec /usr/local/bin/gitreceived -p 2022 -n /root/.ssh/id_rsa /tmp/receiver
EOF
cat<<EOF > /etc/rc.local
curl https://raw.github.com/progrium/dokku/master/tests/ci/receiver -s > /tmp/receiver
chmod +x /tmp/receiver
EOF

View File

@@ -1 +0,0 @@
web: bin/node web.js

View File

@@ -1,18 +1,19 @@
#!/bin/bash
#!/usr/bin/env bash
set -eo pipefail
KEYNAME="$1"
indent() { sed "s/^/ /"; }
echo "-----> Booting EC2 instance..."
start=$(ec2-run-instances -k $1 ami-f3d1bb9a 2>/dev/null)
start=$(ec2-run-instances -k $1 ami-f3d1bb9a 2>&1 )
if [[ $? > 0 ]]; then
echo "$start"
exit
echo "$start" | indent
exit 3
fi
INSTANCE=$(echo "$start" | awk '/^INSTANCE/ {print $2}')
terminate() {
echo "-----> Terminating $INSTANCE..."
ec2-terminate-instances $INSTANCE &>/dev/null && echo " Shutting down"
}
trap "terminate" EXIT
[[ $NOCLEANUP ]] || trap "terminate" EXIT
sleep 30
status=""
while [[ "$status" != "running" ]]; do
@@ -27,6 +28,17 @@ while [[ "$status" != "running" ]]; do
done
PUBLIC_IP=$(echo "$info" | awk '{print $14}')
echo "-----> Waiting for SSH at $PUBLIC_IP..."
sleep 10
echo "-----> Connecting and running boostrap script..."
cat ../bootstrap.sh | ssh -o "StrictHostKeyChecking=no" ubuntu@$PUBLIC_IP "HOSTNAME=$PUBLIC_IP sudo bash" 2>&1 | indent
while [[ ! $(echo | nc $PUBLIC_IP 22) ]]; do
sleep 5
echo " Waiting..."
done
set -e
echo "-----> Connecting and running bootstrap script..."
cat ../bootstrap.sh | ssh -o "StrictHostKeyChecking=no" ubuntu@$PUBLIC_IP "HOSTNAME=$PUBLIC_IP sudo bash" 2>&1 | indent
echo "-----> Installing SSH public keys..."
cat ~/.ssh/id_rsa.pub | ssh -o "StrictHostKeyChecking=no" ubuntu@$PUBLIC_IP "sudo sshcommand acl-add dokku test" > /dev/null
for app_path in apps/*; do
app=$(basename $app_path)
echo "-----> Running test deploy of $app..."
./test_deploy $app_path $PUBLIC_IP
done

View File

@@ -1,14 +1,26 @@
#!/bin/bash
#!/usr/bin/env bash
set -eo pipefail
SELF=`which $0`
VAGRANT_SSH_PORT=${$VAGRANT_SSH_PORT:-"2222"}
PUBLIC_KEY=${PUBLIC_KEY:-"~/.ssh/id_rsa.pub"}
VAGRANT_SSH_PORT=${VAGRANT_SSH_PORT:-"2222"}
PUBLIC_KEY=${PUBLIC_KEY:-"$HOME/.ssh/id_rsa.pub"}
FORWARDED_PORT=${FORWARDED_PORT:-":8080"}
indent() { sed "s/^/ /"; }
if [[ ! $(cat ~/.ssh/config 2>/dev/null | grep dokku.me) ]]; then
echo "-----> Configuring SSH to use $VAGRANT_SSH_PORT for dokku.me..."
touch ~/.ssh/config
echo "Host dokku.me" >> ~/.ssh/config
echo " Port $VAGRANT_SSH_PORT" >> ~/.ssh/config
echo " RequestTTY yes" >> ~/.ssh/config
fi
echo "-----> Ensuring Vagrant is running..."
cd "$(dirname $SELF)/.." && vagrant up | indent
cat $PUBLIC_KEY | ssh -o "StrictHostKeyChecking=no" -i ~/.vagrant.d/insecure_private_key vagrant@dokku.me "sudo gitreceive upload-key test"
cd "$(dirname $SELF)"
echo "-----> Installing SSH public keys..."
cat $PUBLIC_KEY | ssh -o "StrictHostKeyChecking=no" -i ~/.vagrant.d/insecure_private_key vagrant@dokku.me "sudo sshcommand acl-add dokku test"
for app_path in apps/*; do
app=$(basename $app_path)
echo "-----> Running test deploy of $app..."
./test_deploy $app_path dokku.me $FORWARDED_PORT
done

Some files were not shown because too many files have changed in this diff Show More