Compare commits
136 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1d6d5755d4 | ||
|
|
6fed503024 | ||
|
|
95914d1c13 | ||
|
|
92c18fa664 | ||
|
|
7bd5df0e25 | ||
|
|
9b5abeac4d | ||
|
|
de09260c33 | ||
|
|
7cf28ee01f | ||
|
|
e04b90c416 | ||
|
|
5e1b5b2900 | ||
|
|
416dac6d2b | ||
|
|
9a04104bb9 | ||
|
|
43fe6edb04 | ||
|
|
3a850fa05e | ||
|
|
097bdecfac | ||
|
|
1d4cc0b991 | ||
|
|
3e62b1acce | ||
|
|
c2911c94a8 | ||
|
|
f5a5f7702b | ||
|
|
5f2a5fe2bc | ||
|
|
50208862b2 | ||
|
|
283432f214 | ||
|
|
d1e94f6c91 | ||
|
|
dbb6560b1e | ||
|
|
f3535292b3 | ||
|
|
568902302b | ||
|
|
cddcf997e1 | ||
|
|
f2bd2b8541 | ||
|
|
6bb01404ec | ||
|
|
e8b4bd5a89 | ||
|
|
2695d957ac | ||
|
|
051b286a62 | ||
|
|
67b7fa6263 | ||
|
|
c697c65508 | ||
|
|
85f9bb3aae | ||
|
|
c5c0ae00ba | ||
|
|
0dec01c324 | ||
|
|
3827e38caa | ||
|
|
14a7cac686 | ||
|
|
9322200eae | ||
|
|
ee32b05a36 | ||
|
|
3b41d6d16f | ||
|
|
8aef43b3ae | ||
|
|
e45455b73f | ||
|
|
356acdd08d | ||
|
|
f9b7d5378d | ||
|
|
58d0bc983a | ||
|
|
81aefba305 | ||
|
|
8f5c5d5ae2 | ||
|
|
8025657a38 | ||
|
|
779808f832 | ||
|
|
d3e18d3362 | ||
|
|
606bbda66c | ||
|
|
3706392e65 | ||
|
|
ab7c313411 | ||
|
|
f797ff77f4 | ||
|
|
c2736c7c7a | ||
|
|
af671b2aba | ||
|
|
45b2f87b15 | ||
|
|
3d6727a1b8 | ||
|
|
bf4781a5d7 | ||
|
|
2d48d81d09 | ||
|
|
294b419da5 | ||
|
|
f1bfb3ed3a | ||
|
|
56472bd08c | ||
|
|
e99e2201cb | ||
|
|
5bf1ba7ed7 | ||
|
|
5d014d0a8e | ||
|
|
59f047bb45 | ||
|
|
1b208778f3 | ||
|
|
a6cdae5abf | ||
|
|
50115d3640 | ||
|
|
78d3921a6f | ||
|
|
23d4224beb | ||
|
|
4e0670f1ac | ||
|
|
0bd8d71bb9 | ||
|
|
12ee9bc3e7 | ||
|
|
a991c450be | ||
|
|
a900aa45d6 | ||
|
|
3c8b3cedea | ||
|
|
dec8056ef5 | ||
|
|
784e2cfd5e | ||
|
|
b9b9d6303a | ||
|
|
39912ce5db | ||
|
|
7d8ec62a86 | ||
|
|
8cd4863126 | ||
|
|
7c8feb9e0d | ||
|
|
d6ef5e3447 | ||
|
|
498e250e2e | ||
|
|
7d5e0ba5aa | ||
|
|
a7b8eb5581 | ||
|
|
79788e5690 | ||
|
|
ae61ef3f1e | ||
|
|
1d45ca0cdd | ||
|
|
b4c864bea7 | ||
|
|
01e7f1cdb6 | ||
|
|
0865ff3f79 | ||
|
|
11b126a845 | ||
|
|
605ba27eeb | ||
|
|
8109c9c569 | ||
|
|
9111902542 | ||
|
|
4955f9c600 | ||
|
|
976dc3009c | ||
|
|
0b4b2b29a8 | ||
|
|
e84526490e | ||
|
|
66171551d8 | ||
|
|
f23809e75f | ||
|
|
b967514c55 | ||
|
|
a6c34ddd6f | ||
|
|
8f0e794893 | ||
|
|
68a1d1af38 | ||
|
|
eeff3d52eb | ||
|
|
8aa196c660 | ||
|
|
d9d66c58ab | ||
|
|
155f4e9aba | ||
|
|
1bfbdb449b | ||
|
|
b3ca3368e8 | ||
|
|
04921d6876 | ||
|
|
a915b8888f | ||
|
|
129a5fd33d | ||
|
|
e567ce1a90 | ||
|
|
489f131ffc | ||
|
|
45ec8df7be | ||
|
|
469d1e3f49 | ||
|
|
7ca2f49d78 | ||
|
|
69176d2d9a | ||
|
|
ad030b21d4 | ||
|
|
8c8f5e17f1 | ||
|
|
e0b994c415 | ||
|
|
a12b1e2b56 | ||
|
|
590c5fc017 | ||
|
|
ee5c35dd9d | ||
|
|
42a1363996 | ||
|
|
4ae8cf8180 | ||
|
|
aef3a68d2b | ||
|
|
6ddc7275dd |
@@ -4,3 +4,13 @@ root = true
|
||||
insert_final_newline = true
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[Makefile]
|
||||
insert_final_newline = true
|
||||
indent_style = tab
|
||||
indent_size = 4
|
||||
|
||||
[*.mk]
|
||||
insert_final_newline = true
|
||||
indent_style = tab
|
||||
indent_size = 4
|
||||
|
||||
1
AUTHORS
1
AUTHORS
@@ -4,6 +4,7 @@
|
||||
Alexander <iam.asm89@gmail.com>
|
||||
Alexander Beletsky <alexander.beletsky@gmail.com>
|
||||
Alexis Gavoty <kload@kload.fr>
|
||||
Christian Joudrey <cmallette@gmail.com>
|
||||
Felipe Coury <felipe.coury@gmail.com>
|
||||
Jeff Lindsay <progrium@gmail.com>
|
||||
Jose Diaz-Gonzalez <dokku@josediazgonzalez.com>
|
||||
|
||||
50
HISTORY.md
50
HISTORY.md
@@ -1,5 +1,55 @@
|
||||
# History
|
||||
|
||||
## 0.3.12
|
||||
|
||||
- #846: @michaelhobbs add certificate CN to app VHOST if it's not already
|
||||
- #847: @leonardodino Update bootstrap.sh: new docs url
|
||||
- #849: @cjoudrey Add docs for CHECKS
|
||||
- #850: @michaelhobbs test scala deployment
|
||||
|
||||
## 0.3.11
|
||||
|
||||
- #821: @michaelhobbs use wercker for automated testing
|
||||
- #833: @michaelhobbs auto remove the cache dir cleanup container
|
||||
- #835: @michaelhobbs make sure we match the specific string in VHOST
|
||||
- #838: @michaelhobbs quote build_env vars to allow for spaces in config
|
||||
- #839: @michaelhobbs notify irc on builds
|
||||
- #844: @michaelhobbs build app urls based on wildcard ssl or app ssl
|
||||
|
||||
## 0.3.10
|
||||
|
||||
- #783: @josegonzalez New domains plugin and nginx extension
|
||||
- #818: @michaelhobbs rebuild nginx config on domain change
|
||||
- #827: @michaelhobbs Handle IP only access
|
||||
- #828: @michaelhobbs Display the port for an app when falling back to the ip address
|
||||
|
||||
## 0.3.9
|
||||
|
||||
- #787: @josegonzalez/@michaelhobbs Official user-env-compile plugin
|
||||
- Uses ENV and APP/ENV files
|
||||
- Supports old `BUILD_ENV` files (which are likely in wide-use)
|
||||
- Allows user's to override globals with app-specific configuration
|
||||
- Migrate `$DOKKU_ROOT/BUILD_ENV` to `$DOKKU_ROOT/ENV` if the former exists and the latter does not
|
||||
- Drop `BUILD_ENV` support in favor of just `ENV` via a `mv` command
|
||||
- Add default ENV with `CURL_TIMEOUT` and `CURL_CONNECT_TIMEOUT`
|
||||
- #811: @abossard Increased `server_names_hash_bucket_size` in nginx.conf to 512
|
||||
- #814: @josegonzalez Source files in $DOKKU_ROOT/.dokkurc directory and add `dokku trace` command
|
||||
- #816: @josegonzalez Add documentation for user-env feature
|
||||
|
||||
## 0.3.8
|
||||
|
||||
- #796: @josegonzalez Better vagrant documentation
|
||||
- #801: @joelvh Point users to upgrade guides
|
||||
- #805: @ademuk Fixed import-ssl server.crt/key check
|
||||
- #806: @josegonzalez Dokku pushes now happen as the dokku user, not git. Refs #796
|
||||
- #807: @josegonzalez Write proper nginx conf upon installation. Closes #799
|
||||
- #808: @josegonzalez Ensure makefiles are properly formatted
|
||||
|
||||
## 0.3.7
|
||||
|
||||
- #788: @mmerickel fix apps plugin issues in 0.3.6
|
||||
- #789: @mmerickel do not output message when creating ENV file
|
||||
|
||||
## 0.3.6
|
||||
|
||||
- #782: @josegonzalez Simplified config checking
|
||||
|
||||
16
Makefile
16
Makefile
@@ -3,7 +3,7 @@ DOKKU_VERSION = master
|
||||
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
|
||||
PREBUILT_STACK_URL ?= https://github.com/progrium/buildstep/releases/download/2014-12-16/2014-12-16_42bd9f4aab.tar.gz
|
||||
DOKKU_ROOT ?= /home/dokku
|
||||
PLUGINS_PATH ?= /var/lib/dokku/plugins
|
||||
|
||||
@@ -17,6 +17,8 @@ endif
|
||||
|
||||
.PHONY: all install copyfiles version plugins dependencies sshcommand pluginhook docker aufs stack count dokku-installer vagrant-acl-add vagrant-dokku
|
||||
|
||||
include tests.mk
|
||||
|
||||
all:
|
||||
# Type "make install" to install.
|
||||
|
||||
@@ -27,10 +29,10 @@ copyfiles: addman
|
||||
mkdir -p ${PLUGINS_PATH}
|
||||
find ${PLUGINS_PATH} -mindepth 2 -maxdepth 2 -name '.core' -printf '%h\0' | xargs -0 rm -Rf
|
||||
find plugins/ -mindepth 1 -maxdepth 1 -type d -printf '%f\n' | while read plugin; do \
|
||||
rm -Rf ${PLUGINS_PATH}/$$plugin && \
|
||||
cp -R plugins/$$plugin ${PLUGINS_PATH} && \
|
||||
touch ${PLUGINS_PATH}/$$plugin/.core; \
|
||||
done
|
||||
rm -Rf ${PLUGINS_PATH}/$$plugin && \
|
||||
cp -R plugins/$$plugin ${PLUGINS_PATH} && \
|
||||
touch ${PLUGINS_PATH}/$$plugin/.core; \
|
||||
done
|
||||
|
||||
addman:
|
||||
mkdir -p /usr/local/share/man/man1
|
||||
@@ -72,7 +74,9 @@ endif
|
||||
sleep 2 # give docker a moment i guess
|
||||
|
||||
aufs:
|
||||
ifndef CI
|
||||
lsmod | grep aufs || modprobe aufs || apt-get install -qq -y linux-image-extra-`uname -r` > /dev/null
|
||||
endif
|
||||
|
||||
stack:
|
||||
@echo "Start building buildstep"
|
||||
@@ -91,6 +95,7 @@ count:
|
||||
@find tests -type f | xargs cat | wc -l
|
||||
|
||||
dokku-installer:
|
||||
apt-get install -qq -y ruby
|
||||
test -f /var/lib/dokku/.dokku-installer-created || gem install rack -v 1.5.2 --no-rdoc --no-ri
|
||||
test -f /var/lib/dokku/.dokku-installer-created || gem install rack-protection -v 1.5.3 --no-rdoc --no-ri
|
||||
test -f /var/lib/dokku/.dokku-installer-created || gem install sinatra -v 1.4.5 --no-rdoc --no-ri
|
||||
@@ -105,3 +110,4 @@ vagrant-acl-add:
|
||||
|
||||
vagrant-dokku:
|
||||
vagrant ssh -- "sudo -H -u root bash -c 'dokku $(RUN_ARGS)'"
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Dokku [](https://travis-ci.org/progrium/dokku)
|
||||
# Dokku [](https://app.wercker.com/project/bykey/029900380b7e5f31bbf4392725067769)
|
||||
|
||||
Docker powered mini-Heroku. The smallest PaaS implementation you've ever seen. Sponsored by our friends at [Deis](http://deis.io/).
|
||||
|
||||
@@ -10,7 +10,11 @@ Docker powered mini-Heroku. The smallest PaaS implementation you've ever seen. S
|
||||
|
||||
To install the latest stable version of dokku, you can run the following bootstrapper command:
|
||||
|
||||
$ wget -qO- https://raw.github.com/progrium/dokku/v0.3.6/bootstrap.sh | sudo DOKKU_TAG=v0.3.6 bash
|
||||
$ wget -qO- https://raw.github.com/progrium/dokku/v0.3.12/bootstrap.sh | sudo DOKKU_TAG=v0.3.12 bash
|
||||
|
||||
### Upgrading
|
||||
|
||||
[View the docs for upgrading](http://progrium.viewdocs.io/dokku/upgrading) from an older version of Dokku.
|
||||
|
||||
## Documentation
|
||||
|
||||
|
||||
2
Vagrantfile
vendored
2
Vagrantfile
vendored
@@ -3,7 +3,7 @@
|
||||
|
||||
BOX_NAME = ENV["BOX_NAME"] || "trusty"
|
||||
BOX_URI = ENV["BOX_URI"] || "https://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box"
|
||||
BOX_MEMORY = ENV["BOX_MEMORY"] || "512"
|
||||
BOX_MEMORY = ENV["BOX_MEMORY"] || "1024"
|
||||
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
|
||||
|
||||
@@ -9,16 +9,17 @@ export DOKKU_REPO=${DOKKU_REPO:-"https://github.com/progrium/dokku.git"}
|
||||
|
||||
if ! command -v apt-get &>/dev/null
|
||||
then
|
||||
echo "This installation script requires apt-get. For manual installation instructions, consult https://github.com/progrium/dokku ."
|
||||
echo "This installation script requires apt-get. For manual installation instructions, consult http://progrium.viewdocs.io/dokku/advanced-installation ."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
apt-get update
|
||||
apt-get install -qq -y git make curl software-properties-common man-db
|
||||
|
||||
[[ `lsb_release -sr` == "12.04" ]] && apt-get install -qq -y python-software-properties
|
||||
[[ $(lsb_release -sr) == "12.04" ]] && apt-get install -qq -y python-software-properties
|
||||
|
||||
cd ~ && test -d dokku || git clone $DOKKU_REPO
|
||||
cd ~
|
||||
test -d dokku || git clone $DOKKU_REPO
|
||||
cd dokku
|
||||
git fetch origin
|
||||
|
||||
@@ -32,4 +33,4 @@ make install
|
||||
|
||||
echo
|
||||
echo "Almost done! For next steps on configuration:"
|
||||
echo " https://github.com/progrium/dokku#configuring"
|
||||
echo " http://progrium.viewdocs.io/dokku/installation#user-content-configuring"
|
||||
|
||||
@@ -21,7 +21,7 @@ if ARGV[0] == "onboot"
|
||||
exit
|
||||
end
|
||||
|
||||
version = "v0.3.6"
|
||||
version = "v0.3.12"
|
||||
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
|
||||
|
||||
@@ -4,8 +4,8 @@ Now you can deploy apps on your Dokku. Let's deploy the [Heroku Node.js sample a
|
||||
|
||||
```
|
||||
$ cd node-js-sample
|
||||
$ git remote add progrium dokku@progriumapp.com:node-js-app
|
||||
$ git push progrium master
|
||||
$ git remote add dokku dokku@dokku.me:node-js-app
|
||||
$ git push dokku master
|
||||
Counting objects: 296, done.
|
||||
Delta compression using up to 4 threads.
|
||||
Compressing objects: 100% (254/254), done.
|
||||
@@ -18,12 +18,12 @@ Total 296 (delta 25), reused 276 (delta 13)
|
||||
... blah blah blah ...
|
||||
|
||||
-----> Application deployed:
|
||||
http://node-js-app.progriumapp.com
|
||||
http://node-js-app.dokku.me
|
||||
```
|
||||
|
||||
You're done!
|
||||
|
||||
Dokku only supports deploying from its master branch, so if you'd like to deploy a different local branch use: ```git push progrium <local branch>:master```
|
||||
Dokku only supports deploying from its master branch, so if you'd like to deploy a different local branch use: ```git push dokku <local branch>:master```
|
||||
|
||||
Right now Buildstep supports buildpacks for Node.js, Ruby, Python, [and more](https://github.com/progrium/buildstep#supported-buildpacks). It's not hard to add more, [go add more](https://github.com/progrium/buildstep#adding-buildpacks)!
|
||||
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.
|
||||
@@ -53,38 +53,58 @@ Alternatively, you may push an app to your dokku host with a name like "00-defau
|
||||
|
||||
The name of remote repository is used as the name of application to be deployed, as for example above:
|
||||
|
||||
$ git remote add progrium git@progriumapp.com:node-js-app
|
||||
$ git push progrium master
|
||||
$ git remote add dokku dokku@dokku.me:node-js-app
|
||||
$ git push dokku master
|
||||
|
||||
Is deployed to,
|
||||
|
||||
remote: -----> Application deployed:
|
||||
remote: http://node-js-app.progriumapp.com
|
||||
remote: http://node-js-app.dokku.me
|
||||
|
||||
You can also specify fully qualified names, say `app.progrium.com`, as
|
||||
You can also specify fully qualified names, say `app.dokku.me`, as
|
||||
|
||||
$ git remote add progrium git@progriumapp.com:app.progrium.com
|
||||
$ git push progrium master
|
||||
$ git remote add dokku dokku@dokku.me:app.dokku.me
|
||||
$ git push dokku master
|
||||
|
||||
So, after deployment the application will be available at,
|
||||
|
||||
remote: -----> Application deployed:
|
||||
remote: http://app.progrium.com
|
||||
remote: http://app.dokku.me
|
||||
|
||||
This is in particular useful, then you want to deploy to root domain, as
|
||||
|
||||
$ git remote add progrium git@progriumapp.com:progrium.com
|
||||
$ git push progrium master
|
||||
$ git remote add dokku dokku@dokku.me:dokku.me
|
||||
$ git push dokku master
|
||||
|
||||
... deployment ...
|
||||
|
||||
remote: -----> Application deployed:
|
||||
remote: http://progrium.com
|
||||
remote: http://dokku.me
|
||||
|
||||
# Zero downtime deploy
|
||||
|
||||
Following a deploy Dokku's default behaviour is to switch new traffic over to the new container immediately.
|
||||
|
||||
This can be problematic for applications that take some time to boot up and can lead to `502 Bad Gateway` errors.
|
||||
|
||||
Dokku provides a way to run a set of checks against the new container, and only switch traffic over if all checks complete successfully.
|
||||
|
||||
To specify checks, add a `CHECKS` file to the root of your project directory. This is a text file with one line per check. Empty lines and lines starting with `#` are ignored.
|
||||
|
||||
A check is a relative URL and may be followed by expected content from the page, for example:
|
||||
|
||||
```
|
||||
/about Our Amazing Team
|
||||
```
|
||||
|
||||
Dokku will wait `DOKKU_CHECKS_WAIT` seconds (default: `5`) before running the checks to give server time to start. For shorter/longer wait, change the `DOKKU_CHECKS_WAIT` environment variable.
|
||||
|
||||
Dokku will wait `DOKKU_WAIT_TO_RETIRE` seconds (default: `60`) before stopping the old container such that no existing connections to it are dropped.
|
||||
|
||||
# Removing a deployed app
|
||||
|
||||
SSH onto the server, then execute:
|
||||
|
||||
```bash
|
||||
```shell
|
||||
dokku delete myapp
|
||||
```
|
||||
|
||||
@@ -11,4 +11,6 @@ config:set <app> KEY1=VALUE1 [KEY2=VALUE2 ...] - set one or more config vars
|
||||
config:unset <app> KEY1 [KEY2 ...] - unset one or more config vars
|
||||
```
|
||||
|
||||
The variables are by default available only at run time, i.e. not when the application is being built/compiled. However there are [plugins](http://progrium.viewdocs.io/dokku/plugins) that can change that.
|
||||
The variables are available both at at run time and during the application build/compilation step. You no longer need a `user-env` plugin as Dokku handles this functionality in a way equivalent to how Heroku handles it.
|
||||
|
||||
> Note: Global `BUILD_ENV` files are currently migrated into a global `ENV` file. Configuring your global `ENV` file is manual, and should be considered potentially dangerous as configuration applies to all applications.
|
||||
|
||||
@@ -10,8 +10,8 @@ Ubuntu 14.04 x64 x64. Ideally have a domain ready to point to your host. It's de
|
||||
|
||||
To install the latest stable version of dokku, you can run the following bootstrapper command:
|
||||
|
||||
```bash
|
||||
wget -qO- https://raw.github.com/progrium/dokku/v0.3.6/bootstrap.sh | sudo DOKKU_TAG=v0.3.6 bash
|
||||
```shell
|
||||
wget -qO- https://raw.github.com/progrium/dokku/v0.3.12/bootstrap.sh | sudo DOKKU_TAG=v0.3.12 bash
|
||||
```
|
||||
|
||||
## Configuring
|
||||
@@ -20,7 +20,7 @@ Set up a domain and a wildcard domain pointing to that host. Make sure `/home/do
|
||||
|
||||
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 progriumapp.com "sudo sshcommand acl-add dokku progrium"
|
||||
$ cat ~/.ssh/id_rsa.pub | ssh dokku.me "sudo sshcommand acl-add dokku $USER"
|
||||
|
||||
That's it!
|
||||
|
||||
@@ -28,7 +28,7 @@ That's it!
|
||||
|
||||
### Development via bash script
|
||||
|
||||
```bash
|
||||
```shell
|
||||
wget -qO- https://raw.github.com/progrium/dokku/master/bootstrap.sh | sudo bash
|
||||
```
|
||||
|
||||
@@ -41,7 +41,7 @@ You may also wish to take a look at the [advanced installation](http://progrium.
|
||||
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:
|
||||
|
||||
```bash
|
||||
```shell
|
||||
git clone https://github.com/yourusername/dokku.git
|
||||
cd dokku
|
||||
sudo make install
|
||||
@@ -52,7 +52,7 @@ repositories. The `DOCKER_URL`, `PLUGINHOOK_URL`, `SSHCOMMAND_URL` and `STACK_UR
|
||||
environment variables may be set to override the defaults (see the `Makefile` for how these
|
||||
apply). Example:
|
||||
|
||||
```bash
|
||||
```shell
|
||||
sudo SSHCOMMAND_URL=https://raw.github.com/yourusername/sshcommand/master/sshcommand make install
|
||||
```
|
||||
|
||||
@@ -61,7 +61,7 @@ sudo SSHCOMMAND_URL=https://raw.github.com/yourusername/sshcommand/master/sshcom
|
||||
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:
|
||||
|
||||
```bash
|
||||
```shell
|
||||
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
|
||||
@@ -73,7 +73,7 @@ Dokku ships with a pre-built version of the [buildstep](https://github.com/progr
|
||||
default. If you want to build your own version you can specify that with an env
|
||||
variable.
|
||||
|
||||
```bash
|
||||
```shell
|
||||
git clone https://github.com/progrium/dokku.git
|
||||
cd dokku
|
||||
sudo BUILD_STACK=true make install
|
||||
@@ -110,6 +110,7 @@ sudo BUILD_STACK=true make install
|
||||
# - `BOX_MEMORY`
|
||||
# - `DOKKU_DOMAIN`
|
||||
# - `DOKKU_IP`.
|
||||
cd path/to/dokku
|
||||
vagrant up
|
||||
```
|
||||
|
||||
@@ -140,7 +141,7 @@ Deploy using the following StackScript:
|
||||
|
||||
* Run the following commands:
|
||||
|
||||
```bash
|
||||
```shell
|
||||
apt-get update
|
||||
|
||||
apt-get install lxc wget bsdtar linux-image-extra-$(uname -r)
|
||||
@@ -149,6 +150,6 @@ Deploy using the following StackScript:
|
||||
```
|
||||
* After this, you can install dokku the default way:
|
||||
|
||||
```bash
|
||||
```shell
|
||||
wget -qO- https://raw.github.com/progrium/dokku/master/bootstrap.sh | sudo bash
|
||||
```
|
||||
|
||||
@@ -43,15 +43,39 @@ dokku nginx:import-ssl myapp < archive-of-certs.tar
|
||||
|
||||
This archive should is expanded via `tar xvf`. It should contain `server.crt` and `server.key`.
|
||||
|
||||
## Disabling VHOSTS
|
||||
## Customizing the nginx configuration
|
||||
|
||||
If desired, it is possible to disable vhosts by setting the `NO_VHOST` environment variable:
|
||||
> New as of 0.3.10
|
||||
|
||||
```bash
|
||||
dokku config:set myapp NO_VHOST=1
|
||||
Dokku currently templates out an nginx configuration that is included in the `nginx-vhosts` plugin. If you'd like to provide a custom template for your application, you should copy the existing template - ssl or non-ssl - into your `$DOKKU_ROOT/$APP` directory at the file `nginx.conf.template`.
|
||||
|
||||
For instance - assuming defaults - to customize the nginx template in use for the `myapp` application, create a file at `/home/dokku/myapp/nginx.conf.template` with the following contents:
|
||||
|
||||
```
|
||||
server {
|
||||
listen [::]:80;
|
||||
listen 80;
|
||||
server_name $NOSSL_SERVER_NAME;
|
||||
|
||||
# set a custom header for requests
|
||||
add_header X-Served-By www-ec2-01;
|
||||
|
||||
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;
|
||||
}
|
||||
include $DOKKU_ROOT/$APP/nginx.conf.d/*.conf;
|
||||
}
|
||||
```
|
||||
|
||||
On subsequent deploys, the nginx virtualhost will be discarded. This is useful when deploying internal-facing services that should not be publicly routeable.
|
||||
The above is a sample, http configuration that adds an `X-Served-By` header to requests. The template is manually uploaded this template file and **must** it owned by `dokku:dokku`.
|
||||
|
||||
## Customizing hostnames
|
||||
|
||||
@@ -65,7 +89,7 @@ The `subdomain` is inferred from the pushed application name, while the `domain`
|
||||
|
||||
You can optionally override this in a plugin by implementing the `nginx-hostname` pluginhook. For example, you can reverse the subdomain with the following sample `nginx-hostname` pluginhook:
|
||||
|
||||
```bash
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
@@ -76,3 +100,39 @@ echo "$NEW_SUBDOMAIN.$VHOST"
|
||||
```
|
||||
|
||||
If the `nginx-hostname` has no output, the normal hostname algorithm will be executed.
|
||||
|
||||
You can also use the built-in `domains` plugin to handle:
|
||||
|
||||
### Disabling VHOSTS
|
||||
|
||||
If desired, it is possible to disable vhosts by setting the `NO_VHOST` environment variable:
|
||||
|
||||
```shell
|
||||
dokku config:set myapp NO_VHOST=1
|
||||
```
|
||||
|
||||
On subsequent deploys, the nginx virtualhost will be discarded. This is useful when deploying internal-facing services that should not be publicly routeable.
|
||||
|
||||
### Domains plugin
|
||||
|
||||
> New as of 0.3.10
|
||||
|
||||
The domains plugin allows you to specify custom domains for applications. This plugin is aware of any ssl certificates that are imported via `nginx:import-ssl`. Be aware that setting `NO_VHOST` will override any custom domains.
|
||||
|
||||
Custom domains are also backed up via the built-in `backup` plugin
|
||||
|
||||
```shell
|
||||
# where `myapp` is the name of your app
|
||||
|
||||
# add a domain to an app
|
||||
dokku domains:add myapp example.com
|
||||
|
||||
# list custom domains for app
|
||||
dokku domains myapp
|
||||
|
||||
# clear all custom domains for app
|
||||
dokku domains:clear myapp
|
||||
|
||||
# remove a custom domain from app
|
||||
dokku domains:remove myapp example.com
|
||||
```
|
||||
|
||||
@@ -11,7 +11,7 @@ Let's take a quick look at the current dokku nginx plugin that's shipped with do
|
||||
|
||||
## Installing a plugin
|
||||
|
||||
```bash
|
||||
```shell
|
||||
cd /var/lib/dokku/plugins
|
||||
git clone <git url>
|
||||
dokku plugins-install
|
||||
@@ -32,7 +32,7 @@ If you create your own plugin:
|
||||
|
||||
The below plugin is a dummy `dokku hello` plugin. If your plugin exposes commands, this is a good template for your `commands` file:
|
||||
|
||||
```bash
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
@@ -208,8 +208,6 @@ Note: The following plugins have been supplied by our community and may not have
|
||||
| [SSH Deployment Keys](https://github.com/cedricziel/dokku-deployment-keys)<sup>2</sup> | [cedricziel][] | 2014-01-17: compatible with upstream/master |
|
||||
| [SSH Hostkeys](https://github.com/cedricziel/dokku-hostkeys-plugin)<sup>3</sup> | [cedricziel][] | 2014-01-17: compatible with upstream/master |
|
||||
| [Supply env vars to buildpacks](https://github.com/cameron-martin/dokku-build-env) | [cameron-martin][] | Works with v0.2.3 |
|
||||
| [user-env-compile](https://github.com/musicglue/dokku-user-env-compile)<sup>1</sup> | [musicglue][] | Compatible with dokku master branch |
|
||||
| [user-env-compile](https://github.com/motin/dokku-user-env-compile)<sup>1</sup> | [motin][] | Compatible with 0.2.1 |
|
||||
| [VHOSTS Custom Configuration](https://github.com/neam/dokku-nginx-vhosts-custom-configuration) | [motin][] | Compatible with 0.3.1 |
|
||||
| [Volume (persistent storage)](https://github.com/ohardy/dokku-volume) | [ohardy][] | Compatible with 0.2.0 |
|
||||
|
||||
@@ -218,8 +216,6 @@ Note: The following plugins have been supplied by our community and may not have
|
||||
[98332de]: https://github.com/dyson/dokku-persistent-storage/commit/98332de4b5b640610bee535f4d5260263074e18b
|
||||
[a043e98]: https://github.com/stuartpb/dokku-bind-port/commit/a043e9892f4815b6525c850131e09fd64db5c1fa
|
||||
|
||||
<sup>1</sup> Similar to the heroku-labs feature (see https://devcenter.heroku.com/articles/labs-user-env-compile)
|
||||
|
||||
<sup>2</sup> Adds the possibility to add SSH deployment keys to receive private hosted packages
|
||||
|
||||
<sup>3</sup> Adds the ability to add custom hosts to the containers known_hosts file to be able to ssh them easily (useful with deployment keys)
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
# Remote commands
|
||||
|
||||
Dokku commands can be run over ssh. Anywhere you would run `dokku <command>`, just run `ssh -t dokku@progriumapp.com <command>`
|
||||
Dokku commands can be run over ssh. Anywhere you would run `dokku <command>`, just run `ssh -t dokku@dokku.me <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
|
||||
Host dokku.me
|
||||
RequestTTY yes
|
||||
```
|
||||
|
||||
@@ -13,7 +13,7 @@ RequestTTY yes
|
||||
|
||||
It's possible to run commands in the environment of the deployed application:
|
||||
|
||||
```bash
|
||||
```shell
|
||||
dokku run node-js-app ls -alh
|
||||
dokku run <app> <cmd>
|
||||
```
|
||||
|
||||
@@ -43,11 +43,16 @@ __Solution:__
|
||||
|
||||
The `remote rejected` error does not give enough information. Anything could have failed.
|
||||
|
||||
Create a `/home/dokku/dokkurc` file containing the following :
|
||||
To enable dokku tracing, simply run the following command:
|
||||
|
||||
# Since 0.3.9
|
||||
dokku trace
|
||||
|
||||
In versions older than 0.3.9, you can create a `/home/dokku/dokkurc` file containing the following :
|
||||
|
||||
export DOKKU_TRACE=1
|
||||
|
||||
This will trace all of dokku's activity. If this does not help you create a pastebin or a gist containing the full log, and create an issue.
|
||||
This will trace all of dokku's activity. If this does not help you, create a [gist](https://gist.github.com) containing the full log, and create an issue.
|
||||
|
||||
***
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ Dokku is in active development. You can update the deployment step and the build
|
||||
|
||||
To update the deploy step (this is updated less frequently):
|
||||
|
||||
```bash
|
||||
```shell
|
||||
cd ~/dokku
|
||||
git pull origin master
|
||||
sudo make install
|
||||
@@ -16,7 +16,7 @@ Nothing needs to be restarted. Changes will take effect on the next push / deplo
|
||||
|
||||
To update the build step:
|
||||
|
||||
```bash
|
||||
```shell
|
||||
git clone https://github.com/progrium/buildstep.git
|
||||
cd buildstep
|
||||
git pull origin master
|
||||
@@ -34,7 +34,7 @@ This should be summary of breaking changes between 0.1 and 0.2 version with inst
|
||||
|
||||
software-properties-common is now a dependency for plugins. Before running dokku install script, make sure it is installed.
|
||||
|
||||
```bash
|
||||
```shell
|
||||
> sudo apt-get install software-properties-common
|
||||
```
|
||||
|
||||
|
||||
29
dokku
29
dokku
@@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail
|
||||
shopt -s nullglob
|
||||
|
||||
export DOKKU_DISTRO=${DOKKU_DISTRO:="ubuntu"}
|
||||
export DOKKU_IMAGE=${DOKKU_IMAGE:="progrium/buildstep"}
|
||||
@@ -10,6 +11,7 @@ export DOKKU_NOT_IMPLEMENTED_EXIT=10
|
||||
export DOKKU_VALID_EXIT=0
|
||||
|
||||
[[ -f $DOKKU_ROOT/dokkurc ]] && source $DOKKU_ROOT/dokkurc
|
||||
[[ -d $DOKKU_ROOT/.dokkurc ]] && for f in $DOKKU_ROOT/.dokkurc/*; do source $f; done
|
||||
|
||||
[[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
@@ -20,8 +22,13 @@ fi
|
||||
|
||||
if [[ -n "$SSH_ORIGINAL_COMMAND" ]]; then
|
||||
export -n SSH_ORIGINAL_COMMAND
|
||||
$0 $SSH_ORIGINAL_COMMAND
|
||||
exit $?
|
||||
if [[ $1 =~ config-* ]];then
|
||||
xargs $0 <<<$SSH_ORIGINAL_COMMAND
|
||||
exit $?
|
||||
else
|
||||
$0 $SSH_ORIGINAL_COMMAND
|
||||
exit $?
|
||||
fi
|
||||
fi
|
||||
|
||||
case "$1" in
|
||||
@@ -36,20 +43,20 @@ case "$1" in
|
||||
echo "-----> Deploying $APP ..."
|
||||
dokku deploy $APP
|
||||
echo "=====> Application deployed:"
|
||||
echo " $(dokku url $APP)"
|
||||
dokku urls $APP | sed "s/^/ /"
|
||||
echo
|
||||
;;
|
||||
|
||||
build)
|
||||
APP="$2"; IMAGE="dokku/$APP"; CACHE_DIR="$DOKKU_ROOT/$APP/cache"
|
||||
id=$(cat | docker run -i -a stdin $DOKKU_IMAGE /bin/bash -c "mkdir -p /app && tar -xC /app")
|
||||
test $(docker wait $id) -eq 0
|
||||
test "$(docker wait $id)" -eq 0
|
||||
docker commit $id $IMAGE > /dev/null
|
||||
[[ -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
|
||||
test "$(docker wait $id)" -eq 0
|
||||
docker commit $id $IMAGE > /dev/null
|
||||
pluginhook post-build $APP
|
||||
;;
|
||||
@@ -58,8 +65,8 @@ case "$1" in
|
||||
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
|
||||
id=$(docker run -i -a stdin $IMAGE /bin/bash -c "mkdir -p /app/.profile.d && cat > /app/.profile.d/app-env.sh" < "$DOKKU_ROOT/$APP/ENV")
|
||||
test "$(docker wait $id)" -eq 0
|
||||
docker commit $id $IMAGE > /dev/null
|
||||
fi
|
||||
pluginhook post-release $APP
|
||||
@@ -142,8 +149,8 @@ case "$1" in
|
||||
|
||||
# temporary hack for https://github.com/progrium/dokku/issues/82
|
||||
deploy:all)
|
||||
for app in $(ls -d $DOKKU_ROOT/*/CONTAINER); do
|
||||
APP=$(basename $(dirname $app));
|
||||
for app in $DOKKU_ROOT/*/CONTAINER; do
|
||||
APP=$(basename "$(dirname $app)");
|
||||
dokku deploy $APP
|
||||
done
|
||||
;;
|
||||
@@ -162,7 +169,7 @@ EOF
|
||||
|
||||
*)
|
||||
implemented=0
|
||||
for script in $(ls -d $PLUGIN_PATH/*/commands); do
|
||||
for script in $PLUGIN_PATH/*/commands; do
|
||||
set +e; $script "$@" ; exit_code=$? ; set -e
|
||||
if [ "$exit_code" -eq "$DOKKU_NOT_IMPLEMENTED_EXIT" ]; then
|
||||
continue
|
||||
@@ -175,7 +182,7 @@ EOF
|
||||
done
|
||||
|
||||
if [ "$implemented" -eq 0 ]; then
|
||||
echo " ! \`$@\` is not a dokku command."
|
||||
echo " ! \`$*\` is not a dokku command."
|
||||
echo " ! See \`dokku help\` for a list of available commands."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -8,7 +8,7 @@ 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
|
||||
cat $IMPORT_DIR/.ssh/authorized_keys $TARGET_DIR/.ssh/authorized_keys | uniq > tmpfile && mv tmpfile $TARGET_DIR/.ssh/authorized_keys
|
||||
chmod 0700 $TARGET_DIR/.ssh
|
||||
chmod 0600 $TARGET_DIR/.ssh/*
|
||||
fi
|
||||
|
||||
@@ -2,6 +2,24 @@
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
case "$1" in
|
||||
trace)
|
||||
[[ -d $DOKKU_ROOT/.dokkurc ]] || mkdir -p $DOKKU_ROOT/.dokkurc
|
||||
[[ "$2" == "on" ]] || [[ "$2" == "off" ]] || {
|
||||
echo "Valid trace options are [on/off]"
|
||||
exit 1
|
||||
}
|
||||
|
||||
if [[ "$2" == "on" ]]; then
|
||||
echo "Enabling dokku trace"
|
||||
echo "export DOKKU_TRACE=1" > $DOKKU_ROOT/.dokkurc/DOKKU_TRACE
|
||||
fi
|
||||
|
||||
if [[ "$2" == "off" ]]; then
|
||||
echo "Disabling dokku trace"
|
||||
rm -f $DOKKU_ROOT/.dokkurc/DOKKU_TRACE
|
||||
fi
|
||||
;;
|
||||
|
||||
delete)
|
||||
dokku apps:destroy $2
|
||||
;;
|
||||
@@ -34,13 +52,30 @@ case "$1" in
|
||||
docker run -i -t $DOCKER_ARGS $IMAGE /exec "$@"
|
||||
;;
|
||||
|
||||
url)
|
||||
url | urls)
|
||||
[[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1
|
||||
[[ ! -d "$DOKKU_ROOT/$2" ]] && echo "App $2 does not exist" && exit 1
|
||||
APP="$2";
|
||||
APP="$2"; SCHEME="http"; SSL="$DOKKU_ROOT/$APP/tls"; WILDCARD_SSL="$DOKKU_ROOT/tls"
|
||||
|
||||
if [[ -f "$DOKKU_ROOT/$APP/URL" ]]; then
|
||||
echo $(< "$DOKKU_ROOT/$APP/URL")
|
||||
if [[ -e "$SSL/server.crt" && -e "$SSL/server.key" ]] || [[ -e "$WILDCARD_SSL/server.crt" && -e "$WILDCARD_SSL/server.key" ]]; then
|
||||
SCHEME="https"
|
||||
fi
|
||||
|
||||
if [[ -f "$DOKKU_ROOT/$APP/VHOST" ]]; then
|
||||
case "$1" in
|
||||
url)
|
||||
echo "$SCHEME://$(head -n1 "$DOKKU_ROOT/$APP/VHOST")"
|
||||
;;
|
||||
urls)
|
||||
for vhost in $(< "$DOKKU_ROOT/$APP/VHOST"); do
|
||||
echo "$SCHEME://$vhost"
|
||||
done
|
||||
;;
|
||||
esac
|
||||
elif [[ -f "$DOKKU_ROOT/VHOST" ]]; then
|
||||
echo "$SCHEME://$(< "$DOKKU_ROOT/VHOST")"
|
||||
else
|
||||
echo "$SCHEME://$(< "$DOKKU_ROOT/HOSTNAME"):$(< "$DOKKU_ROOT/$APP/PORT")"
|
||||
fi
|
||||
;;
|
||||
|
||||
@@ -55,7 +90,8 @@ case "$1" in
|
||||
cat && cat<<EOF
|
||||
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
|
||||
url <app> Show the first URL for an application (compatibility)
|
||||
urls <app> Show all URLs for an application
|
||||
version Print dokku's version
|
||||
EOF
|
||||
;;
|
||||
|
||||
@@ -2,7 +2,11 @@
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
if [[ ! -f "$DOKKU_ROOT/HOSTNAME" ]]; then
|
||||
echo $(hostname -f) > $DOKKU_ROOT/HOSTNAME
|
||||
hostname -f > $DOKKU_ROOT/HOSTNAME
|
||||
fi
|
||||
|
||||
if [[ ! -f "$DOKKU_ROOT/VHOST" ]]; then
|
||||
[[ $(dig +short "$(< "$DOKKU_ROOT/HOSTNAME")") ]] && cp "$DOKKU_ROOT/HOSTNAME" "$DOKKU_ROOT/VHOST"
|
||||
fi
|
||||
|
||||
# temporary hack for https://github.com/progrium/dokku/issues/82
|
||||
|
||||
@@ -4,12 +4,12 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
case "$1" in
|
||||
apps)
|
||||
echo "=== My Apps"
|
||||
find $DOKKU_ROOT -maxdepth 1 -type d \( ! -iname ".*" \) -not -path $DOKKU_ROOT/tls | sed 's|^\./||g' | sed 's|'$DOKKU_ROOT'\/||' | tail -n +2 | sort
|
||||
find $DOKKU_ROOT -follow -maxdepth 1 -type d \( ! -iname ".*" \) -not -path $DOKKU_ROOT/tls | sed 's|^\./||g' | sed 's|'$DOKKU_ROOT'\/||' | tail -n +2 | sort
|
||||
;;
|
||||
|
||||
apps:create)
|
||||
[[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1
|
||||
[[ -d "$DOKKU_ROOT/$APP" ]] && echo " ! Name is already taken" && exit 1
|
||||
[[ -d "$DOKKU_ROOT/$2" ]] && echo " ! Name is already taken" && exit 1
|
||||
APP="$2"
|
||||
|
||||
mkdir -p "$DOKKU_ROOT/$APP"
|
||||
|
||||
@@ -3,5 +3,5 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
APP="$1"; IMAGE="dokku/$APP"; CACHE_DIR="$DOKKU_ROOT/$APP/cache"
|
||||
if [[ -d $CACHE_DIR ]]; then
|
||||
docker run -v "$CACHE_DIR:/cache" "$IMAGE" find /cache -depth -mindepth 1 -maxdepth 1 -exec rm -Rf {} \;
|
||||
docker run --rm -v "$CACHE_DIR:/cache" "$IMAGE" find /cache -depth -mindepth 1 -maxdepth 1 -exec rm -Rf {} \;
|
||||
fi
|
||||
|
||||
@@ -14,7 +14,7 @@ case "$1" in
|
||||
: | 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"
|
||||
find . -maxdepth 1 -type d -not -name . | sed 's:./::g' > "$BACKUP_TMP_DIR/.dokku_backup_apps"
|
||||
popd > /dev/null
|
||||
|
||||
# we want to insert the files in the root of the tar
|
||||
|
||||
31
plugins/build-env/pre-build
Executable file
31
plugins/build-env/pre-build
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
APP="$1"; IMAGE="dokku/$APP"; BUILD_ENV=""
|
||||
|
||||
[[ -f "$DOKKU_ROOT/BUILD_ENV" ]] && cat "$DOKKU_ROOT/BUILD_ENV" >> "$DOKKU_ROOT/ENV" && rm "$DOKKU_ROOT/BUILD_ENV"
|
||||
|
||||
! (grep -q CURL_CONNECT_TIMEOUT "$DOKKU_ROOT/ENV" > /dev/null 2>&1) && echo "export CURL_CONNECT_TIMEOUT=5" >> "$DOKKU_ROOT/ENV"
|
||||
! (grep -q CURL_TIMEOUT "$DOKKU_ROOT/ENV" > /dev/null 2>&1) && echo "export CURL_TIMEOUT=30" >> "$DOKKU_ROOT/ENV"
|
||||
|
||||
if [[ -f "$DOKKU_ROOT/ENV" ]]; then
|
||||
BUILD_ENV+=$(< "$DOKKU_ROOT/ENV")
|
||||
fi
|
||||
if [[ -f "$DOKKU_ROOT/$APP/ENV" ]]; then
|
||||
BUILD_ENV+=" "
|
||||
BUILD_ENV+=$(< "$DOKKU_ROOT/$APP/ENV")
|
||||
fi
|
||||
|
||||
if [[ ! -z "$BUILD_ENV" ]]; then
|
||||
echo "-----> Adding BUILD_ENV to build environment..."
|
||||
# create build env files for use in buildpacks like this:
|
||||
# https://github.com/niteoweb/heroku-buildpack-buildout/blob/5879fa3418f7d8e079f1aa5816ba1adde73f4948/bin/compile#L34
|
||||
id=$(echo $BUILD_ENV |sed 's@export @@g'| docker run -i -a stdin $IMAGE /bin/bash -c "for ENV_VAR in $(cat); do echo \$ENV_VAR |sed 's@^\([^=]*\)=\(.*\)\$@echo \\\"\2\\\" >/tmp/env/\1@g' >>/tmp/set_env.sh; done && mkdir -p /tmp/env && /bin/bash /tmp/set_env.sh")
|
||||
test "$(docker wait $id)" -eq 0
|
||||
docker commit $id $IMAGE > /dev/null
|
||||
|
||||
# create build env for 'old style' buildpacks and dokku plugins
|
||||
id=$(echo "$BUILD_ENV" | docker run -i -a stdin $IMAGE /bin/bash -c "cat >> /app/.env")
|
||||
test "$(docker wait $id)" -eq 0
|
||||
docker commit $id $IMAGE > /dev/null
|
||||
fi
|
||||
@@ -56,20 +56,20 @@ sleep $WAIT
|
||||
# --location Follow redirects
|
||||
CURL_OPTIONS="-q --compressed --fail --location --max-time 30"
|
||||
|
||||
cat "$FILENAME" | while read PATHNAME EXPECTED ; do
|
||||
while read PATHNAME EXPECTED; do
|
||||
# Ignore empty lines and lines starting with #
|
||||
[[ -z "$PATHNAME" || "$PATHNAME" =~ ^\# ]] && continue
|
||||
[[ -z "$PATHNAME" || "$PATHNAME" =~ ^# ]] && continue
|
||||
|
||||
URL="http://$HOSTNAME:$PORT$PATHNAME"
|
||||
|
||||
echo "checking with: curl $CURL_OPTIONS $URL"
|
||||
HTML=$(curl $CURL_OPTIONS $URL)
|
||||
if [[ -n "$EXPECTED" && ! "$HTML" =~ "$EXPECTED" ]] ; then
|
||||
if [[ -n "$EXPECTED" && ! "$HTML" =~ $EXPECTED ]] ; then
|
||||
echo -e "\033[31m\033[1m$URL: expected to but did not find: \"$EXPECTED\"\033[0m"
|
||||
exit 1
|
||||
else
|
||||
echo -e "\033[32m\033[1m$URL => \"$EXPECTED\"\033[0m"
|
||||
fi
|
||||
done
|
||||
done < "$FILENAME"
|
||||
|
||||
echo -e "\033[32m\033[1mAll checks successful!\033[0m"
|
||||
|
||||
@@ -5,7 +5,6 @@ ENV_FILE="$DOKKU_ROOT/$2/ENV"
|
||||
ENV_FILE_TEMP="$DOKKU_ROOT/$2/ENV.tmp"
|
||||
config_create () {
|
||||
[ -f $ENV_FILE ] || {
|
||||
echo "-----> Creating $ENV_FILE"
|
||||
touch $ENV_FILE
|
||||
}
|
||||
}
|
||||
@@ -16,21 +15,21 @@ config_styled_hash () {
|
||||
|
||||
longest=""
|
||||
while read -r word; do
|
||||
KEY=`echo $word | cut -d"=" -f1`
|
||||
KEY=$(echo $word | cut -d"=" -f1)
|
||||
if [ ${#KEY} -gt ${#longest} ]; then
|
||||
longest=$KEY
|
||||
fi
|
||||
done <<< "$vars"
|
||||
|
||||
while read -r word; do
|
||||
KEY=`echo $word | cut -d"=" -f1`
|
||||
VALUE=`echo $word | cut -d"=" -f2- | sed -e "s/^'//" -e "s/'$//"`
|
||||
KEY=$(echo $word | cut -d"=" -f1)
|
||||
VALUE=$(echo $word | cut -d"=" -f2- | sed -e "s/^'//" -e "s/'$//")
|
||||
|
||||
num_zeros=$((${#longest} - ${#KEY}))
|
||||
zeros=" "
|
||||
while [ $num_zeros -gt 0 ]; do
|
||||
zeros="$zeros "
|
||||
num_zeros=$(($num_zeros - 1))
|
||||
num_zeros=$((num_zeros - 1))
|
||||
done
|
||||
echo "$prefix$KEY:$zeros$VALUE"
|
||||
done <<< "$vars"
|
||||
@@ -69,7 +68,7 @@ case "$1" in
|
||||
config_create
|
||||
[[ ! -s $ENV_FILE ]] && echo "$APP has no config vars" && exit 1
|
||||
|
||||
VARS=`cat $ENV_FILE | grep -Eo "export ([a-zA-Z_][a-zA-Z0-9_]*=.*)" | cut -d" " -f2-`
|
||||
VARS=$(grep -Eo "export ([a-zA-Z_][a-zA-Z0-9_]*=.*)" $ENV_FILE | cut -d" " -f2-)
|
||||
|
||||
for var in "$@"; do
|
||||
if [[ "$var" == "--shell" ]]; then
|
||||
@@ -100,7 +99,7 @@ case "$1" in
|
||||
|
||||
KEY="$3"
|
||||
|
||||
cat $ENV_FILE | grep -Eo "export ([a-zA-Z_][a-zA-Z0-9_]*=.*)" | grep "^export $KEY=" | cut -d"=" -f2- | sed -e "s/^'//" -e "s/'$//"
|
||||
grep -Eo "export ([a-zA-Z_][a-zA-Z0-9_]*=.*)" $ENV_FILE | grep "^export $KEY=" | cut -d"=" -f2- | sed -e "s/^'//" -e "s/'$//"
|
||||
;;
|
||||
|
||||
config:set)
|
||||
@@ -116,7 +115,7 @@ case "$1" in
|
||||
|
||||
config_create
|
||||
ENV_ADD=""
|
||||
ENV_TEMP=`cat "${ENV_FILE}"`
|
||||
ENV_TEMP=$(cat "${ENV_FILE}")
|
||||
RESTART_APP=false
|
||||
shift 2
|
||||
|
||||
@@ -129,8 +128,8 @@ case "$1" in
|
||||
done
|
||||
|
||||
for var; do
|
||||
KEY=`echo ${var} | cut -d"=" -f1`
|
||||
VALUE=`echo ${var} | cut -d"=" -f2-`
|
||||
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
|
||||
@@ -163,7 +162,7 @@ ${var}"
|
||||
fi
|
||||
|
||||
config_create
|
||||
ENV_TEMP=`cat "${ENV_FILE}"`
|
||||
ENV_TEMP=$(cat "${ENV_FILE}")
|
||||
VARS="${*:3}"
|
||||
|
||||
for var in $VARS; do
|
||||
|
||||
9
plugins/domains/backup-export
Executable file
9
plugins/domains/backup-export
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/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/*/VHOST; do echo $i; done
|
||||
cat; for i in $BASE_DIR/*/nginx.conf.template; do echo $i; done
|
||||
15
plugins/domains/backup-import
Executable file
15
plugins/domains/backup-import
Executable file
@@ -0,0 +1,15 @@
|
||||
#!/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 */VHOST; do
|
||||
cp $file "$TARGET_DIR/$file"
|
||||
done
|
||||
for file in */nginx.conf.template; do
|
||||
cp $file "$TARGET_DIR/$file"
|
||||
done
|
||||
112
plugins/domains/commands
Executable file
112
plugins/domains/commands
Executable file
@@ -0,0 +1,112 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
case "$1" in
|
||||
domains)
|
||||
[[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1
|
||||
[[ ! -d "$DOKKU_ROOT/$2" ]] && echo "App $2 does not exist" && exit 1
|
||||
APP="$2"
|
||||
|
||||
dokku domains:setup $APP
|
||||
echo "=== $APP Domain Names"
|
||||
cat "$DOKKU_ROOT/$APP/VHOST"
|
||||
;;
|
||||
|
||||
domains:setup)
|
||||
[[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1
|
||||
[[ ! -d "$DOKKU_ROOT/$2" ]] && echo "App $2 does not exist" && exit 1
|
||||
APP="$2"; VHOST_PATH="$DOKKU_ROOT/$APP/VHOST"
|
||||
|
||||
if [[ ! -f $VHOST_PATH ]]; then
|
||||
if [[ -f "$DOKKU_ROOT/VHOST" ]];then
|
||||
VHOST=$(< "$DOKKU_ROOT/VHOST")
|
||||
else
|
||||
VHOST=$(< "$DOKKU_ROOT/HOSTNAME")
|
||||
fi
|
||||
if [[ "$VHOST" =~ ([0-9]{1,3}[\.]){3}[0-9]{1,3} ]];then
|
||||
echo "ip found as hostname. disabling vhost support"
|
||||
[[ ! $(grep -q NO_VHOST "$DOKKU_ROOT/$APP/ENV") ]] && echo "export NO_VHOST='1'" >> "$DOKKU_ROOT/$APP/ENV"
|
||||
else
|
||||
echo "-----> Creating new $VHOST_PATH..."
|
||||
SUBDOMAIN=${APP/%\.${VHOST}/}
|
||||
hostname=$(: | pluginhook nginx-hostname $APP $SUBDOMAIN $VHOST)
|
||||
if [[ ! -n $hostname ]]; then
|
||||
if [[ "$APP" == *.* ]] && [[ "$SUBDOMAIN" == "$APP" ]]; then
|
||||
hostname="${APP/\//-}"
|
||||
else
|
||||
hostname="${APP/\//-}.$VHOST"
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "$hostname" > $VHOST_PATH
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
|
||||
domains:add)
|
||||
[[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1
|
||||
[[ ! -d "$DOKKU_ROOT/$2" ]] && echo "App $2 does not exist" && exit 1
|
||||
APP="$2"
|
||||
|
||||
if [[ -z $3 ]]; then
|
||||
echo "Usage: dokku $1 $APP DOMAIN"
|
||||
echo "Must specify DOMAIN."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ $(egrep ^"$3"$ "$DOKKU_ROOT/$APP/VHOST" > /dev/null 2>&1; echo $?) -eq 0 ]]; then
|
||||
echo "$3 is already defined for $APP"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
dokku domains:setup $APP
|
||||
echo "$3" >> "$DOKKU_ROOT/$APP/VHOST"
|
||||
pluginhook post-domains-update $APP
|
||||
echo "-----> Added $3 to $APP"
|
||||
|
||||
;;
|
||||
|
||||
domains:clear)
|
||||
[[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1
|
||||
[[ ! -d "$DOKKU_ROOT/$2" ]] && echo "App $2 does not exist" && exit 1
|
||||
APP="$2"
|
||||
|
||||
rm -f "$DOKKU_ROOT/$APP/VHOST"
|
||||
dokku domains:setup $APP
|
||||
pluginhook post-domains-update $APP
|
||||
echo "-----> Cleared domains in $APP"
|
||||
|
||||
;;
|
||||
|
||||
domains:remove)
|
||||
[[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1
|
||||
[[ ! -d "$DOKKU_ROOT/$2" ]] && echo "App $2 does not exist" && exit 1
|
||||
APP="$2"
|
||||
|
||||
if [[ -z $3 ]]; then
|
||||
echo "Usage: dokku $1 $2 DOMAIN"
|
||||
echo "Must specify DOMAIN."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
dokku domains:setup $APP
|
||||
sed -i "/^$3$/d" "$DOKKU_ROOT/$APP/VHOST"
|
||||
pluginhook post-domains-update $APP
|
||||
echo "-----> Removed $3 from $APP"
|
||||
|
||||
;;
|
||||
|
||||
help | domains:help)
|
||||
cat && cat<<EOF
|
||||
domains <app> List custom domains for app
|
||||
domains:add <app> DOMAIN Add a custom domain to app
|
||||
domains:clear <app> Clear all custom domains for app
|
||||
domains:remove <app> DOMAIN Remove a custom domain from app
|
||||
EOF
|
||||
;;
|
||||
|
||||
*)
|
||||
exit $DOKKU_NOT_IMPLEMENTED_EXIT
|
||||
;;
|
||||
|
||||
esac
|
||||
8
plugins/domains/install
Executable file
8
plugins/domains/install
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
shopt -s nullglob
|
||||
|
||||
for app in $DOKKU_ROOT/*/CONTAINER; do
|
||||
APP=$(basename "$(dirname $app)");
|
||||
dokku domains:setup $APP
|
||||
done
|
||||
@@ -57,7 +57,7 @@ EOF
|
||||
chmod +x $PRERECEIVE_HOOK
|
||||
fi
|
||||
|
||||
args=$@
|
||||
args=$*
|
||||
git-shell -c "$args"
|
||||
;;
|
||||
|
||||
|
||||
@@ -9,6 +9,6 @@ TARGET_DIR="$3"
|
||||
cd $IMPORT_DIR
|
||||
|
||||
for file in */tls/server.*; do
|
||||
mkdir -p $(dirname $TARGET_DIR$file)
|
||||
mkdir -p "$(dirname $TARGET_DIR$file)"
|
||||
cp $file $TARGET_DIR$file
|
||||
done
|
||||
|
||||
@@ -1,28 +1,120 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
restart_nginx () {
|
||||
case "$DOKKU_DISTRO" in
|
||||
ubuntu)
|
||||
sudo /etc/init.d/nginx reload > /dev/null
|
||||
;;
|
||||
|
||||
opensuse)
|
||||
sudo /sbin/service nginx reload > /dev/null
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
nginx:build-config)
|
||||
APP="$2"; PORT="$3"
|
||||
[[ -z "$PORT" ]] && PORT=$(< "$DOKKU_ROOT/$APP/PORT")
|
||||
VHOST_PATH="$DOKKU_ROOT/$APP/VHOST"
|
||||
WILDCARD_SSL="$DOKKU_ROOT/tls"
|
||||
SSL="$DOKKU_ROOT/$APP/tls"
|
||||
|
||||
[[ -f "$DOKKU_ROOT/$APP/ENV" ]] && source $DOKKU_ROOT/$APP/ENV
|
||||
|
||||
if [[ ! -n "$NO_VHOST" ]]; then
|
||||
NONSSL_VHOSTS=$(cat $VHOST_PATH)
|
||||
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" ]]; then
|
||||
SSL_INUSE="$WILDCARD_SSL"
|
||||
SSL_DIRECTIVES=""
|
||||
fi
|
||||
|
||||
NGINX_CONF="$PLUGIN_PATH/nginx-vhosts/templates/nginx.conf"
|
||||
SCHEME="http"
|
||||
if [[ -n "$SSL_INUSE" ]]; then
|
||||
NGINX_CONF="$PLUGIN_PATH/nginx-vhosts/templates/nginx.ssl.conf"
|
||||
SCHEME="https"
|
||||
|
||||
SSL_HOSTNAME=$(openssl x509 -in $SSL_INUSE/server.crt -noout -subject | tr '/' '\n' | grep CN= | cut -c4-)
|
||||
SSL_HOSTNAME=$(echo "$SSL_HOSTNAME" | sed 's|\.|\\.|g' | sed 's/\*/\.\*/g')
|
||||
|
||||
[[ -z "$(egrep ^"$SSL_HOSTNAME"$ $VHOST_PATH)" ]] && echo "$SSL_HOSTNAME" | sed 's/\\./\./g' >> $VHOST_PATH
|
||||
SSL_VHOSTS=$(egrep ^"$SSL_HOSTNAME"$ $VHOST_PATH || exit 0)
|
||||
NONSSL_VHOSTS=$(egrep -v ^"$SSL_HOSTNAME"$ $VHOST_PATH || exit 0)
|
||||
|
||||
while read line; do
|
||||
echo "-----> Configuring SSL for $line..."
|
||||
SSL_SERVER_NAME=$line
|
||||
eval "cat <<< \"$(< $NGINX_CONF)\" >> $DOKKU_ROOT/$APP/nginx.conf"
|
||||
done <<< "$SSL_VHOSTS"
|
||||
fi
|
||||
|
||||
APP_NGINX_TEMPLATE="$DOKKU_ROOT/$APP/nginx.conf.template"
|
||||
if [[ -f $APP_NGINX_TEMPLATE ]]; then
|
||||
echo "-----> Overriding default nginx.conf with detected nginx.conf.template"
|
||||
NGINX_CONF=$APP_NGINX_TEMPLATE
|
||||
fi
|
||||
|
||||
xargs -i echo "-----> Configuring {}..." < $VHOST_PATH
|
||||
# Include SSL_VHOSTS so we can redirect http to https on that hostname as well
|
||||
NOSSL_SERVER_NAME=$(echo $NONSSL_VHOSTS $SSL_VHOSTS| tr '\n' ' ')
|
||||
|
||||
echo "-----> Creating $SCHEME nginx.conf"
|
||||
echo "upstream $APP { server 127.0.0.1:$PORT; }" > $DOKKU_ROOT/$APP/nginx.conf
|
||||
eval "cat <<< \"$(< $NGINX_CONF)\" >> $DOKKU_ROOT/$APP/nginx.conf"
|
||||
|
||||
echo "-----> Running nginx-pre-reload"
|
||||
pluginhook nginx-pre-reload $APP $PORT
|
||||
|
||||
echo " Reloading nginx"
|
||||
restart_nginx
|
||||
else
|
||||
if [[ -f "$DOKKU_ROOT/$APP/VHOST" ]]; then
|
||||
echo "-----> NO_VHOST set, deleting $APP/VHOST"
|
||||
rm "$DOKKU_ROOT/$APP/VHOST"
|
||||
fi
|
||||
if [[ -f "$DOKKU_ROOT/$APP/nginx.conf" ]]; then
|
||||
echo "-----> NO_VHOST set, deleting nginx.conf"
|
||||
rm "$DOKKU_ROOT/$APP/nginx.conf"
|
||||
|
||||
echo "-----> NO_VHOST set, reloading nginx after nginx.conf deletion"
|
||||
restart_nginx
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
|
||||
nginx:import-ssl)
|
||||
[[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1
|
||||
[[ ! -d "$DOKKU_ROOT/$2" ]] && echo "App $2 does not exist" && exit 1
|
||||
[[ -t 0 ]] && echo "Tar archive containing server.crt and server.key expected on stdin" && exit 1
|
||||
APP="$2"
|
||||
|
||||
TEMP_DIR=`mktemp -d`
|
||||
TEMP_DIR=$(mktemp -d)
|
||||
cd $TEMP_DIR
|
||||
tar xvf - <&0
|
||||
[[ -f "$TEMP_DIR/server.crt" ]] && echo "Tar archive missing server.crt" && exit 1
|
||||
[[ -f "$TEMP_DIR/server.key" ]] && echo "Tar archive missing server.key" && exit 1
|
||||
[[ ! -f "$TEMP_DIR/server.crt" ]] && echo "Tar archive missing server.crt" && exit 1
|
||||
[[ ! -f "$TEMP_DIR/server.key" ]] && echo "Tar archive missing server.key" && exit 1
|
||||
|
||||
mkdir -p "$DOKKU_ROOT/$APP/tls"
|
||||
mv "$TEMP_DIR/server.crt" "$DOKKU_ROOT/$APP/tls/server.crt"
|
||||
mv "$TEMP_DIR/server.key" "$DOKKU_ROOT/$APP/tls/server.key"
|
||||
cd $DOKKU_ROOT
|
||||
rm -rf $TEMP_DIR
|
||||
dokku nginx:build-config $APP
|
||||
;;
|
||||
|
||||
help | nginx:help)
|
||||
cat && cat<<EOF
|
||||
nginx:import-ssl <app> Imports a tarball from stdin; should contain server.crt and server.key
|
||||
nginx:build-config <app> (Re)builds nginx config for given app
|
||||
EOF
|
||||
;;
|
||||
|
||||
|
||||
@@ -25,18 +25,46 @@ ssl_session_timeout 10m;
|
||||
|
||||
ssl_ciphers EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
|
||||
ssl_protocols TLSv1.2 TLSv1.1 TLSv1;
|
||||
ssl_prefer_server_ciphers on;
|
||||
# this is already defined in the base nginx.conf and causes nginx reloads/starts to fail
|
||||
# when its defined twice
|
||||
# ssl_prefer_server_ciphers on;
|
||||
|
||||
#ssl_certificate $DOKKU_ROOT/tls/server.crt;
|
||||
#ssl_certificate_key $DOKKU_ROOT/tls/server.key;
|
||||
# ssl_certificate $DOKKU_ROOT/tls/server.crt;
|
||||
# ssl_certificate_key $DOKKU_ROOT/tls/server.key;
|
||||
EOF
|
||||
fi
|
||||
|
||||
echo 'server_names_hash_bucket_size 64;' >| /etc/nginx/conf.d/server_names_hash_bucket_size.conf
|
||||
cat<<EOF > /etc/nginx/nginx.conf
|
||||
user www-data;
|
||||
worker_processes auto;
|
||||
pid /run/nginx.pid;
|
||||
|
||||
if [[ ! -f "$DOKKU_ROOT/VHOST" ]]; then
|
||||
[[ $(dig +short $(< "$DOKKU_ROOT/HOSTNAME")) ]] && cp "$DOKKU_ROOT/HOSTNAME" "$DOKKU_ROOT/VHOST"
|
||||
fi
|
||||
events {
|
||||
worker_connections 768;
|
||||
}
|
||||
|
||||
http {
|
||||
sendfile on;
|
||||
tcp_nopush on;
|
||||
tcp_nodelay on;
|
||||
keepalive_timeout 65;
|
||||
types_hash_max_size 2048;
|
||||
|
||||
include /etc/nginx/mime.types;
|
||||
default_type application/octet-stream;
|
||||
access_log /var/log/nginx/access.log;
|
||||
error_log /var/log/nginx/error.log;
|
||||
|
||||
gzip on;
|
||||
gzip_disable "msie6";
|
||||
|
||||
include /etc/nginx/conf.d/*.conf;
|
||||
include /etc/nginx/sites-enabled/*;
|
||||
}
|
||||
|
||||
EOF
|
||||
|
||||
echo 'server_names_hash_bucket_size 512;' >| /etc/nginx/conf.d/server_names_hash_bucket_size.conf
|
||||
|
||||
case "$DOKKU_DISTRO" in
|
||||
ubuntu)
|
||||
|
||||
@@ -2,134 +2,13 @@
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
APP="$1"; PORT="$2"
|
||||
WILDCARD_SSL="$DOKKU_ROOT/tls"
|
||||
SSL="$DOKKU_ROOT/$APP/tls"
|
||||
|
||||
set +e
|
||||
NO_VHOST=$(dokku config:get $APP NO_VHOST)
|
||||
set -e
|
||||
set +e; NO_VHOST=$(dokku config:get $APP NO_VHOST); set -e
|
||||
|
||||
if [[ -n "$NO_VHOST" ]]; then
|
||||
echo "-----> NO_VHOST config detected"
|
||||
elif [[ ! -f "$DOKKU_ROOT/$APP/VHOST" ]]; then
|
||||
dokku domains:setup $APP
|
||||
fi
|
||||
|
||||
if [[ -f "$DOKKU_ROOT/VHOST" && ! -n "$NO_VHOST" ]]; then
|
||||
VHOST=$(< "$DOKKU_ROOT/VHOST")
|
||||
SUBDOMAIN=${APP/%\.${VHOST}/}
|
||||
hostname=$(: | pluginhook nginx-hostname $APP $SUBDOMAIN $VHOST)
|
||||
if [[ ! -n $hostname ]]; then
|
||||
if [[ "$APP" == *.* ]] && [[ "$SUBDOMAIN" == "$APP" ]]; then
|
||||
hostname="${APP/\//-}"
|
||||
else
|
||||
hostname="${APP/\//-}.$VHOST"
|
||||
fi
|
||||
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
|
||||
|
||||
if [[ -n "$SSL_INUSE" ]]; then
|
||||
echo "-----> Creating ssl 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;
|
||||
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;
|
||||
}
|
||||
include $DOKKU_ROOT/$APP/nginx.conf.d/*.conf;
|
||||
}
|
||||
EOF
|
||||
|
||||
echo "https://$hostname" > "$DOKKU_ROOT/$APP/URL"
|
||||
else
|
||||
echo "-----> Creating non-ssl 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;
|
||||
}
|
||||
include $DOKKU_ROOT/$APP/nginx.conf.d/*.conf;
|
||||
}
|
||||
EOF
|
||||
|
||||
echo "http://$hostname" > "$DOKKU_ROOT/$APP/URL"
|
||||
fi
|
||||
|
||||
echo "-----> Running nginx-pre-reload"
|
||||
pluginhook nginx-pre-reload $APP $PORT
|
||||
|
||||
echo " Reloading nginx"
|
||||
case "$DOKKU_DISTRO" in
|
||||
ubuntu)
|
||||
sudo /etc/init.d/nginx reload > /dev/null
|
||||
;;
|
||||
|
||||
opensuse)
|
||||
sudo /sbin/service nginx reload > /dev/null
|
||||
;;
|
||||
esac
|
||||
else
|
||||
if [[ -f "$DOKKU_ROOT/$APP/URL" ]]; then
|
||||
echo "------> NO_VHOST set, deleting $APP/URL"
|
||||
rm "$DOKKU_ROOT/$APP/URL"
|
||||
fi
|
||||
if [[ -f "$DOKKU_ROOT/$APP/nginx.conf" ]]; then
|
||||
echo "------> NO_VHOST set, deleting $APP/nginx.conf"
|
||||
rm "$DOKKU_ROOT/$APP/nginx.conf"
|
||||
echo "------> NO_VHOST set, reloading nginx after nginx.conf deletion"
|
||||
case "$DOKKU_DISTRO" in
|
||||
ubuntu)
|
||||
sudo /etc/init.d/nginx reload > /dev/null
|
||||
;;
|
||||
|
||||
opensuse)
|
||||
sudo /sbin/service nginx reload > /dev/null
|
||||
;;
|
||||
esac
|
||||
sudo /etc/init.d/nginx reload > /dev/null
|
||||
fi
|
||||
fi
|
||||
dokku nginx:build-config $APP $PORT
|
||||
|
||||
6
plugins/nginx-vhosts/post-domains-update
Executable file
6
plugins/nginx-vhosts/post-domains-update
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
APP="$1"
|
||||
|
||||
dokku nginx:build-config $APP
|
||||
17
plugins/nginx-vhosts/templates/nginx.conf
Normal file
17
plugins/nginx-vhosts/templates/nginx.conf
Normal file
@@ -0,0 +1,17 @@
|
||||
server {
|
||||
listen [::]:80;
|
||||
listen 80;
|
||||
server_name $NOSSL_SERVER_NAME;
|
||||
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;
|
||||
}
|
||||
include $DOKKU_ROOT/$APP/nginx.conf.d/*.conf;
|
||||
}
|
||||
28
plugins/nginx-vhosts/templates/nginx.ssl.conf
Normal file
28
plugins/nginx-vhosts/templates/nginx.ssl.conf
Normal file
@@ -0,0 +1,28 @@
|
||||
server {
|
||||
listen [::]:80;
|
||||
listen 80;
|
||||
server_name $NOSSL_SERVER_NAME;
|
||||
return 301 https://$SSL_SERVER_NAME\$request_uri;
|
||||
}
|
||||
|
||||
server {
|
||||
listen [::]:443 ssl spdy;
|
||||
listen 443 ssl spdy;
|
||||
server_name $SSL_SERVER_NAME;
|
||||
$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;
|
||||
}
|
||||
include $DOKKU_ROOT/$APP/nginx.conf.d/*.conf;
|
||||
}
|
||||
122
tests.mk
Normal file
122
tests.mk
Normal file
@@ -0,0 +1,122 @@
|
||||
shellcheck:
|
||||
ifeq ($(shell shellcheck > /dev/null 2>&1 ; echo $$?),127)
|
||||
ifeq ($(shell uname),Darwin)
|
||||
brew install shellcheck
|
||||
else
|
||||
sudo add-apt-repository 'deb http://archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse'
|
||||
sudo apt-get update && sudo apt-get install -y shellcheck
|
||||
endif
|
||||
endif
|
||||
|
||||
ci-dependencies: shellcheck bats
|
||||
|
||||
setup-deploy-tests:
|
||||
mkdir -p /home/dokku
|
||||
ifdef ENABLE_DOKKU_TRACE
|
||||
echo "-----> Enabling tracing"
|
||||
echo "export DOKKU_TRACE=1" >> /home/dokku/dokkurc
|
||||
endif
|
||||
@echo "Setting dokku.me in /etc/hosts"
|
||||
sudo /bin/bash -c "[[ `ping -c1 dokku.me > /dev/null 2>&1; echo $$?` -eq 0 ]] || echo \"127.0.0.1 dokku.me *.dokku.me\" >> /etc/hosts"
|
||||
|
||||
@echo "-----> Generating keypair..."
|
||||
mkdir -p /root/.ssh
|
||||
rm -f /root/.ssh/dokku_test_rsa*
|
||||
echo -e "y\n" | ssh-keygen -f /root/.ssh/dokku_test_rsa -t rsa -N ''
|
||||
chmod 600 /root/.ssh/dokku_test_rsa*
|
||||
|
||||
@echo "-----> Setting up ssh config..."
|
||||
ifneq ($(shell ls /root/.ssh/config > /dev/null 2>&1 ; echo $$?),0)
|
||||
echo "Host dokku.me \\r\\n RequestTTY yes \\r\\n IdentityFile /root/.ssh/dokku_test_rsa" >> /root/.ssh/config
|
||||
else ifeq ($(shell grep dokku.me /root/.ssh/config),)
|
||||
echo "Host dokku.me \\r\\n RequestTTY yes \\r\\n IdentityFile /root/.ssh/dokku_test_rsa" >> /root/.ssh/config
|
||||
endif
|
||||
|
||||
@echo "-----> Installing SSH public key..."
|
||||
sudo sshcommand acl-remove dokku test
|
||||
cat /root/.ssh/dokku_test_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
|
||||
|
||||
ifeq ($(shell grep dokku.me /home/dokku/VHOST),)
|
||||
@echo "-----> Setting default VHOST to dokku.me..."
|
||||
echo "dokku.me" > /home/dokku/VHOST
|
||||
endif
|
||||
|
||||
bats:
|
||||
git clone https://github.com/sstephenson/bats.git /tmp/bats
|
||||
cd /tmp/bats && sudo ./install.sh /usr/local
|
||||
rm -rf /tmp/bats
|
||||
|
||||
lint:
|
||||
# these are disabled due to their expansive existence in the codebase. we should clean it up though
|
||||
# SC2034: VAR appears unused - https://github.com/koalaman/shellcheck/wiki/SC2034
|
||||
# SC2086: Double quote to prevent globbing and word splitting - https://github.com/koalaman/shellcheck/wiki/SC2086
|
||||
# SC2143: Instead of [ -n $(foo | grep bar) ], use foo | grep -q bar - https://github.com/koalaman/shellcheck/wiki/SC2143
|
||||
# SC2001: See if you can use ${variable//search/replace} instead. - https://github.com/koalaman/shellcheck/wiki/SC2001
|
||||
@echo linting...
|
||||
@$(QUIET) find . -not -path '*/\.*' | xargs file | egrep "shell|bash" | awk '{ print $$1 }' | sed 's/://g' | xargs shellcheck -e SC2034,SC2086,SC2143,SC2001
|
||||
|
||||
unit-tests:
|
||||
@echo running unit tests...
|
||||
@$(QUIET) bats tests/unit
|
||||
|
||||
deploy-test-config:
|
||||
@echo deploying config app...
|
||||
cd tests && ./test_deploy ./apps/config dokku.me
|
||||
|
||||
deploy-test-gitsubmodules:
|
||||
@echo deploying gitsubmodules app...
|
||||
cd tests && ./test_deploy ./apps/gitsubmodules dokku.me
|
||||
|
||||
deploy-test-go:
|
||||
@echo deploying go app...
|
||||
cd tests && ./test_deploy ./apps/go dokku.me
|
||||
|
||||
deploy-test-java:
|
||||
@echo deploying app...
|
||||
cd tests && ./test_deploy ./apps/java dokku.me
|
||||
|
||||
deploy-test-multi:
|
||||
@echo deploying multi app...
|
||||
cd tests && ./test_deploy ./apps/multi dokku.me
|
||||
|
||||
deploy-test-nodejs-express:
|
||||
@echo deploying app...
|
||||
cd tests && ./test_deploy ./apps/nodejs-express dokku.me
|
||||
|
||||
deploy-test-php:
|
||||
@echo deploying php app...
|
||||
cd tests && ./test_deploy ./apps/php dokku.me
|
||||
|
||||
deploy-test-python-flask:
|
||||
@echo deploying python-flask app...
|
||||
cd tests && ./test_deploy ./apps/python-flask dokku.me
|
||||
|
||||
deploy-test-scala:
|
||||
@echo deploying scala app...
|
||||
cd tests && ./test_deploy ./apps/scala dokku.me
|
||||
|
||||
deploy-test-static:
|
||||
@echo deploying static app...
|
||||
cd tests && ./test_deploy ./apps/static dokku.me
|
||||
|
||||
deploy-tests:
|
||||
@echo running deploy tests...
|
||||
# @$(QUIET) bats tests/deploy
|
||||
@$(QUIET) $(MAKE) deploy-test-config
|
||||
@$(QUIET) $(MAKE) deploy-test-gitsubmodules
|
||||
@$(QUIET) $(MAKE) deploy-test-go
|
||||
@$(QUIET) $(MAKE) deploy-test-java
|
||||
# broken with new buildstep.
|
||||
# ref: https://github.com/progrium/dokku/issues/832
|
||||
# ref: https://github.com/heroku/heroku-buildpack-ruby/pull/319
|
||||
# @$(QUIET) $(MAKE) deploy-test-multi
|
||||
@$(QUIET) $(MAKE) deploy-test-nodejs-express
|
||||
@$(QUIET) $(MAKE) deploy-test-php
|
||||
@$(QUIET) $(MAKE) deploy-test-python-flask
|
||||
@$(QUIET) $(MAKE) deploy-test-scala
|
||||
@$(QUIET) $(MAKE) deploy-test-static
|
||||
|
||||
test: setup-deploy-tests lint unit-tests deploy-tests
|
||||
@@ -1,2 +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"
|
||||
set -e; output="$(curl -s -S -i -N -H \"Connection: Upgrade\" -H \"Upgrade: websocket\" -H \"Host: $1\" -H \"Origin: $1\" $1 -m 2)"; echo $output; test "$output" == "bazingaa"
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
#!/bin/bash
|
||||
set -e;
|
||||
|
||||
base_url="$1"
|
||||
test_url / "config-test"
|
||||
test_url /hello "Hello world"
|
||||
|
||||
test_url () {
|
||||
path="$1"
|
||||
expected_output="$2"
|
||||
url="$base_url$path"
|
||||
output="$(curl -s $url)"
|
||||
echo $output
|
||||
output="$(curl -s -S "$url")"
|
||||
echo "$output"
|
||||
test "$output" == "$expected_output"
|
||||
}
|
||||
}
|
||||
|
||||
base_url="$1"
|
||||
test_url / "config-test"
|
||||
test_url /hello "Hello world"
|
||||
|
||||
@@ -4,5 +4,6 @@ set -ex;
|
||||
REMOTE=$1
|
||||
REPO=$2
|
||||
|
||||
ssh $REMOTE config:set $REPO CONFTEST=config-test HELLO=\"Hello world\"
|
||||
|
||||
# setting config variables with spaces is broken at the moment. ref: 820
|
||||
# ssh "$REMOTE" config:set "$REPO" CONFTEST=config-test HELLO=\"Hello world\"
|
||||
dokku config:set "$REPO" CONFTEST=config-test HELLO="Hello world"
|
||||
|
||||
1
tests/apps/gitsubmodules/CHECKS
Normal file
1
tests/apps/gitsubmodules/CHECKS
Normal file
@@ -0,0 +1 @@
|
||||
/ Hello
|
||||
@@ -1 +1 @@
|
||||
web: node node-js-sample/web.js
|
||||
web: node node-js-sample/index.js
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
#!/bin/bash
|
||||
set -e; output="$(curl -s $1)"; echo $output; test "$output" == "Hello World!"
|
||||
set -e; output="$(curl -s -S $1)"; echo $output; test "$output" == "Hello World!"
|
||||
|
||||
1
tests/apps/go/CHECKS
Normal file
1
tests/apps/go/CHECKS
Normal file
@@ -0,0 +1 @@
|
||||
/ go
|
||||
@@ -1,2 +1,2 @@
|
||||
#!/bin/bash
|
||||
set -e; test "$(curl -s $1)" == "go"
|
||||
set -e; test "$(curl -s -S "$1")" == "go"
|
||||
|
||||
1
tests/apps/java/CHECKS
Normal file
1
tests/apps/java/CHECKS
Normal file
@@ -0,0 +1 @@
|
||||
/ Hello from Java
|
||||
@@ -1,2 +1,2 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e; output="$(curl -s $1)"; echo $output; test "$output" == "Hello from Java!"
|
||||
set -e; output="$(curl -s -S $1)"; echo $output; test "$output" == "Hello from Java!"
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
https://github.com/heroku/heroku-buildpack-ruby
|
||||
https://github.com/heroku/heroku-buildpack-nodejs
|
||||
https://github.com/heroku/heroku-buildpack-python
|
||||
https://github.com/heroku/heroku-buildpack-python.git
|
||||
|
||||
1
tests/apps/multi/CHECKS
Normal file
1
tests/apps/multi/CHECKS
Normal file
@@ -0,0 +1 @@
|
||||
/ Heroku Multi Buildpack on Dokku
|
||||
@@ -1 +1 @@
|
||||
web: python app.py
|
||||
web: gunicorn app:app
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
#!/bin/bash
|
||||
set -e; curl -s $1 | grep -q "Heroku Multi Buildpack on Dokku"
|
||||
set -e; curl -s -S "$1" | grep -q "Heroku Multi Buildpack on Dokku"
|
||||
|
||||
@@ -1,17 +1,21 @@
|
||||
{
|
||||
"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",
|
||||
"bower": "^1.3.1",
|
||||
"grunt": "~0.4.5",
|
||||
"grunt-cli": "~0.1.13",
|
||||
"load-grunt-tasks": "~0.2.0",
|
||||
"grunt-contrib-compass": "~0.6.0"
|
||||
"grunt-contrib-compass": "~1.0.1",
|
||||
"load-grunt-tasks": "~1.0.0",
|
||||
"tmp": "0.0.23"
|
||||
},
|
||||
"description": "Test application for heroku multi buildpack.",
|
||||
"engines": {
|
||||
"node": "~0.10.30"
|
||||
},
|
||||
"license": "ISC",
|
||||
"name": "test-buildpack-multi",
|
||||
"scripts": {
|
||||
"postinstall": "./node_modules/bower/bin/bower --allow-root install && ./node_modules/grunt-cli/bin/grunt heroku"
|
||||
}
|
||||
"postinstall": "echo $PATH && ./node_modules/bower/bin/bower install --allow-root && ./node_modules/grunt-cli/bin/grunt --verbose --debug heroku"
|
||||
},
|
||||
"version": "0.0.0"
|
||||
}
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
Flask==0.10.1
|
||||
gunicorn==18.0
|
||||
|
||||
1
tests/apps/nodejs-express/CHECKS
Normal file
1
tests/apps/nodejs-express/CHECKS
Normal file
@@ -0,0 +1 @@
|
||||
/ nodejs/express
|
||||
@@ -1,2 +1,2 @@
|
||||
#!/bin/bash
|
||||
set -e; output="$(curl -s $1)"; echo $output; test "$output" == "nodejs/express"
|
||||
set -e; output="$(curl -s -S "$1")"; echo "$output"; test "$output" == "nodejs/express"
|
||||
|
||||
1
tests/apps/php/CHECKS
Normal file
1
tests/apps/php/CHECKS
Normal file
@@ -0,0 +1 @@
|
||||
/ <html><h3>php</h3></html>
|
||||
1
tests/apps/php/Procfile
Normal file
1
tests/apps/php/Procfile
Normal file
@@ -0,0 +1 @@
|
||||
web: vendor/heroku/heroku-buildpack-php/bin/heroku-php-apache2 web/
|
||||
@@ -1,2 +1,2 @@
|
||||
#!/bin/bash
|
||||
set -e; output="$(curl -s $1)"; echo $output; test "$output" == "<html><h3>php</h3></html>"
|
||||
set -e; output="$(curl -s -S "$1")"; echo "$output"; test "$output" == "<html><h3>php</h3></html>"
|
||||
|
||||
9
tests/apps/php/composer.json
Normal file
9
tests/apps/php/composer.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"require": {
|
||||
"monolog/monolog": "~1.7",
|
||||
"silex/silex": "~1.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"heroku/heroku-buildpack-php": "*"
|
||||
}
|
||||
}
|
||||
609
tests/apps/php/composer.lock
generated
Normal file
609
tests/apps/php/composer.lock
generated
Normal file
@@ -0,0 +1,609 @@
|
||||
{
|
||||
"_readme": [
|
||||
"This file locks the dependencies of your project to a known state",
|
||||
"Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"aliases": [],
|
||||
"hash": "be309b690b78816cf842ab863c0c7590",
|
||||
"minimum-stability": "stable",
|
||||
"packages": [
|
||||
{
|
||||
"authors": [
|
||||
{
|
||||
"email": "j.boggiano@seld.be",
|
||||
"homepage": "http://seld.be",
|
||||
"name": "Jordi Boggiano"
|
||||
}
|
||||
],
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Monolog\\": "src/Monolog"
|
||||
}
|
||||
},
|
||||
"description": "Sends your logs to files, sockets, inboxes, databases and various web services",
|
||||
"dist": {
|
||||
"reference": "ec3961874c43840e96da3a8a1ed20d8c73d7e5aa",
|
||||
"shasum": "",
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/Seldaek/monolog/zipball/ec3961874c43840e96da3a8a1ed20d8c73d7e5aa"
|
||||
},
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.11.x-dev"
|
||||
}
|
||||
},
|
||||
"homepage": "http://github.com/Seldaek/monolog",
|
||||
"keywords": [
|
||||
"log",
|
||||
"logging",
|
||||
"psr-3"
|
||||
],
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"name": "monolog/monolog",
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"provide": {
|
||||
"psr/log-implementation": "1.0.0"
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.0",
|
||||
"psr/log": "~1.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"aws/aws-sdk-php": "~2.4, >2.4.8",
|
||||
"doctrine/couchdb": "~1.0@dev",
|
||||
"graylog2/gelf-php": "~1.0",
|
||||
"phpunit/phpunit": "~3.7.0",
|
||||
"raven/raven": "~0.5",
|
||||
"ruflin/elastica": "0.90.*",
|
||||
"videlalvaro/php-amqplib": "~2.4"
|
||||
},
|
||||
"source": {
|
||||
"reference": "ec3961874c43840e96da3a8a1ed20d8c73d7e5aa",
|
||||
"type": "git",
|
||||
"url": "https://github.com/Seldaek/monolog.git"
|
||||
},
|
||||
"suggest": {
|
||||
"aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB",
|
||||
"doctrine/couchdb": "Allow sending log messages to a CouchDB server",
|
||||
"ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)",
|
||||
"ext-mongo": "Allow sending log messages to a MongoDB server",
|
||||
"graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server",
|
||||
"raven/raven": "Allow sending log messages to a Sentry server",
|
||||
"rollbar/rollbar": "Allow sending log messages to Rollbar",
|
||||
"ruflin/elastica": "Allow sending log messages to an Elastic Search server",
|
||||
"videlalvaro/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib"
|
||||
},
|
||||
"time": "2014-09-30 13:30:58",
|
||||
"type": "library",
|
||||
"version": "1.11.0"
|
||||
},
|
||||
{
|
||||
"authors": [
|
||||
{
|
||||
"email": "fabien@symfony.com",
|
||||
"homepage": "http://fabien.potencier.org",
|
||||
"name": "Fabien Potencier",
|
||||
"role": "Lead Developer"
|
||||
}
|
||||
],
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
"Pimple": "lib/"
|
||||
}
|
||||
},
|
||||
"description": "Pimple is a simple Dependency Injection Container for PHP 5.3",
|
||||
"dist": {
|
||||
"reference": "2019c145fe393923f3441b23f29bbdfaa5c58c4d",
|
||||
"shasum": "",
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/fabpot/Pimple/zipball/2019c145fe393923f3441b23f29bbdfaa5c58c4d"
|
||||
},
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.1.x-dev"
|
||||
}
|
||||
},
|
||||
"homepage": "http://pimple.sensiolabs.org",
|
||||
"keywords": [
|
||||
"container",
|
||||
"dependency injection"
|
||||
],
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"name": "pimple/pimple",
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"require": {
|
||||
"php": ">=5.3.0"
|
||||
},
|
||||
"source": {
|
||||
"reference": "2019c145fe393923f3441b23f29bbdfaa5c58c4d",
|
||||
"type": "git",
|
||||
"url": "https://github.com/fabpot/Pimple.git"
|
||||
},
|
||||
"time": "2013-11-22 08:30:29",
|
||||
"type": "library",
|
||||
"version": "v1.1.1"
|
||||
},
|
||||
{
|
||||
"authors": [
|
||||
{
|
||||
"homepage": "http://www.php-fig.org/",
|
||||
"name": "PHP-FIG"
|
||||
}
|
||||
],
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
"Psr\\Log\\": ""
|
||||
}
|
||||
},
|
||||
"description": "Common interface for logging libraries",
|
||||
"dist": {
|
||||
"reference": "fe0936ee26643249e916849d48e3a51d5f5e278b",
|
||||
"shasum": "",
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/php-fig/log/zipball/fe0936ee26643249e916849d48e3a51d5f5e278b"
|
||||
},
|
||||
"keywords": [
|
||||
"log",
|
||||
"psr",
|
||||
"psr-3"
|
||||
],
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"name": "psr/log",
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"source": {
|
||||
"reference": "fe0936ee26643249e916849d48e3a51d5f5e278b",
|
||||
"type": "git",
|
||||
"url": "https://github.com/php-fig/log.git"
|
||||
},
|
||||
"time": "2012-12-21 11:40:51",
|
||||
"type": "library",
|
||||
"version": "1.0.0"
|
||||
},
|
||||
{
|
||||
"authors": [
|
||||
{
|
||||
"email": "fabien@symfony.com",
|
||||
"name": "Fabien Potencier"
|
||||
},
|
||||
{
|
||||
"email": "igor@wiedler.ch",
|
||||
"name": "Igor Wiedler"
|
||||
}
|
||||
],
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
"Silex": "src/"
|
||||
}
|
||||
},
|
||||
"description": "The PHP micro-framework based on the Symfony2 Components",
|
||||
"dist": {
|
||||
"reference": "8c5e86eb97f3eee633729b22e950082fb5591328",
|
||||
"shasum": "",
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/silexphp/Silex/zipball/8c5e86eb97f3eee633729b22e950082fb5591328"
|
||||
},
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.2.x-dev"
|
||||
}
|
||||
},
|
||||
"homepage": "http://silex.sensiolabs.org",
|
||||
"keywords": [
|
||||
"microframework"
|
||||
],
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"name": "silex/silex",
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"require": {
|
||||
"php": ">=5.3.3",
|
||||
"pimple/pimple": "~1.0",
|
||||
"symfony/event-dispatcher": ">=2.3,<2.6-dev",
|
||||
"symfony/http-foundation": ">=2.3,<2.6-dev",
|
||||
"symfony/http-kernel": ">=2.3,<2.6-dev",
|
||||
"symfony/routing": ">=2.3,<2.6-dev"
|
||||
},
|
||||
"require-dev": {
|
||||
"doctrine/dbal": "~2.2",
|
||||
"monolog/monolog": "~1.4,>=1.4.1",
|
||||
"phpunit/phpunit": "~3.7",
|
||||
"swiftmailer/swiftmailer": "5.*",
|
||||
"symfony/browser-kit": ">=2.3,<2.6-dev",
|
||||
"symfony/config": ">=2.3,<2.6-dev",
|
||||
"symfony/css-selector": ">=2.3,<2.6-dev",
|
||||
"symfony/debug": ">=2.3,<2.6-dev",
|
||||
"symfony/dom-crawler": ">=2.3,<2.6-dev",
|
||||
"symfony/finder": ">=2.3,<2.6-dev",
|
||||
"symfony/form": ">=2.3,<2.6-dev",
|
||||
"symfony/locale": ">=2.3,<2.6-dev",
|
||||
"symfony/monolog-bridge": ">=2.3,<2.6-dev",
|
||||
"symfony/options-resolver": ">=2.3,<2.6-dev",
|
||||
"symfony/process": ">=2.3,<2.6-dev",
|
||||
"symfony/security": ">=2.3,<2.6-dev",
|
||||
"symfony/serializer": ">=2.3,<2.6-dev",
|
||||
"symfony/translation": ">=2.3,<2.6-dev",
|
||||
"symfony/twig-bridge": ">=2.3,<2.6-dev",
|
||||
"symfony/validator": ">=2.3,<2.6-dev",
|
||||
"twig/twig": ">=1.8.0,<2.0-dev"
|
||||
},
|
||||
"source": {
|
||||
"reference": "8c5e86eb97f3eee633729b22e950082fb5591328",
|
||||
"type": "git",
|
||||
"url": "https://github.com/silexphp/Silex.git"
|
||||
},
|
||||
"suggest": {
|
||||
"symfony/browser-kit": ">=2.3,<2.6-dev",
|
||||
"symfony/css-selector": ">=2.3,<2.6-dev",
|
||||
"symfony/dom-crawler": ">=2.3,<2.6-dev",
|
||||
"symfony/form": ">=2.3,<2.6-dev"
|
||||
},
|
||||
"time": "2014-09-26 09:32:30",
|
||||
"type": "library",
|
||||
"version": "v1.2.2"
|
||||
},
|
||||
{
|
||||
"authors": [
|
||||
{
|
||||
"homepage": "http://symfony.com/contributors",
|
||||
"name": "Symfony Community"
|
||||
},
|
||||
{
|
||||
"email": "fabien@symfony.com",
|
||||
"name": "Fabien Potencier"
|
||||
}
|
||||
],
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
"Symfony\\Component\\Debug\\": ""
|
||||
}
|
||||
},
|
||||
"description": "Symfony Debug Component",
|
||||
"dist": {
|
||||
"reference": "08b529b4c0aa3e746d187fe2a63f08cb955a3566",
|
||||
"shasum": "",
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/Debug/zipball/08b529b4c0aa3e746d187fe2a63f08cb955a3566"
|
||||
},
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "2.6-dev"
|
||||
}
|
||||
},
|
||||
"homepage": "http://symfony.com",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"name": "symfony/debug",
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"require": {
|
||||
"php": ">=5.3.3",
|
||||
"psr/log": "~1.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/http-foundation": "~2.1",
|
||||
"symfony/http-kernel": "~2.1"
|
||||
},
|
||||
"source": {
|
||||
"reference": "08b529b4c0aa3e746d187fe2a63f08cb955a3566",
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/Debug.git"
|
||||
},
|
||||
"suggest": {
|
||||
"symfony/http-foundation": "",
|
||||
"symfony/http-kernel": ""
|
||||
},
|
||||
"target-dir": "Symfony/Component/Debug",
|
||||
"time": "2014-12-02 20:19:20",
|
||||
"type": "library",
|
||||
"version": "v2.6.1"
|
||||
},
|
||||
{
|
||||
"authors": [
|
||||
{
|
||||
"homepage": "http://symfony.com/contributors",
|
||||
"name": "Symfony Community"
|
||||
},
|
||||
{
|
||||
"email": "fabien@symfony.com",
|
||||
"name": "Fabien Potencier"
|
||||
}
|
||||
],
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
"Symfony\\Component\\EventDispatcher\\": ""
|
||||
}
|
||||
},
|
||||
"description": "Symfony EventDispatcher Component",
|
||||
"dist": {
|
||||
"reference": "c0a15f7c45efc6506077c728658c16b579929bf8",
|
||||
"shasum": "",
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/c0a15f7c45efc6506077c728658c16b579929bf8"
|
||||
},
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "2.5-dev"
|
||||
}
|
||||
},
|
||||
"homepage": "http://symfony.com",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"name": "symfony/event-dispatcher",
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"require": {
|
||||
"php": ">=5.3.3"
|
||||
},
|
||||
"require-dev": {
|
||||
"psr/log": "~1.0",
|
||||
"symfony/config": "~2.0",
|
||||
"symfony/dependency-injection": "~2.0,<2.6.0",
|
||||
"symfony/stopwatch": "~2.2"
|
||||
},
|
||||
"source": {
|
||||
"reference": "c0a15f7c45efc6506077c728658c16b579929bf8",
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/EventDispatcher.git"
|
||||
},
|
||||
"suggest": {
|
||||
"symfony/dependency-injection": "",
|
||||
"symfony/http-kernel": ""
|
||||
},
|
||||
"target-dir": "Symfony/Component/EventDispatcher",
|
||||
"time": "2014-12-02 20:15:53",
|
||||
"type": "library",
|
||||
"version": "v2.5.8"
|
||||
},
|
||||
{
|
||||
"authors": [
|
||||
{
|
||||
"homepage": "http://symfony.com/contributors",
|
||||
"name": "Symfony Community"
|
||||
},
|
||||
{
|
||||
"email": "fabien@symfony.com",
|
||||
"name": "Fabien Potencier"
|
||||
}
|
||||
],
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
"Symfony/Component/HttpFoundation/Resources/stubs"
|
||||
],
|
||||
"psr-0": {
|
||||
"Symfony\\Component\\HttpFoundation\\": ""
|
||||
}
|
||||
},
|
||||
"description": "Symfony HttpFoundation Component",
|
||||
"dist": {
|
||||
"reference": "44dfbeb4fa64582d46c7bd59e325245d0b2b9fff",
|
||||
"shasum": "",
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/HttpFoundation/zipball/44dfbeb4fa64582d46c7bd59e325245d0b2b9fff"
|
||||
},
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "2.5-dev"
|
||||
}
|
||||
},
|
||||
"homepage": "http://symfony.com",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"name": "symfony/http-foundation",
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"require": {
|
||||
"php": ">=5.3.3"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/expression-language": "~2.4"
|
||||
},
|
||||
"source": {
|
||||
"reference": "44dfbeb4fa64582d46c7bd59e325245d0b2b9fff",
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/HttpFoundation.git"
|
||||
},
|
||||
"target-dir": "Symfony/Component/HttpFoundation",
|
||||
"time": "2014-12-02 20:15:53",
|
||||
"type": "library",
|
||||
"version": "v2.5.8"
|
||||
},
|
||||
{
|
||||
"authors": [
|
||||
{
|
||||
"homepage": "http://symfony.com/contributors",
|
||||
"name": "Symfony Community"
|
||||
},
|
||||
{
|
||||
"email": "fabien@symfony.com",
|
||||
"name": "Fabien Potencier"
|
||||
}
|
||||
],
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
"Symfony\\Component\\HttpKernel\\": ""
|
||||
}
|
||||
},
|
||||
"description": "Symfony HttpKernel Component",
|
||||
"dist": {
|
||||
"reference": "c16051a1f3d259f806115fd9897430ae162d19a0",
|
||||
"shasum": "",
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/HttpKernel/zipball/c16051a1f3d259f806115fd9897430ae162d19a0"
|
||||
},
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "2.5-dev"
|
||||
}
|
||||
},
|
||||
"homepage": "http://symfony.com",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"name": "symfony/http-kernel",
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"require": {
|
||||
"php": ">=5.3.3",
|
||||
"psr/log": "~1.0",
|
||||
"symfony/debug": "~2.5",
|
||||
"symfony/event-dispatcher": "~2.5",
|
||||
"symfony/http-foundation": "~2.5"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/browser-kit": "~2.2",
|
||||
"symfony/class-loader": "~2.1",
|
||||
"symfony/config": "~2.0",
|
||||
"symfony/console": "~2.2",
|
||||
"symfony/dependency-injection": "~2.0",
|
||||
"symfony/expression-language": "~2.4",
|
||||
"symfony/finder": "~2.0",
|
||||
"symfony/process": "~2.0",
|
||||
"symfony/routing": "~2.2",
|
||||
"symfony/stopwatch": "~2.2",
|
||||
"symfony/templating": "~2.2"
|
||||
},
|
||||
"source": {
|
||||
"reference": "c16051a1f3d259f806115fd9897430ae162d19a0",
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/HttpKernel.git"
|
||||
},
|
||||
"suggest": {
|
||||
"symfony/browser-kit": "",
|
||||
"symfony/class-loader": "",
|
||||
"symfony/config": "",
|
||||
"symfony/console": "",
|
||||
"symfony/dependency-injection": "",
|
||||
"symfony/finder": ""
|
||||
},
|
||||
"target-dir": "Symfony/Component/HttpKernel",
|
||||
"time": "2014-12-03 14:18:17",
|
||||
"type": "library",
|
||||
"version": "v2.5.8"
|
||||
},
|
||||
{
|
||||
"authors": [
|
||||
{
|
||||
"homepage": "http://symfony.com/contributors",
|
||||
"name": "Symfony Community"
|
||||
},
|
||||
{
|
||||
"email": "fabien@symfony.com",
|
||||
"name": "Fabien Potencier"
|
||||
}
|
||||
],
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
"Symfony\\Component\\Routing\\": ""
|
||||
}
|
||||
},
|
||||
"description": "Symfony Routing Component",
|
||||
"dist": {
|
||||
"reference": "9b7d9f6121e45243cc18e4ed682d8faa418d04bc",
|
||||
"shasum": "",
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/Routing/zipball/9b7d9f6121e45243cc18e4ed682d8faa418d04bc"
|
||||
},
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "2.5-dev"
|
||||
}
|
||||
},
|
||||
"homepage": "http://symfony.com",
|
||||
"keywords": [
|
||||
"router",
|
||||
"routing",
|
||||
"uri",
|
||||
"url"
|
||||
],
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"name": "symfony/routing",
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"require": {
|
||||
"php": ">=5.3.3"
|
||||
},
|
||||
"require-dev": {
|
||||
"doctrine/annotations": "~1.0",
|
||||
"psr/log": "~1.0",
|
||||
"symfony/config": "~2.2",
|
||||
"symfony/expression-language": "~2.4",
|
||||
"symfony/http-foundation": "~2.3",
|
||||
"symfony/yaml": "~2.0"
|
||||
},
|
||||
"source": {
|
||||
"reference": "9b7d9f6121e45243cc18e4ed682d8faa418d04bc",
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/Routing.git"
|
||||
},
|
||||
"suggest": {
|
||||
"doctrine/annotations": "For using the annotation loader",
|
||||
"symfony/config": "For using the all-in-one router or any loader",
|
||||
"symfony/expression-language": "For using expression matching",
|
||||
"symfony/yaml": "For using the YAML loader"
|
||||
},
|
||||
"target-dir": "Symfony/Component/Routing",
|
||||
"time": "2014-12-02 20:15:53",
|
||||
"type": "library",
|
||||
"version": "v2.5.8"
|
||||
}
|
||||
],
|
||||
"packages-dev": [
|
||||
{
|
||||
"authors": [
|
||||
{
|
||||
"email": "dz@heroku.com",
|
||||
"name": "David Zuelke"
|
||||
}
|
||||
],
|
||||
"bin": [
|
||||
"bin/heroku-hhvm-apache2",
|
||||
"bin/heroku-hhvm-nginx",
|
||||
"bin/heroku-php-apache2",
|
||||
"bin/heroku-php-nginx"
|
||||
],
|
||||
"description": "Toolkit for starting a PHP application locally, with or without foreman, using the same config for PHP/HHVM and Apache2/Nginx as on Heroku",
|
||||
"dist": {
|
||||
"reference": "dcfaa2445bdd977c7ea8b38059a86ee2265e9699",
|
||||
"shasum": "",
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/heroku/heroku-buildpack-php/zipball/dcfaa2445bdd977c7ea8b38059a86ee2265e9699"
|
||||
},
|
||||
"homepage": "http://github.com/heroku/heroku-buildpack-php",
|
||||
"keywords": [
|
||||
"apache",
|
||||
"apache2",
|
||||
"foreman",
|
||||
"heroku",
|
||||
"hhvm",
|
||||
"nginx",
|
||||
"php"
|
||||
],
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"name": "heroku/heroku-buildpack-php",
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"source": {
|
||||
"reference": "dcfaa2445bdd977c7ea8b38059a86ee2265e9699",
|
||||
"type": "git",
|
||||
"url": "https://github.com/heroku/heroku-buildpack-php.git"
|
||||
},
|
||||
"time": "2014-12-11 00:24:11",
|
||||
"type": "library",
|
||||
"version": "v50"
|
||||
}
|
||||
],
|
||||
"platform": [],
|
||||
"platform-dev": [],
|
||||
"prefer-lowest": false,
|
||||
"prefer-stable": false,
|
||||
"stability-flags": []
|
||||
}
|
||||
1
tests/apps/python-flask/CHECKS
Normal file
1
tests/apps/python-flask/CHECKS
Normal file
@@ -0,0 +1 @@
|
||||
/ python/flask
|
||||
@@ -1,2 +1,2 @@
|
||||
#!/bin/bash
|
||||
set -e; output="$(curl -s $1)"; echo $output; test "$output" == "python/flask"
|
||||
set -e; output="$(curl -s -S "$1")"; echo "$output"; test "$output" == "python/flask"
|
||||
|
||||
21
tests/apps/scala/LICENSE
Normal file
21
tests/apps/scala/LICENSE
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014 Joe Kutner
|
||||
|
||||
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.
|
||||
1
tests/apps/scala/Procfile
Normal file
1
tests/apps/scala/Procfile
Normal file
@@ -0,0 +1 @@
|
||||
web: target/universal/stage/bin/scala-getting-started
|
||||
33
tests/apps/scala/README.md
Normal file
33
tests/apps/scala/README.md
Normal file
@@ -0,0 +1,33 @@
|
||||
# scala-getting-started
|
||||
|
||||
A barebones Scala app, which can easily be deployed to Heroku.
|
||||
|
||||
This application support the [Getting Started with Scala on Heroku](https://devcenter.heroku.com/articles/getting-started-with-scala) article - check it out.
|
||||
|
||||
## Running Locally
|
||||
|
||||
Make sure you have Scala and sbt installed. Also, install the [Heroku Toolbelt](https://toolbelt.heroku.com/).
|
||||
|
||||
```sh
|
||||
$ git clone https://github.com/heroku/scala-getting-started.git
|
||||
$ cd scala-getting-started
|
||||
$ sbt compile stage
|
||||
$ foreman start web
|
||||
```
|
||||
|
||||
Your app should now be running on [localhost:5000](http://localhost:5000/).
|
||||
|
||||
## Deploying to Heroku
|
||||
|
||||
```sh
|
||||
$ heroku create
|
||||
$ git push heroku master
|
||||
$ heroku open
|
||||
```
|
||||
|
||||
## Documentation
|
||||
|
||||
For more information about using Scala on Heroku, see these Dev Center articles:
|
||||
|
||||
- [Scala on Heroku](https://devcenter.heroku.com/categories/scala)
|
||||
|
||||
14
tests/apps/scala/build.sbt
Normal file
14
tests/apps/scala/build.sbt
Normal file
@@ -0,0 +1,14 @@
|
||||
import NativePackagerKeys._
|
||||
|
||||
packageArchetype.java_application
|
||||
|
||||
name := """scala-getting-started"""
|
||||
|
||||
version := "1.0"
|
||||
|
||||
scalaVersion := "2.10.4"
|
||||
|
||||
libraryDependencies ++= Seq(
|
||||
"com.twitter" % "finagle-http_2.10" % "6.18.0",
|
||||
"postgresql" % "postgresql" % "9.0-801.jdbc4"
|
||||
)
|
||||
2
tests/apps/scala/check_deploy
Executable file
2
tests/apps/scala/check_deploy
Executable file
@@ -0,0 +1,2 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e; output="$(curl -s -S $1)"; echo $output; test "$output" == "Hello from Scala!"
|
||||
4
tests/apps/scala/project/build.properties
Normal file
4
tests/apps/scala/project/build.properties
Normal file
@@ -0,0 +1,4 @@
|
||||
#Activator-generated Properties
|
||||
#Wed Aug 13 09:36:12 CDT 2014
|
||||
template.uuid=a855816c-0367-44ba-9adb-6a903f6ad599
|
||||
sbt.version=0.13.5
|
||||
1
tests/apps/scala/project/plugins.sbt
Normal file
1
tests/apps/scala/project/plugins.sbt
Normal file
@@ -0,0 +1 @@
|
||||
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "0.7.4")
|
||||
65
tests/apps/scala/src/main/scala/com/example/Server.scala
Normal file
65
tests/apps/scala/src/main/scala/com/example/Server.scala
Normal file
@@ -0,0 +1,65 @@
|
||||
package com.example
|
||||
|
||||
import com.twitter.finagle.{Http, Service}
|
||||
import com.twitter.util.{Await, Future}
|
||||
import com.twitter.finagle.http.Response
|
||||
import java.net.InetSocketAddress
|
||||
import org.jboss.netty.handler.codec.http._
|
||||
import util.Properties
|
||||
import java.net.URI
|
||||
import java.sql.Connection
|
||||
import java.sql.DriverManager
|
||||
|
||||
object Server {
|
||||
def main(args: Array[String]) {
|
||||
val port = Properties.envOrElse("PORT", "8080").toInt
|
||||
println("Starting on port: "+port)
|
||||
|
||||
val server = Http.serve(":" + port, new Hello)
|
||||
Await.ready(server)
|
||||
}
|
||||
}
|
||||
|
||||
class Hello extends Service[HttpRequest, HttpResponse] {
|
||||
def apply(request: HttpRequest): Future[HttpResponse] = {
|
||||
if (request.getUri.endsWith("/db")) {
|
||||
showDatabase(request);
|
||||
} else {
|
||||
showHome(request);
|
||||
}
|
||||
}
|
||||
|
||||
def showHome(request: HttpRequest): Future[HttpResponse] = {
|
||||
val response = Response()
|
||||
response.setStatusCode(200)
|
||||
response.setContentString("Hello from Scala!")
|
||||
Future(response)
|
||||
}
|
||||
|
||||
def showDatabase(request: HttpRequest): Future[HttpResponse] = {
|
||||
val connection = getConnection
|
||||
val stmt = connection.createStatement
|
||||
stmt.executeUpdate("CREATE TABLE IF NOT EXISTS ticks (tick timestamp)")
|
||||
stmt.executeUpdate("INSERT INTO ticks VALUES (now())")
|
||||
|
||||
val rs = stmt.executeQuery("SELECT tick FROM ticks")
|
||||
|
||||
var out = ""
|
||||
while (rs.next) {
|
||||
out += "Read from DB: " + rs.getTimestamp("tick") + "\n"
|
||||
}
|
||||
|
||||
val response = Response()
|
||||
response.setStatusCode(200)
|
||||
response.setContentString(out)
|
||||
Future(response)
|
||||
}
|
||||
|
||||
def getConnection(): Connection = {
|
||||
val dbUri = new URI(System.getenv("DATABASE_URL"))
|
||||
val username = dbUri.getUserInfo.split(":")(0)
|
||||
val password = dbUri.getUserInfo.split(":")(1)
|
||||
val dbUrl = "jdbc:postgresql://" + dbUri.getHost + dbUri.getPath
|
||||
DriverManager.getConnection(dbUrl, username, password)
|
||||
}
|
||||
}
|
||||
1
tests/apps/scala/system.properties
Normal file
1
tests/apps/scala/system.properties
Normal file
@@ -0,0 +1 @@
|
||||
java.runtime.version=1.7
|
||||
1
tests/apps/static/.env
Normal file
1
tests/apps/static/.env
Normal file
@@ -0,0 +1 @@
|
||||
export BUILDPACK_URL=https://github.com/florianheinemann/buildpack-nginx
|
||||
1
tests/apps/static/CHECKS
Normal file
1
tests/apps/static/CHECKS
Normal file
@@ -0,0 +1 @@
|
||||
/ Static Page
|
||||
@@ -1,2 +1,2 @@
|
||||
#!/bin/bash
|
||||
set -e; output="$(curl -s $1)"; echo $output; test "$output" == "<html><h3>Static Page</h3></html>"
|
||||
set -e; output="$(curl -s -S "$1")"; echo "$output"; test "$output" == "<html><h3>Static Page</h3></html>"
|
||||
|
||||
@@ -22,7 +22,8 @@ if [[ $2 == *dokku* ]]; then
|
||||
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
|
||||
PUBLIC_KEY=$(< /root/.ssh/id_rsa.pub)
|
||||
echo $PUBLIC_KEY | 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"
|
||||
|
||||
10
tests/deploy/config.bats
Normal file
10
tests/deploy/config.bats
Normal file
@@ -0,0 +1,10 @@
|
||||
#!/usr/bin/env bats
|
||||
|
||||
load ../unit/test_helper
|
||||
|
||||
@test "deploy config app" {
|
||||
run bash -c "cd tests && ./test_deploy ./apps/config dokku.me"
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
assert_success
|
||||
}
|
||||
10
tests/deploy/gitsubmodules.bats
Normal file
10
tests/deploy/gitsubmodules.bats
Normal file
@@ -0,0 +1,10 @@
|
||||
#!/usr/bin/env bats
|
||||
|
||||
load ../unit/test_helper
|
||||
|
||||
@test "deploy gitsubmodules app" {
|
||||
run bash -c "cd tests && ./test_deploy ./apps/gitsubmodules dokku.me"
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
assert_success
|
||||
}
|
||||
10
tests/deploy/go.bats
Normal file
10
tests/deploy/go.bats
Normal file
@@ -0,0 +1,10 @@
|
||||
#!/usr/bin/env bats
|
||||
|
||||
load ../unit/test_helper
|
||||
|
||||
@test "deploy go app" {
|
||||
run bash -c "cd tests && ./test_deploy ./apps/go dokku.me"
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
assert_success
|
||||
}
|
||||
10
tests/deploy/java.bats
Normal file
10
tests/deploy/java.bats
Normal file
@@ -0,0 +1,10 @@
|
||||
#!/usr/bin/env bats
|
||||
|
||||
load ../unit/test_helper
|
||||
|
||||
@test "deploy java app" {
|
||||
run bash -c "cd tests && ./test_deploy ./apps/java dokku.me"
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
assert_success
|
||||
}
|
||||
10
tests/deploy/multi.bats
Normal file
10
tests/deploy/multi.bats
Normal file
@@ -0,0 +1,10 @@
|
||||
#!/usr/bin/env bats
|
||||
|
||||
load ../unit/test_helper
|
||||
|
||||
@test "deploy multi app" {
|
||||
run bash -c "cd tests && ./test_deploy ./apps/multi dokku.me"
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
assert_success
|
||||
}
|
||||
10
tests/deploy/nodejs-express.bats
Normal file
10
tests/deploy/nodejs-express.bats
Normal file
@@ -0,0 +1,10 @@
|
||||
#!/usr/bin/env bats
|
||||
|
||||
load ../unit/test_helper
|
||||
|
||||
@test "deploy nodejs-express app" {
|
||||
run bash -c "cd tests && ./test_deploy ./apps/nodejs-express dokku.me"
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
assert_success
|
||||
}
|
||||
11
tests/deploy/php.bats
Normal file
11
tests/deploy/php.bats
Normal file
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env bats
|
||||
|
||||
load ../unit/test_helper
|
||||
|
||||
@test "deploy php app" {
|
||||
skip "fails. ref: https://github.com/progrium/buildstep/issues/126"
|
||||
run bash -c "cd tests && ./test_deploy ./apps/php dokku.me"
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
assert_success
|
||||
}
|
||||
10
tests/deploy/python-flask.bats
Normal file
10
tests/deploy/python-flask.bats
Normal file
@@ -0,0 +1,10 @@
|
||||
#!/usr/bin/env bats
|
||||
|
||||
load ../unit/test_helper
|
||||
|
||||
@test "deploy python-flask app" {
|
||||
run bash -c "cd tests && ./test_deploy ./apps/python-flask dokku.me"
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
assert_success
|
||||
}
|
||||
11
tests/deploy/static.bats
Normal file
11
tests/deploy/static.bats
Normal file
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env bats
|
||||
|
||||
load ../unit/test_helper
|
||||
|
||||
@test "deploy static app" {
|
||||
skip "fails on apt-get update..."
|
||||
run bash -c "cd tests && ./test_deploy ./apps/static dokku.me"
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
assert_success
|
||||
}
|
||||
@@ -4,7 +4,7 @@ KEYNAME="$1"
|
||||
indent() { sed "s/^/ /"; }
|
||||
echo "-----> Booting EC2 instance..."
|
||||
start=$(ec2-run-instances -k $1 ami-f3d1bb9a 2>&1 )
|
||||
if [[ $? > 0 ]]; then
|
||||
if [[ $? -gt 0 ]]; then
|
||||
echo "$start" | indent
|
||||
exit 3
|
||||
fi
|
||||
@@ -34,9 +34,10 @@ while [[ ! $(echo | nc $PUBLIC_IP 22) ]]; do
|
||||
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
|
||||
ssh -o "StrictHostKeyChecking=no" ubuntu@$PUBLIC_IP "HOSTNAME=\$PUBLIC_IP sudo bash" < ../bootstrap.sh 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
|
||||
PUBLIC_KEY=$(< ~/.ssh/id_rsa.pub)
|
||||
echo $PUBLIC_KEY | 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..."
|
||||
|
||||
@@ -1,23 +1,26 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail
|
||||
SELF=`which $0`
|
||||
SELF=$(which $0)
|
||||
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
|
||||
if ! grep dokku.me ~/.ssh/config 2>/dev/null; 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
|
||||
{
|
||||
echo "Host dokku.me"
|
||||
echo " Port $VAGRANT_SSH_PORT"
|
||||
echo " RequestTTY yes"
|
||||
} >> ~/.ssh/config
|
||||
fi
|
||||
echo "-----> Ensuring Vagrant is running..."
|
||||
pushd $PWD > /dev/null
|
||||
cd "$(dirname $SELF)/.." && vagrant up | indent
|
||||
cd "$(dirname $SELF)"
|
||||
popd > /dev/null
|
||||
|
||||
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"
|
||||
ssh -o "StrictHostKeyChecking=no" -i ~/.vagrant.d/insecure_private_key vagrant@dokku.me "sudo sshcommand acl-add dokku test" < $PUBLIC_KEY
|
||||
|
||||
for app_path in apps/*; do
|
||||
app=$(basename $app_path)
|
||||
|
||||
@@ -1,12 +1,23 @@
|
||||
#!/usr/bin/env bash
|
||||
set -exo pipefail
|
||||
SELF=`which $0`; APP="$1"; TARGET="$2"; FORWARDED_PORT="$3"
|
||||
set -eo pipefail
|
||||
|
||||
SELF=$(which $0); APP="$1"; TARGET="$2"; FORWARDED_PORT="$3"
|
||||
REMOTE="dokku@$TARGET"
|
||||
REPO="test-$(basename $APP)-$RANDOM"
|
||||
|
||||
destroy_app(){
|
||||
echo $REPO | ssh $REMOTE apps:destroy $REPO
|
||||
}
|
||||
|
||||
failed(){
|
||||
echo "************ $1 failed ************"
|
||||
dokku logs $REPO
|
||||
destroy_app
|
||||
exit 1
|
||||
}
|
||||
|
||||
TMP=$(mktemp -d -t "$TARGET.XXXXX")
|
||||
trap "rm -rf $TMP" EXIT
|
||||
rmdir $TMP && cp -r $(dirname $SELF)/$APP $TMP
|
||||
rmdir $TMP && cp -r "$(dirname "$SELF")"/$APP $TMP
|
||||
cd $TMP
|
||||
git init
|
||||
git config user.email "robot@example.com"
|
||||
@@ -18,14 +29,23 @@ git add .
|
||||
|
||||
[[ -x pre-commit ]] && ./pre-commit $REMOTE $REPO
|
||||
git commit -m 'initial commit'
|
||||
git push target master
|
||||
[[ -x post-deploy ]] && ./post-deploy $REMOTE $REPO
|
||||
git push target master || failed git-push
|
||||
if [[ -x post-deploy ]]; then
|
||||
./post-deploy $REMOTE $REPO || failed post-deploy
|
||||
fi
|
||||
|
||||
URL=$(ssh $REMOTE url $REPO)$FORWARDED_PORT
|
||||
URL=$(dokku url $REPO)$FORWARDED_PORT
|
||||
sleep 2
|
||||
./check_deploy $URL && echo "-----> Deploy success!" || {
|
||||
if (./check_deploy $URL); then
|
||||
echo "-----> Deploy success!"
|
||||
else
|
||||
sleep 4
|
||||
./check_deploy $URL && echo "-----> Deploy success!"
|
||||
}
|
||||
if (./check_deploy $URL); then
|
||||
echo "-----> Deploy success!"
|
||||
else
|
||||
failed check-deploy
|
||||
fi
|
||||
fi
|
||||
|
||||
ssh $REMOTE delete $REPO
|
||||
dokku logs $REPO
|
||||
destroy_app
|
||||
|
||||
37
tests/unit/00_dokku-standard.bats
Normal file
37
tests/unit/00_dokku-standard.bats
Normal file
@@ -0,0 +1,37 @@
|
||||
#!/usr/bin/env bats
|
||||
|
||||
load test_helper
|
||||
|
||||
setup() {
|
||||
create_app
|
||||
}
|
||||
|
||||
teardown() {
|
||||
rm -rf /home/dokku/$TEST_APP/tls /home/dokku/tls
|
||||
destroy_app
|
||||
}
|
||||
|
||||
@test "urls (non-ssl)" {
|
||||
run bash -c "dokku urls $TEST_APP | grep dokku.me"
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
assert_output "http://dokku.me"
|
||||
}
|
||||
|
||||
@test "urls (app ssl)" {
|
||||
mkdir -p /home/dokku/$TEST_APP/tls
|
||||
touch /home/dokku/$TEST_APP/tls/server.crt /home/dokku/$TEST_APP/tls/server.key
|
||||
run bash -c "dokku urls $TEST_APP | grep dokku.me"
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
assert_output "https://dokku.me"
|
||||
}
|
||||
|
||||
@test "urls (wildcard ssl)" {
|
||||
mkdir -p /home/dokku/tls
|
||||
touch /home/dokku/tls/server.crt /home/dokku/tls/server.key
|
||||
run bash -c "dokku urls $TEST_APP | grep dokku.me"
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
assert_output "https://dokku.me"
|
||||
}
|
||||
26
tests/unit/apps.bats
Executable file
26
tests/unit/apps.bats
Executable file
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env bats
|
||||
|
||||
load test_helper
|
||||
|
||||
APP=lifecycle-app
|
||||
|
||||
@test "apps:create" {
|
||||
run dokku apps:create $APP
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "apps" {
|
||||
run bash -c "dokku apps | grep $APP"
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
assert_output $APP
|
||||
}
|
||||
|
||||
@test "apps:destroy" {
|
||||
run bash -c "echo $APP | dokku apps:destroy $APP"
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
assert_success
|
||||
}
|
||||
20
tests/unit/backup.bats
Normal file
20
tests/unit/backup.bats
Normal file
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env bats
|
||||
|
||||
# load test_helper
|
||||
|
||||
# setup() {
|
||||
# create_app
|
||||
# backup_file=$(mktemp /tmp/backup.XXXXXX)
|
||||
# rm $backup_file
|
||||
# }
|
||||
|
||||
# teardown() {
|
||||
# destroy_app
|
||||
# }
|
||||
|
||||
# @test "backup:export" {
|
||||
# run dokku backup:export $backup_file
|
||||
# echo "output: "$output
|
||||
# echo "status: "$status
|
||||
# assert_success
|
||||
# }
|
||||
21
tests/unit/build-env.bats
Normal file
21
tests/unit/build-env.bats
Normal file
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env bats
|
||||
|
||||
load test_helper
|
||||
|
||||
setup() {
|
||||
create_app
|
||||
}
|
||||
|
||||
teardown() {
|
||||
destroy_app
|
||||
}
|
||||
|
||||
@test "build-env with special chars" {
|
||||
run dokku config:set $TEST_APP NEWRELIC_APP_NAME="$TEST_APP (Staging)"
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
assert_success
|
||||
deploy_app
|
||||
run dokku config $TEST_APP
|
||||
assert_success
|
||||
}
|
||||
44
tests/unit/config.bats
Normal file
44
tests/unit/config.bats
Normal file
@@ -0,0 +1,44 @@
|
||||
#!/usr/bin/env bats
|
||||
|
||||
load test_helper
|
||||
|
||||
setup() {
|
||||
create_app
|
||||
}
|
||||
|
||||
teardown() {
|
||||
destroy_app
|
||||
}
|
||||
|
||||
@test "config:set" {
|
||||
run ssh dokku@dokku.me config:set $TEST_APP test_var=true test_var2=\"hello world\"
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "config:get" {
|
||||
run ssh dokku@dokku.me config:set $TEST_APP test_var=true test_var2=\"hello world\"
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
run dokku config:get $TEST_APP test_var2
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
assert_output 'hello world'
|
||||
}
|
||||
|
||||
@test "config:unset" {
|
||||
run ssh dokku@dokku.me config:set $TEST_APP test_var=true test_var2=\"hello world\"
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
run dokku config:get $TEST_APP test_var
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
run dokku config:unset $TEST_APP test_var
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
run dokku config:get $TEST_APP test_var
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
assert_output ""
|
||||
}
|
||||
51
tests/unit/domains.bats
Normal file
51
tests/unit/domains.bats
Normal file
@@ -0,0 +1,51 @@
|
||||
#!/usr/bin/env bats
|
||||
|
||||
load test_helper
|
||||
|
||||
setup() {
|
||||
deploy_app
|
||||
}
|
||||
|
||||
teardown() {
|
||||
destroy_app
|
||||
}
|
||||
|
||||
@test "domains" {
|
||||
run bash -c "dokku domains $TEST_APP | grep ${TEST_APP}.dokku.me"
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
assert_output "${TEST_APP}.dokku.me"
|
||||
}
|
||||
|
||||
@test "domains:add" {
|
||||
run dokku domains:add $TEST_APP www.test.app.dokku.me
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
assert_success
|
||||
run dokku domains:add $TEST_APP test.app.dokku.me
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "domains:remove" {
|
||||
run dokku domains:add $TEST_APP test.app.dokku.me
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
assert_success
|
||||
run dokku domains:remove $TEST_APP test.app.dokku.me
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
refute_line "test.app.dokku.me"
|
||||
}
|
||||
|
||||
@test "domains:clear" {
|
||||
run dokku domains:add $TEST_APP test.app.dokku.me
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
assert_success
|
||||
run dokku domains:clear $TEST_APP
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
assert_success
|
||||
}
|
||||
20
tests/unit/nginx-vhosts.bats
Normal file
20
tests/unit/nginx-vhosts.bats
Normal file
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env bats
|
||||
|
||||
load test_helper
|
||||
|
||||
setup() {
|
||||
create_app
|
||||
setup_test_tls
|
||||
deploy_app
|
||||
}
|
||||
|
||||
teardown() {
|
||||
destroy_app
|
||||
}
|
||||
|
||||
@test "nginx:build-config (with SSL CN mismatch)" {
|
||||
run /bin/bash -c "dokku domains $TEST_APP | grep node-js-app.dokku.me"
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
assert_output "node-js-app.dokku.me"
|
||||
}
|
||||
BIN
tests/unit/server_ssl.tar
Normal file
BIN
tests/unit/server_ssl.tar
Normal file
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user