Compare commits
34 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
197f0c7c95 | ||
|
|
ef2682945c | ||
|
|
5e7ea4217f | ||
|
|
123fbea7c0 | ||
|
|
0673fdff2d | ||
|
|
e07befb93c | ||
|
|
8e1f890322 | ||
|
|
8ca713f6bb | ||
|
|
da1ddee0ba | ||
|
|
d48cf24c4d | ||
|
|
5614475521 | ||
|
|
b826770687 | ||
|
|
34807028db | ||
|
|
0405b36ab4 | ||
|
|
291f59999c | ||
|
|
1568fc7827 | ||
|
|
681fd6abf6 | ||
|
|
031159c1b9 | ||
|
|
812e34c6f5 | ||
|
|
5921692f83 | ||
|
|
33d5dd44d9 | ||
|
|
d7562d36e6 | ||
|
|
49a2f8ab82 | ||
|
|
82afae6447 | ||
|
|
25ab915883 | ||
|
|
0963c403ab | ||
|
|
9c1852fcdb | ||
|
|
a6aef82236 | ||
|
|
8b4e31bb22 | ||
|
|
7c923a0fa1 | ||
|
|
169f202994 | ||
|
|
4448e60a8b | ||
|
|
c744c25d35 | ||
|
|
f9ebdae66d |
34
HISTORY.md
34
HISTORY.md
@@ -1,5 +1,39 @@
|
|||||||
# History
|
# History
|
||||||
|
|
||||||
|
## 0.23.3
|
||||||
|
|
||||||
|
Install/update via the bootstrap script:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
wget https://raw.githubusercontent.com/dokku/dokku/v0.23.3/bootstrap.sh
|
||||||
|
sudo DOKKU_TAG=v0.23.3 bash bootstrap.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- #4397: @josegonzalez Correctly handle environment variables in deployment tasks for Cloud Native Buildpacks
|
||||||
|
- #4394: @josegonzalez Swap order of arguments on config-get call
|
||||||
|
|
||||||
|
### New Features
|
||||||
|
|
||||||
|
- #4395: @josegonzalez Add environment variable support to CNB-based containers
|
||||||
|
|
||||||
|
### Refactors
|
||||||
|
|
||||||
|
- #4393: @josegonzalez Use docker-image-labeler in cnb builder-build trigger
|
||||||
|
|
||||||
|
### Documentation
|
||||||
|
|
||||||
|
- #4396: @nerg4l Invalid link to Herokuish Buildpack Deployment in Cloud Native Buildpacks
|
||||||
|
|
||||||
|
### Tests
|
||||||
|
|
||||||
|
- #4390: @josegonzalez Run tests faster by not cloning the buildpack each time
|
||||||
|
|
||||||
|
### Other
|
||||||
|
|
||||||
|
- #4389: @dependabot-preview[bot] chore(deps-dev): bump heroku/heroku-buildpack-php from 188 to 189 in /tests/apps/php
|
||||||
|
|
||||||
## 0.23.2
|
## 0.23.2
|
||||||
|
|
||||||
Install/update via the bootstrap script:
|
Install/update via the bootstrap script:
|
||||||
|
|||||||
2
Makefile
2
Makefile
@@ -1,7 +1,7 @@
|
|||||||
DOKKU_VERSION ?= master
|
DOKKU_VERSION ?= master
|
||||||
|
|
||||||
DOCKER_IMAGE_LABELER_VERSION ?= 0.2.2
|
DOCKER_IMAGE_LABELER_VERSION ?= 0.2.2
|
||||||
HEROKUISH_VERSION ?= 0.5.19
|
HEROKUISH_VERSION ?= 0.5.25
|
||||||
PLUGN_VERSION ?= 0.6.1
|
PLUGN_VERSION ?= 0.6.1
|
||||||
PROCFILE_VERSION ?= 0.11.0
|
PROCFILE_VERSION ?= 0.11.0
|
||||||
SIGIL_VERSION ?= 0.6.0
|
SIGIL_VERSION ?= 0.6.0
|
||||||
|
|||||||
@@ -99,8 +99,8 @@ Otherwise, you will need to import the keypair manually after installation using
|
|||||||
To install the latest stable release, run the following commands as a user who has access to `sudo`:
|
To install the latest stable release, run the following commands as a user who has access to `sudo`:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
wget https://raw.githubusercontent.com/dokku/dokku/v0.23.2/bootstrap.sh
|
wget https://raw.githubusercontent.com/dokku/dokku/v0.23.3/bootstrap.sh
|
||||||
sudo DOKKU_TAG=v0.23.2 bash bootstrap.sh
|
sudo DOKKU_TAG=v0.23.3 bash bootstrap.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
You can then proceed to the ip address or domain name associated with your server to complete the web-based installation.
|
You can then proceed to the ip address or domain name associated with your server to complete the web-based installation.
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import subprocess
|
|||||||
import sys
|
import sys
|
||||||
import threading
|
import threading
|
||||||
|
|
||||||
VERSION = 'v0.23.2'
|
VERSION = 'v0.23.3'
|
||||||
|
|
||||||
def bytes_to_string(b):
|
def bytes_to_string(b):
|
||||||
if type(b) == bytes:
|
if type(b) == bytes:
|
||||||
|
|||||||
2
debian/control
vendored
2
debian/control
vendored
@@ -1,5 +1,5 @@
|
|||||||
Package: dokku
|
Package: dokku
|
||||||
Version: 0.23.2
|
Version: 0.23.3
|
||||||
Section: web
|
Section: web
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Architecture: amd64
|
Architecture: amd64
|
||||||
|
|||||||
@@ -35,35 +35,35 @@ dokku plugin:list
|
|||||||
|
|
||||||
```
|
```
|
||||||
plugn: dev
|
plugn: dev
|
||||||
00_dokku-standard 0.23.2 enabled dokku core standard plugin
|
00_dokku-standard 0.23.3 enabled dokku core standard plugin
|
||||||
20_events 0.23.2 enabled dokku core events logging plugin
|
20_events 0.23.3 enabled dokku core events logging plugin
|
||||||
app-json 0.23.2 enabled dokku core app-json plugin
|
app-json 0.23.3 enabled dokku core app-json plugin
|
||||||
apps 0.23.2 enabled dokku core apps plugin
|
apps 0.23.3 enabled dokku core apps plugin
|
||||||
build-env 0.23.2 enabled dokku core build-env plugin
|
build-env 0.23.3 enabled dokku core build-env plugin
|
||||||
buildpacks 0.23.2 enabled dokku core buildpacks plugin
|
buildpacks 0.23.3 enabled dokku core buildpacks plugin
|
||||||
certs 0.23.2 enabled dokku core certificate management plugin
|
certs 0.23.3 enabled dokku core certificate management plugin
|
||||||
checks 0.23.2 enabled dokku core checks plugin
|
checks 0.23.3 enabled dokku core checks plugin
|
||||||
common 0.23.2 enabled dokku core common plugin
|
common 0.23.3 enabled dokku core common plugin
|
||||||
config 0.23.2 enabled dokku core config plugin
|
config 0.23.3 enabled dokku core config plugin
|
||||||
docker-options 0.23.2 enabled dokku core docker-options plugin
|
docker-options 0.23.3 enabled dokku core docker-options plugin
|
||||||
domains 0.23.2 enabled dokku core domains plugin
|
domains 0.23.3 enabled dokku core domains plugin
|
||||||
enter 0.23.2 enabled dokku core enter plugin
|
enter 0.23.3 enabled dokku core enter plugin
|
||||||
git 0.23.2 enabled dokku core git plugin
|
git 0.23.3 enabled dokku core git plugin
|
||||||
logs 0.23.2 enabled dokku core logs plugin
|
logs 0.23.3 enabled dokku core logs plugin
|
||||||
network 0.23.2 enabled dokku core network plugin
|
network 0.23.3 enabled dokku core network plugin
|
||||||
nginx-vhosts 0.23.2 enabled dokku core nginx-vhosts plugin
|
nginx-vhosts 0.23.3 enabled dokku core nginx-vhosts plugin
|
||||||
plugin 0.23.2 enabled dokku core plugin plugin
|
plugin 0.23.3 enabled dokku core plugin plugin
|
||||||
proxy 0.23.2 enabled dokku core proxy plugin
|
proxy 0.23.3 enabled dokku core proxy plugin
|
||||||
ps 0.23.2 enabled dokku core ps plugin
|
ps 0.23.3 enabled dokku core ps plugin
|
||||||
repo 0.23.2 enabled dokku core repo plugin
|
repo 0.23.3 enabled dokku core repo plugin
|
||||||
resource 0.23.2 enabled dokku core resource plugin
|
resource 0.23.3 enabled dokku core resource plugin
|
||||||
scheduler-docker-local 0.23.2 enabled dokku core scheduler-docker-local plugin
|
scheduler-docker-local 0.23.3 enabled dokku core scheduler-docker-local plugin
|
||||||
shell 0.23.2 enabled dokku core shell plugin
|
shell 0.23.3 enabled dokku core shell plugin
|
||||||
ssh-keys 0.23.2 enabled dokku core ssh-keys plugin
|
ssh-keys 0.23.3 enabled dokku core ssh-keys plugin
|
||||||
storage 0.23.2 enabled dokku core storage plugin
|
storage 0.23.3 enabled dokku core storage plugin
|
||||||
tags 0.23.2 enabled dokku core tags plugin
|
tags 0.23.3 enabled dokku core tags plugin
|
||||||
tar 0.23.2 enabled dokku core tar plugin
|
tar 0.23.3 enabled dokku core tar plugin
|
||||||
trace 0.23.2 enabled dokku core trace plugin
|
trace 0.23.3 enabled dokku core trace plugin
|
||||||
```
|
```
|
||||||
|
|
||||||
> Warning: All plugin commands other than `plugin:list` and `plugin:help` require sudo access and must be run directly from the Dokku server.
|
> Warning: All plugin commands other than `plugin:list` and `plugin:help` require sudo access and must be run directly from the Dokku server.
|
||||||
|
|||||||
@@ -2,10 +2,10 @@
|
|||||||
<browserconfig>
|
<browserconfig>
|
||||||
<msapplication>
|
<msapplication>
|
||||||
<tile>
|
<tile>
|
||||||
<square70x70logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.2/docs/assets/favicons/mstile-70x70.png"/>
|
<square70x70logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.3/docs/assets/favicons/mstile-70x70.png"/>
|
||||||
<square150x150logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.2/docs/assets/favicons/mstile-150x150.png"/>
|
<square150x150logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.3/docs/assets/favicons/mstile-150x150.png"/>
|
||||||
<square310x310logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.2/docs/assets/favicons/mstile-310x310.png"/>
|
<square310x310logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.3/docs/assets/favicons/mstile-310x310.png"/>
|
||||||
<wide310x150logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.2/docs/assets/favicons/mstile-310x150.png"/>
|
<wide310x150logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.3/docs/assets/favicons/mstile-310x150.png"/>
|
||||||
<TileColor>#da532c</TileColor>
|
<TileColor>#da532c</TileColor>
|
||||||
</tile>
|
</tile>
|
||||||
</msapplication>
|
</msapplication>
|
||||||
|
|||||||
@@ -2,37 +2,37 @@
|
|||||||
"name": "Dokku",
|
"name": "Dokku",
|
||||||
"icons": [
|
"icons": [
|
||||||
{
|
{
|
||||||
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.23.2\/docs\/assets\/favicons\/android-chrome-36x36.png",
|
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.23.3\/docs\/assets\/favicons\/android-chrome-36x36.png",
|
||||||
"sizes": "36x36",
|
"sizes": "36x36",
|
||||||
"type": "image\/png",
|
"type": "image\/png",
|
||||||
"density": "0.75"
|
"density": "0.75"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.23.2\/docs\/assets\/favicons\/android-chrome-48x48.png",
|
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.23.3\/docs\/assets\/favicons\/android-chrome-48x48.png",
|
||||||
"sizes": "48x48",
|
"sizes": "48x48",
|
||||||
"type": "image\/png",
|
"type": "image\/png",
|
||||||
"density": "1.0"
|
"density": "1.0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.23.2\/docs\/assets\/favicons\/android-chrome-72x72.png",
|
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.23.3\/docs\/assets\/favicons\/android-chrome-72x72.png",
|
||||||
"sizes": "72x72",
|
"sizes": "72x72",
|
||||||
"type": "image\/png",
|
"type": "image\/png",
|
||||||
"density": "1.5"
|
"density": "1.5"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.23.2\/docs\/assets\/favicons\/android-chrome-96x96.png",
|
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.23.3\/docs\/assets\/favicons\/android-chrome-96x96.png",
|
||||||
"sizes": "96x96",
|
"sizes": "96x96",
|
||||||
"type": "image\/png",
|
"type": "image\/png",
|
||||||
"density": "2.0"
|
"density": "2.0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.23.2\/docs\/assets\/favicons\/android-chrome-144x144.png",
|
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.23.3\/docs\/assets\/favicons\/android-chrome-144x144.png",
|
||||||
"sizes": "144x144",
|
"sizes": "144x144",
|
||||||
"type": "image\/png",
|
"type": "image\/png",
|
||||||
"density": "3.0"
|
"density": "3.0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.23.2\/docs\/assets\/favicons\/android-chrome-192x192.png",
|
"src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.23.3\/docs\/assets\/favicons\/android-chrome-192x192.png",
|
||||||
"sizes": "192x192",
|
"sizes": "192x192",
|
||||||
"type": "image\/png",
|
"type": "image\/png",
|
||||||
"density": "4.0"
|
"density": "4.0"
|
||||||
|
|||||||
@@ -39,13 +39,13 @@ h1 {
|
|||||||
font-size: 1.6em;
|
font-size: 1.6em;
|
||||||
}
|
}
|
||||||
.header .navbar-brand a {
|
.header .navbar-brand a {
|
||||||
background-image: url(https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.2/docs/assets/dokku.png);
|
background-image: url(https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.3/docs/assets/dokku.png);
|
||||||
text-indent: 40px;
|
text-indent: 40px;
|
||||||
}
|
}
|
||||||
.blurb {
|
.blurb {
|
||||||
color: #424242;
|
color: #424242;
|
||||||
background-color: #ededed;
|
background-color: #ededed;
|
||||||
background-image: url(https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.2/docs/assets/gplaypattern.png);
|
background-image: url(https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.3/docs/assets/gplaypattern.png);
|
||||||
padding: 45px 0;
|
padding: 45px 0;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,6 @@
|
|||||||
"0.20.4",
|
"0.20.4",
|
||||||
"0.21.4",
|
"0.21.4",
|
||||||
"0.22.9",
|
"0.22.9",
|
||||||
"0.23.2"
|
"0.23.3"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
```
|
```
|
||||||
buildpacks:set-property [--global|<app>] <key> <value> # Set or clear a buildpacks property for an app
|
buildpacks:set-property [--global|<app>] <key> <value> # Set or clear a buildpacks property for an app
|
||||||
```
|
```
|
||||||
Cloud Native Buildpacks are an evolution over the Buildpacks technology provided by the Herokuish builder. See the [herokuish buildpacks documentation](/docs/deployment/methods/herokuish.md) for more information on how to clear buildpack build cache for an application.
|
Cloud Native Buildpacks are an evolution over the Buildpacks technology provided by the Herokuish builder. See the [herokuish buildpacks documentation](/docs/deployment/methods/herokuish-buildpacks.md) for more information on how to clear buildpack build cache for an application.
|
||||||
|
|
||||||
> Warning: This functionality uses the `pack` cli from the [Cloud Native Buildpacks](https://buildpacks.io) project to build apps. As the integration is experimental in Dokku, it is likely to change over time.
|
> Warning: This functionality uses the `pack` cli from the [Cloud Native Buildpacks](https://buildpacks.io) project to build apps. As the integration is experimental in Dokku, it is likely to change over time.
|
||||||
|
|
||||||
|
|||||||
@@ -261,6 +261,21 @@ help_content
|
|||||||
esac
|
esac
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### `config-export`
|
||||||
|
|
||||||
|
- Description: Returns the environment variables in a specified format
|
||||||
|
- Invoked by: app-json plugin
|
||||||
|
- Arguments: `$APP $GLOBAL $MERGED $FORMAT`
|
||||||
|
- Example:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||||
|
|
||||||
|
# TODO
|
||||||
|
```
|
||||||
|
|
||||||
### `config-get`
|
### `config-get`
|
||||||
|
|
||||||
- Description: Fetches the app config value for a key
|
- Description: Fetches the app config value for a key
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ The workflow looks like this:
|
|||||||
```shell
|
```shell
|
||||||
# having dokku-arch in ../dokku-arch
|
# having dokku-arch in ../dokku-arch
|
||||||
vagrant up build-arch
|
vagrant up build-arch
|
||||||
# wait for "==> build-arch: ==> Finished making: dokku 0.23.2-2 (Mon Feb 22 23:20:37 CET 2016)"
|
# wait for "==> build-arch: ==> Finished making: dokku 0.23.3-2 (Mon Feb 22 23:20:37 CET 2016)"
|
||||||
cd ../dokku-arch
|
cd ../dokku-arch
|
||||||
git add PKGBUILD .SRCINFO
|
git add PKGBUILD .SRCINFO
|
||||||
git commit -m 'Update to dokku 0.9.9'
|
git commit -m 'Update to dokku 0.9.9'
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
Pull the dokku/dokku image:
|
Pull the dokku/dokku image:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
docker pull dokku/dokku:0.23.2
|
docker pull dokku/dokku:0.23.3
|
||||||
```
|
```
|
||||||
|
|
||||||
Next, run the image.
|
Next, run the image.
|
||||||
@@ -17,7 +17,7 @@ docker run \
|
|||||||
--publish 8443:443 \
|
--publish 8443:443 \
|
||||||
--volume /var/lib/dokku:/mnt/dokku \
|
--volume /var/lib/dokku:/mnt/dokku \
|
||||||
--volume /var/run/docker.sock:/var/run/docker.sock \
|
--volume /var/run/docker.sock:/var/run/docker.sock \
|
||||||
dokku/dokku:0.23.2
|
dokku/dokku:0.23.3
|
||||||
```
|
```
|
||||||
|
|
||||||
Dokku is run in the following configuration:
|
Dokku is run in the following configuration:
|
||||||
|
|||||||
@@ -21,8 +21,8 @@ To install the latest stable version of Dokku, you can run the following shell c
|
|||||||
|
|
||||||
```shell
|
```shell
|
||||||
# for debian systems, installs Dokku via apt-get
|
# for debian systems, installs Dokku via apt-get
|
||||||
wget https://raw.githubusercontent.com/dokku/dokku/v0.23.2/bootstrap.sh;
|
wget https://raw.githubusercontent.com/dokku/dokku/v0.23.3/bootstrap.sh;
|
||||||
sudo DOKKU_TAG=v0.23.2 bash bootstrap.sh
|
sudo DOKKU_TAG=v0.23.3 bash bootstrap.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
The installation process takes about 5-10 minutes, depending upon internet connection speed.
|
The installation process takes about 5-10 minutes, depending upon internet connection speed.
|
||||||
|
|||||||
@@ -10,30 +10,30 @@
|
|||||||
<link href="https://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css">
|
<link href="https://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css">
|
||||||
<title>Dokku - The smallest PaaS implementation you've ever seen</title>
|
<title>Dokku - The smallest PaaS implementation you've ever seen</title>
|
||||||
|
|
||||||
<link rel="apple-touch-icon" sizes="57x57" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.2/docs/assets/favicons/apple-touch-icon-57x57.png">
|
<link rel="apple-touch-icon" sizes="57x57" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.3/docs/assets/favicons/apple-touch-icon-57x57.png">
|
||||||
<link rel="apple-touch-icon" sizes="60x60" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.2/docs/assets/favicons/apple-touch-icon-60x60.png">
|
<link rel="apple-touch-icon" sizes="60x60" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.3/docs/assets/favicons/apple-touch-icon-60x60.png">
|
||||||
<link rel="apple-touch-icon" sizes="72x72" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.2/docs/assets/favicons/apple-touch-icon-72x72.png">
|
<link rel="apple-touch-icon" sizes="72x72" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.3/docs/assets/favicons/apple-touch-icon-72x72.png">
|
||||||
<link rel="apple-touch-icon" sizes="76x76" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.2/docs/assets/favicons/apple-touch-icon-76x76.png">
|
<link rel="apple-touch-icon" sizes="76x76" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.3/docs/assets/favicons/apple-touch-icon-76x76.png">
|
||||||
<link rel="apple-touch-icon" sizes="114x114" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.2/docs/assets/favicons/apple-touch-icon-114x114.png">
|
<link rel="apple-touch-icon" sizes="114x114" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.3/docs/assets/favicons/apple-touch-icon-114x114.png">
|
||||||
<link rel="apple-touch-icon" sizes="120x120" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.2/docs/assets/favicons/apple-touch-icon-120x120.png">
|
<link rel="apple-touch-icon" sizes="120x120" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.3/docs/assets/favicons/apple-touch-icon-120x120.png">
|
||||||
<link rel="apple-touch-icon" sizes="144x144" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.2/docs/assets/favicons/apple-touch-icon-144x144.png">
|
<link rel="apple-touch-icon" sizes="144x144" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.3/docs/assets/favicons/apple-touch-icon-144x144.png">
|
||||||
<link rel="apple-touch-icon" sizes="152x152" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.2/docs/assets/favicons/apple-touch-icon-152x152.png">
|
<link rel="apple-touch-icon" sizes="152x152" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.3/docs/assets/favicons/apple-touch-icon-152x152.png">
|
||||||
<link rel="apple-touch-icon" sizes="180x180" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.2/docs/assets/favicons/apple-touch-icon-180x180.png">
|
<link rel="apple-touch-icon" sizes="180x180" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.3/docs/assets/favicons/apple-touch-icon-180x180.png">
|
||||||
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.2/docs/assets/favicons/favicon-32x32.png" sizes="32x32">
|
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.3/docs/assets/favicons/favicon-32x32.png" sizes="32x32">
|
||||||
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.2/docs/assets/favicons/android-chrome-192x192.png" sizes="192x192">
|
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.3/docs/assets/favicons/android-chrome-192x192.png" sizes="192x192">
|
||||||
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.2/docs/assets/favicons/favicon-96x96.png" sizes="96x96">
|
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.3/docs/assets/favicons/favicon-96x96.png" sizes="96x96">
|
||||||
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.2/docs/assets/favicons/favicon-16x16.png" sizes="16x16">
|
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.3/docs/assets/favicons/favicon-16x16.png" sizes="16x16">
|
||||||
<link rel="manifest" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.2/docs/assets/favicons/manifest.json">
|
<link rel="manifest" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.3/docs/assets/favicons/manifest.json">
|
||||||
<link rel="shortcut icon" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.2/docs/assets/favicons/favicon.ico">
|
<link rel="shortcut icon" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.3/docs/assets/favicons/favicon.ico">
|
||||||
<meta name="apple-mobile-web-app-title" content="Dokku">
|
<meta name="apple-mobile-web-app-title" content="Dokku">
|
||||||
<meta name="application-name" content="Dokku">
|
<meta name="application-name" content="Dokku">
|
||||||
<meta name="msapplication-TileColor" content="#da532c">
|
<meta name="msapplication-TileColor" content="#da532c">
|
||||||
<meta name="msapplication-TileImage" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.2/docs/assets/favicons/mstile-144x144.png">
|
<meta name="msapplication-TileImage" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.3/docs/assets/favicons/mstile-144x144.png">
|
||||||
<meta name="msapplication-config" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.2/docs/assets/favicons/browserconfig.xml">
|
<meta name="msapplication-config" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.3/docs/assets/favicons/browserconfig.xml">
|
||||||
<meta name="theme-color" content="#ffffff">
|
<meta name="theme-color" content="#ffffff">
|
||||||
|
|
||||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.2/css/bootstrap.min.css" rel="stylesheet">
|
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.2/css/bootstrap.min.css" rel="stylesheet">
|
||||||
<link href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.2/docs/assets/style.css" rel="stylesheet">
|
<link href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.3/docs/assets/style.css" rel="stylesheet">
|
||||||
<!-- <link href="/dokku/docs/assets/style.css" rel="stylesheet"> -->
|
<!-- <link href="/dokku/docs/assets/style.css" rel="stylesheet"> -->
|
||||||
<style>
|
<style>
|
||||||
.sponsors {
|
.sponsors {
|
||||||
@@ -130,12 +130,12 @@
|
|||||||
<p class="line">
|
<p class="line">
|
||||||
<span class="path"></span>
|
<span class="path"></span>
|
||||||
<span class="prompt">$</span>
|
<span class="prompt">$</span>
|
||||||
<span class="command">wget https://raw.githubusercontent.com/dokku/dokku/v0.23.2/bootstrap.sh</span>
|
<span class="command">wget https://raw.githubusercontent.com/dokku/dokku/v0.23.3/bootstrap.sh</span>
|
||||||
</p>
|
</p>
|
||||||
<p class="line">
|
<p class="line">
|
||||||
<span class="path"></span>
|
<span class="path"></span>
|
||||||
<span class="prompt">$</span>
|
<span class="prompt">$</span>
|
||||||
<span class="command">sudo DOKKU_TAG=v0.23.2 bash bootstrap.sh</span>
|
<span class="command">sudo DOKKU_TAG=v0.23.3 bash bootstrap.sh</span>
|
||||||
</p>
|
</p>
|
||||||
<p class="line">
|
<p class="line">
|
||||||
<span class="output"> # go to your server's IP and follow the web installer</span>
|
<span class="output"> # go to your server's IP and follow the web installer</span>
|
||||||
|
|||||||
@@ -9,26 +9,26 @@
|
|||||||
<meta name="author" content="">
|
<meta name="author" content="">
|
||||||
<title>Dokku - The smallest PaaS implementation you've ever seen</title>
|
<title>Dokku - The smallest PaaS implementation you've ever seen</title>
|
||||||
|
|
||||||
<link rel="apple-touch-icon" sizes="57x57" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.2/docs/assets/favicons/apple-touch-icon-57x57.png">
|
<link rel="apple-touch-icon" sizes="57x57" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.3/docs/assets/favicons/apple-touch-icon-57x57.png">
|
||||||
<link rel="apple-touch-icon" sizes="60x60" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.2/docs/assets/favicons/apple-touch-icon-60x60.png">
|
<link rel="apple-touch-icon" sizes="60x60" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.3/docs/assets/favicons/apple-touch-icon-60x60.png">
|
||||||
<link rel="apple-touch-icon" sizes="72x72" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.2/docs/assets/favicons/apple-touch-icon-72x72.png">
|
<link rel="apple-touch-icon" sizes="72x72" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.3/docs/assets/favicons/apple-touch-icon-72x72.png">
|
||||||
<link rel="apple-touch-icon" sizes="76x76" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.2/docs/assets/favicons/apple-touch-icon-76x76.png">
|
<link rel="apple-touch-icon" sizes="76x76" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.3/docs/assets/favicons/apple-touch-icon-76x76.png">
|
||||||
<link rel="apple-touch-icon" sizes="114x114" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.2/docs/assets/favicons/apple-touch-icon-114x114.png">
|
<link rel="apple-touch-icon" sizes="114x114" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.3/docs/assets/favicons/apple-touch-icon-114x114.png">
|
||||||
<link rel="apple-touch-icon" sizes="120x120" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.2/docs/assets/favicons/apple-touch-icon-120x120.png">
|
<link rel="apple-touch-icon" sizes="120x120" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.3/docs/assets/favicons/apple-touch-icon-120x120.png">
|
||||||
<link rel="apple-touch-icon" sizes="144x144" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.2/docs/assets/favicons/apple-touch-icon-144x144.png">
|
<link rel="apple-touch-icon" sizes="144x144" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.3/docs/assets/favicons/apple-touch-icon-144x144.png">
|
||||||
<link rel="apple-touch-icon" sizes="152x152" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.2/docs/assets/favicons/apple-touch-icon-152x152.png">
|
<link rel="apple-touch-icon" sizes="152x152" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.3/docs/assets/favicons/apple-touch-icon-152x152.png">
|
||||||
<link rel="apple-touch-icon" sizes="180x180" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.2/docs/assets/favicons/apple-touch-icon-180x180.png">
|
<link rel="apple-touch-icon" sizes="180x180" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.3/docs/assets/favicons/apple-touch-icon-180x180.png">
|
||||||
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.2/docs/assets/favicons/favicon-32x32.png" sizes="32x32">
|
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.3/docs/assets/favicons/favicon-32x32.png" sizes="32x32">
|
||||||
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.2/docs/assets/favicons/android-chrome-192x192.png" sizes="192x192">
|
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.3/docs/assets/favicons/android-chrome-192x192.png" sizes="192x192">
|
||||||
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.2/docs/assets/favicons/favicon-96x96.png" sizes="96x96">
|
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.3/docs/assets/favicons/favicon-96x96.png" sizes="96x96">
|
||||||
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.2/docs/assets/favicons/favicon-16x16.png" sizes="16x16">
|
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.3/docs/assets/favicons/favicon-16x16.png" sizes="16x16">
|
||||||
<link rel="manifest" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.2/docs/assets/favicons/manifest.json">
|
<link rel="manifest" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.3/docs/assets/favicons/manifest.json">
|
||||||
<link rel="shortcut icon" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.2/docs/assets/favicons/favicon.ico">
|
<link rel="shortcut icon" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.3/docs/assets/favicons/favicon.ico">
|
||||||
<meta name="apple-mobile-web-app-title" content="Dokku">
|
<meta name="apple-mobile-web-app-title" content="Dokku">
|
||||||
<meta name="application-name" content="Dokku">
|
<meta name="application-name" content="Dokku">
|
||||||
<meta name="msapplication-TileColor" content="#da532c">
|
<meta name="msapplication-TileColor" content="#da532c">
|
||||||
<meta name="msapplication-TileImage" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.2/docs/assets/favicons/mstile-144x144.png">
|
<meta name="msapplication-TileImage" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.3/docs/assets/favicons/mstile-144x144.png">
|
||||||
<meta name="msapplication-config" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.2/docs/assets/favicons/browserconfig.xml">
|
<meta name="msapplication-config" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.3/docs/assets/favicons/browserconfig.xml">
|
||||||
<meta name="theme-color" content="#ffffff">
|
<meta name="theme-color" content="#ffffff">
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@@ -42,7 +42,7 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.2/css/bootstrap.min.css" rel="stylesheet">
|
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.2/css/bootstrap.min.css" rel="stylesheet">
|
||||||
<link href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.2/docs/assets/style.css" rel="stylesheet">
|
<link href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.3/docs/assets/style.css" rel="stylesheet">
|
||||||
<!-- <link href="/dokku/docs/assets/style.css" rel="stylesheet"> -->
|
<!-- <link href="/dokku/docs/assets/style.css" rel="stylesheet"> -->
|
||||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css" rel="stylesheet">
|
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css" rel="stylesheet">
|
||||||
<style>
|
<style>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core standard plugin"
|
description = "dokku core standard plugin"
|
||||||
version = "0.23.2"
|
version = "0.23.3"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
1
plugins/20_events/config-export
Symbolic link
1
plugins/20_events/config-export
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
hook
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core events logging plugin"
|
description = "dokku core events logging plugin"
|
||||||
version = "0.23.2"
|
version = "0.23.3"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import (
|
|||||||
"golang.org/x/sync/errgroup"
|
"golang.org/x/sync/errgroup"
|
||||||
)
|
)
|
||||||
|
|
||||||
func constructScript(command string, shell string, isHerokuishImage bool, hasEntrypoint bool) []string {
|
func constructScript(command string, shell string, isHerokuishImage bool, isCnbImage bool, hasEntrypoint bool) []string {
|
||||||
if hasEntrypoint {
|
if hasEntrypoint {
|
||||||
words, err := shellquote.Split(strings.TrimSpace(command))
|
words, err := shellquote.Split(strings.TrimSpace(command))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -31,7 +31,7 @@ func constructScript(command string, shell string, isHerokuishImage bool, hasEnt
|
|||||||
script = append(script, "set -x;")
|
script = append(script, "set -x;")
|
||||||
}
|
}
|
||||||
|
|
||||||
if isHerokuishImage {
|
if isHerokuishImage && !isCnbImage {
|
||||||
script = append(script, []string{
|
script = append(script, []string{
|
||||||
"if [[ -d '/app' ]]; then",
|
"if [[ -d '/app' ]]; then",
|
||||||
" export HOME=/app;",
|
" export HOME=/app;",
|
||||||
@@ -60,7 +60,7 @@ func constructScript(command string, shell string, isHerokuishImage bool, hasEnt
|
|||||||
|
|
||||||
script = append(script, fmt.Sprintf("%s || exit 1;", command))
|
script = append(script, fmt.Sprintf("%s || exit 1;", command))
|
||||||
|
|
||||||
if isHerokuishImage {
|
if isHerokuishImage && !isCnbImage {
|
||||||
script = append(script, []string{
|
script = append(script, []string{
|
||||||
"if [[ -d '/cache' ]]; then",
|
"if [[ -d '/cache' ]]; then",
|
||||||
" rm -f /tmp/cache;",
|
" rm -f /tmp/cache;",
|
||||||
@@ -127,7 +127,7 @@ func getDokkuAppShell(appName string) string {
|
|||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
errs.Go(func() error {
|
errs.Go(func() error {
|
||||||
b, _ := common.PlugnTriggerOutput("config-get", []string{"DOKKU_APP_SHELL", appName}...)
|
b, _ := common.PlugnTriggerOutput("config-get", []string{appName, "DOKKU_APP_SHELL"}...)
|
||||||
appShell = strings.TrimSpace(string(b[:]))
|
appShell = strings.TrimSpace(string(b[:]))
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
@@ -164,6 +164,7 @@ func executeScript(appName string, image string, imageTag string, phase string)
|
|||||||
|
|
||||||
common.LogInfo1(fmt.Sprintf("Executing %s task from %s: %s", phase, phaseSource, command))
|
common.LogInfo1(fmt.Sprintf("Executing %s task from %s: %s", phase, phaseSource, command))
|
||||||
isHerokuishImage := common.IsImageHerokuishBased(image, appName)
|
isHerokuishImage := common.IsImageHerokuishBased(image, appName)
|
||||||
|
isCnbImage := common.IsImageCnbBased(image)
|
||||||
dockerfileEntrypoint := ""
|
dockerfileEntrypoint := ""
|
||||||
dockerfileCommand := ""
|
dockerfileCommand := ""
|
||||||
if !isHerokuishImage {
|
if !isHerokuishImage {
|
||||||
@@ -173,11 +174,13 @@ func executeScript(appName string, image string, imageTag string, phase string)
|
|||||||
|
|
||||||
hasEntrypoint := dockerfileEntrypoint != ""
|
hasEntrypoint := dockerfileEntrypoint != ""
|
||||||
dokkuAppShell := getDokkuAppShell(appName)
|
dokkuAppShell := getDokkuAppShell(appName)
|
||||||
script := constructScript(command, dokkuAppShell, isHerokuishImage, hasEntrypoint)
|
script := constructScript(command, dokkuAppShell, isHerokuishImage, isCnbImage, hasEntrypoint)
|
||||||
|
|
||||||
imageSourceType := "dockerfile"
|
imageSourceType := "dockerfile"
|
||||||
if isHerokuishImage {
|
if isHerokuishImage {
|
||||||
imageSourceType = "herokuish"
|
imageSourceType = "herokuish"
|
||||||
|
} else if isCnbImage {
|
||||||
|
imageSourceType = "cnb"
|
||||||
}
|
}
|
||||||
|
|
||||||
cacheDir := fmt.Sprintf("%s/cache", common.AppRoot(appName))
|
cacheDir := fmt.Sprintf("%s/cache", common.AppRoot(appName))
|
||||||
@@ -224,6 +227,13 @@ func executeScript(appName string, image string, imageTag string, phase string)
|
|||||||
if os.Getenv("DOKKU_TRACE") != "" {
|
if os.Getenv("DOKKU_TRACE") != "" {
|
||||||
dockerArgs = append(dockerArgs, "--env", "DOKKU_TRACE="+os.Getenv("DOKKU_TRACE"))
|
dockerArgs = append(dockerArgs, "--env", "DOKKU_TRACE="+os.Getenv("DOKKU_TRACE"))
|
||||||
}
|
}
|
||||||
|
if isCnbImage {
|
||||||
|
// TODO: handle non-linux lifecycles
|
||||||
|
// Ideally we don't have to override this but `pack` injects the web process
|
||||||
|
// as the default entrypoint, so we need to specify the launcher so the script
|
||||||
|
// runs as expected
|
||||||
|
dockerArgs = append(dockerArgs, "--entrypoint=/cnb/lifecycle/launcher")
|
||||||
|
}
|
||||||
|
|
||||||
containerID, err := createdContainerID(appName, dockerArgs, image, script, phase)
|
containerID, err := createdContainerID(appName, dockerArgs, image, script, phase)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -246,7 +256,7 @@ func executeScript(appName string, image string, imageTag string, phase string)
|
|||||||
}
|
}
|
||||||
|
|
||||||
commitArgs := []string{"container", "commit"}
|
commitArgs := []string{"container", "commit"}
|
||||||
if !isHerokuishImage {
|
if !isHerokuishImage || isCnbImage {
|
||||||
if dockerfileEntrypoint != "" {
|
if dockerfileEntrypoint != "" {
|
||||||
commitArgs = append(commitArgs, "--change", dockerfileEntrypoint)
|
commitArgs = append(commitArgs, "--change", dockerfileEntrypoint)
|
||||||
}
|
}
|
||||||
@@ -366,15 +376,25 @@ func createdContainerID(appName string, dockerArgs []string, image string, comma
|
|||||||
arguments = append(arguments, image)
|
arguments = append(arguments, image)
|
||||||
arguments = append(arguments, command...)
|
arguments = append(arguments, command...)
|
||||||
|
|
||||||
|
b, err := common.PlugnTriggerOutput("config-export", []string{appName, "false", "true", "json"}...)
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
var env map[string]string
|
||||||
|
if err := json.Unmarshal(b, &env); err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
|
||||||
containerCreateCmd := common.NewShellCmdWithArgs(
|
containerCreateCmd := common.NewShellCmdWithArgs(
|
||||||
common.DockerBin(),
|
common.DockerBin(),
|
||||||
arguments...,
|
arguments...,
|
||||||
)
|
)
|
||||||
var stderr bytes.Buffer
|
var stderr bytes.Buffer
|
||||||
|
containerCreateCmd.Env = env
|
||||||
containerCreateCmd.ShowOutput = false
|
containerCreateCmd.ShowOutput = false
|
||||||
containerCreateCmd.Command.Stderr = &stderr
|
containerCreateCmd.Command.Stderr = &stderr
|
||||||
|
|
||||||
b, err := containerCreateCmd.Output()
|
b, err = containerCreateCmd.Output()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", errors.New(stderr.String())
|
return "", errors.New(stderr.String())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core app-json plugin"
|
description = "dokku core app-json plugin"
|
||||||
version = "0.23.2"
|
version = "0.23.3"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core apps plugin"
|
description = "dokku core apps plugin"
|
||||||
version = "0.23.2"
|
version = "0.23.3"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ trigger-builder-cnb-builder-build() {
|
|||||||
|
|
||||||
pack build "$IMAGE" --builder "$DOKKU_CNB_BUILDER" --path "$SOURCECODE_WORK_DIR" --default-process web
|
pack build "$IMAGE" --builder "$DOKKU_CNB_BUILDER" --path "$SOURCECODE_WORK_DIR" --default-process web
|
||||||
|
|
||||||
echo "FROM $IMAGE" | suppress_output "$DOCKER_BIN" image build --label=com.dokku.image-stage=build --label=org.label-schema.schema-version=1.0 --label=org.label-schema.vendor=dokku --label=com.dokku.app-name=$APP --label=dokku -t "$IMAGE" -
|
docker-image-labeler --label=com.dokku.image-stage=build --label=com.dokku.app-name=$APP --label=org.label-schema.schema-version=1.0 --label=org.label-schema.vendor=dokku --label=dokku "$IMAGE"
|
||||||
|
|
||||||
plugn trigger post-build-cnb "$APP" "$SOURCECODE_WORK_DIR"
|
plugn trigger post-build-cnb "$APP" "$SOURCECODE_WORK_DIR"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core builder-cnb plugin"
|
description = "dokku core builder-cnb plugin"
|
||||||
version = "0.23.2"
|
version = "0.23.3"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core builder-dockerfile plugin"
|
description = "dokku core builder-dockerfile plugin"
|
||||||
version = "0.23.2"
|
version = "0.23.3"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
@@ -47,14 +47,14 @@ trigger-builder-herokuish-builder-build() {
|
|||||||
plugn trigger pre-build-buildpack "$APP" "$SOURCECODE_WORK_DIR"
|
plugn trigger pre-build-buildpack "$APP" "$SOURCECODE_WORK_DIR"
|
||||||
|
|
||||||
local DOCKER_ARGS=$(: | plugn trigger docker-args-build "$APP" "$BUILDER_TYPE")
|
local DOCKER_ARGS=$(: | plugn trigger docker-args-build "$APP" "$BUILDER_TYPE")
|
||||||
[[ "$DOKKU_TRACE" ]] && DOCKER_ARGS+=" -e TRACE=true "
|
[[ "$DOKKU_TRACE" ]] && DOCKER_ARGS+=" --env=TRACE=true "
|
||||||
DOCKER_ARGS+=$(: | plugn trigger docker-args-process-build "$APP" "$BUILDER_TYPE")
|
DOCKER_ARGS+=$(: | plugn trigger docker-args-process-build "$APP" "$BUILDER_TYPE")
|
||||||
|
|
||||||
declare -a ARG_ARRAY
|
declare -a ARG_ARRAY
|
||||||
eval "ARG_ARRAY=($DOCKER_ARGS)"
|
eval "ARG_ARRAY=($DOCKER_ARGS)"
|
||||||
|
|
||||||
local DOKKU_CONTAINER_EXIT_CODE=0
|
local DOKKU_CONTAINER_EXIT_CODE=0
|
||||||
local CID=$("$DOCKER_BIN" container create "${DOCKER_RUN_LABEL_ARGS[@]}" $DOKKU_GLOBAL_RUN_ARGS -v $DOKKU_APP_HOST_CACHE_DIR:/cache -e CACHE_PATH=/cache "${ARG_ARRAY[@]}" $IMAGE /build)
|
local CID=$("$DOCKER_BIN" container create "${DOCKER_RUN_LABEL_ARGS[@]}" $DOKKU_GLOBAL_RUN_ARGS -v $DOKKU_APP_HOST_CACHE_DIR:/cache --env=CACHE_PATH=/cache "${ARG_ARRAY[@]}" $IMAGE /build)
|
||||||
plugn trigger post-container-create "app" "$CID" "$APP" "build"
|
plugn trigger post-container-create "app" "$CID" "$APP" "build"
|
||||||
"$DOCKER_BIN" container start "$CID" >/dev/null || DOKKU_CONTAINER_EXIT_CODE=$?
|
"$DOCKER_BIN" container start "$CID" >/dev/null || DOKKU_CONTAINER_EXIT_CODE=$?
|
||||||
"$DOCKER_BIN" container attach "$CID"
|
"$DOCKER_BIN" container attach "$CID"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core builder-herokuish plugin"
|
description = "dokku core builder-herokuish plugin"
|
||||||
version = "0.23.2"
|
version = "0.23.3"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core buildpacks plugin"
|
description = "dokku core buildpacks plugin"
|
||||||
version = "0.23.2"
|
version = "0.23.3"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core certificate management plugin"
|
description = "dokku core certificate management plugin"
|
||||||
version = "0.23.2"
|
version = "0.23.3"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core checks plugin"
|
description = "dokku core checks plugin"
|
||||||
version = "0.23.2"
|
version = "0.23.3"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
@@ -66,7 +66,9 @@ func CopyFromImage(appName string, image string, source string, destination stri
|
|||||||
|
|
||||||
workDir := ""
|
workDir := ""
|
||||||
if !IsAbsPath(source) {
|
if !IsAbsPath(source) {
|
||||||
if IsImageHerokuishBased(image, appName) {
|
if IsImageCnbBased(image) {
|
||||||
|
workDir = "/workspace"
|
||||||
|
} else if IsImageHerokuishBased(image, appName) {
|
||||||
workDir = "/app"
|
workDir = "/app"
|
||||||
} else {
|
} else {
|
||||||
workDir, _ = DockerInspect(image, "{{.Config.WorkingDir}}")
|
workDir, _ = DockerInspect(image, "{{.Config.WorkingDir}}")
|
||||||
@@ -257,9 +259,42 @@ func DockerInspect(containerOrImageID, format string) (output string, err error)
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// IsImageCnbBased returns true if app image is based on cnb
|
||||||
|
func IsImageCnbBased(image string) bool {
|
||||||
|
if len(image) == 0 {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
output, err := DockerInspect(image, "{{index .Config.Labels \"io.buildpacks.stack.id\" }}")
|
||||||
|
if err != nil {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return output != ""
|
||||||
|
}
|
||||||
|
|
||||||
// IsImageHerokuishBased returns true if app image is based on herokuish
|
// IsImageHerokuishBased returns true if app image is based on herokuish
|
||||||
func IsImageHerokuishBased(image string, appName string) bool {
|
func IsImageHerokuishBased(image string, appName string) bool {
|
||||||
output, err := DockerInspect(image, "{{range .Config.Env}}{{if eq . \"USER=herokuishuser\" }}{{println .}}{{end}}{{end}}")
|
if len(image) == 0 {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
if IsImageCnbBased(image) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
dokkuAppUser := ""
|
||||||
|
if len(appName) != 0 {
|
||||||
|
b, err := PlugnTriggerOutput("config-get", []string{appName, "DOKKU_APP_USER"}...)
|
||||||
|
if err == nil {
|
||||||
|
dokkuAppUser = strings.TrimSpace(string(b))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(dokkuAppUser) == 0 {
|
||||||
|
dokkuAppUser = "herokuishuser"
|
||||||
|
}
|
||||||
|
|
||||||
|
output, err := DockerInspect(image, fmt.Sprintf("{{range .Config.Env}}{{if eq . \"USER=%s\" }}{{println .}}{{end}}{{end}}", dokkuAppUser))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -477,10 +477,10 @@ copy_from_image() {
|
|||||||
|
|
||||||
if verify_image "$IMAGE"; then
|
if verify_image "$IMAGE"; then
|
||||||
if ! is_abs_path "$SRC_FILE"; then
|
if ! is_abs_path "$SRC_FILE"; then
|
||||||
if is_image_herokuish_based "$IMAGE" "$APP"; then
|
if is_image_cnb_based "$IMAGE"; then
|
||||||
WORKDIR="/app"
|
|
||||||
elif is_image_cnb_based "$IMAGE"; then
|
|
||||||
WORKDIR="/workspace"
|
WORKDIR="/workspace"
|
||||||
|
elif is_image_herokuish_based "$IMAGE" "$APP"; then
|
||||||
|
WORKDIR="/app"
|
||||||
else
|
else
|
||||||
WORKDIR="$("$DOCKER_BIN" image inspect --format '{{.Config.WorkingDir}}' "$IMAGE")"
|
WORKDIR="$("$DOCKER_BIN" image inspect --format '{{.Config.WorkingDir}}' "$IMAGE")"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core common plugin"
|
description = "dokku core common plugin"
|
||||||
version = "0.23.2"
|
version = "0.23.3"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
SUBCOMMANDS = subcommands/bundle subcommands/clear subcommands/export subcommands/get subcommands/keys subcommands/show subcommands/set subcommands/unset
|
SUBCOMMANDS = subcommands/bundle subcommands/clear subcommands/export subcommands/get subcommands/keys subcommands/show subcommands/set subcommands/unset
|
||||||
TRIGGERS = triggers/config-get triggers/config-get-global
|
TRIGGERS = triggers/config-export triggers/config-get triggers/config-get-global
|
||||||
BUILD = commands subcommands triggers
|
BUILD = commands subcommands triggers
|
||||||
PLUGIN_NAME = config
|
PLUGIN_NAME = config
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,12 @@ trigger-config-docker-args() {
|
|||||||
STDIN=$(cat)
|
STDIN=$(cat)
|
||||||
trigger="$0 config_docker_args"
|
trigger="$0 config_docker_args"
|
||||||
|
|
||||||
|
if is_image_cnb_based "$IMAGE"; then
|
||||||
|
ENV_ARGS="$(config_export app "$APP" --format docker-args-keys --merged)"
|
||||||
|
echo -n "$STDIN $ENV_ARGS"
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
if ! is_image_herokuish_based "$IMAGE" "$APP"; then
|
if ! is_image_herokuish_based "$IMAGE" "$APP"; then
|
||||||
ENV_ARGS="$(config_export app "$APP" --format docker-args --merged)"
|
ENV_ARGS="$(config_export app "$APP" --format docker-args --merged)"
|
||||||
echo -n "$STDIN $ENV_ARGS"
|
echo -n "$STDIN $ENV_ARGS"
|
||||||
|
|||||||
@@ -24,8 +24,10 @@ const (
|
|||||||
ExportFormatExports ExportFormat = iota
|
ExportFormatExports ExportFormat = iota
|
||||||
//ExportFormatEnvfile format: dotenv file
|
//ExportFormatEnvfile format: dotenv file
|
||||||
ExportFormatEnvfile
|
ExportFormatEnvfile
|
||||||
//ExportFormatDockerArgs format: --env args for docker
|
//ExportFormatDockerArgs format: --env KEY=VALUE args for docker
|
||||||
ExportFormatDockerArgs
|
ExportFormatDockerArgs
|
||||||
|
//ExportFormatDockerArgsKeys format: --env KEY args for docker
|
||||||
|
ExportFormatDockerArgsKeys
|
||||||
//ExportFormatShell format: env arguments for shell
|
//ExportFormatShell format: env arguments for shell
|
||||||
ExportFormatShell
|
ExportFormatShell
|
||||||
//ExportFormatPretty format: pretty-printed in columns
|
//ExportFormatPretty format: pretty-printed in columns
|
||||||
@@ -171,6 +173,8 @@ func (e *Env) Export(format ExportFormat) string {
|
|||||||
return e.EnvfileString()
|
return e.EnvfileString()
|
||||||
case ExportFormatDockerArgs:
|
case ExportFormatDockerArgs:
|
||||||
return e.DockerArgsString()
|
return e.DockerArgsString()
|
||||||
|
case ExportFormatDockerArgsKeys:
|
||||||
|
return e.DockerArgsKeysString()
|
||||||
case ExportFormatShell:
|
case ExportFormatShell:
|
||||||
return e.ShellString()
|
return e.ShellString()
|
||||||
case ExportFormatPretty:
|
case ExportFormatPretty:
|
||||||
@@ -201,6 +205,16 @@ func (e *Env) DockerArgsString() string {
|
|||||||
return e.stringWithPrefixAndSeparator("--env=", " ")
|
return e.stringWithPrefixAndSeparator("--env=", " ")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//DockerArgsKeysString gets the contents of this Env in the form -env=KEY --env...
|
||||||
|
func (e *Env) DockerArgsKeysString() string {
|
||||||
|
keys := e.Keys()
|
||||||
|
entries := make([]string, len(keys))
|
||||||
|
for i, k := range keys {
|
||||||
|
entries[i] = fmt.Sprintf("%s%s", "--env=", k)
|
||||||
|
}
|
||||||
|
return strings.Join(entries, " ")
|
||||||
|
}
|
||||||
|
|
||||||
//JSONString returns the contents of this Env as a key/value json object
|
//JSONString returns the contents of this Env as a key/value json object
|
||||||
func (e *Env) JSONString() string {
|
func (e *Env) JSONString() string {
|
||||||
data, err := json.Marshal(e.Map())
|
data, err := json.Marshal(e.Map())
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ func TestExport(t *testing.T) {
|
|||||||
e, _ := newEnvFromString("BAR='BAZ'\nFOO='b'ar '\nBAZ='a\\nb'")
|
e, _ := newEnvFromString("BAR='BAZ'\nFOO='b'ar '\nBAZ='a\\nb'")
|
||||||
Expect(e.Export(ExportFormatEnvfile)).To(Equal("BAR=\"BAZ\"\nBAZ=\"a\\nb\"\nFOO=\"b'ar \""))
|
Expect(e.Export(ExportFormatEnvfile)).To(Equal("BAR=\"BAZ\"\nBAZ=\"a\\nb\"\nFOO=\"b'ar \""))
|
||||||
Expect(e.Export(ExportFormatDockerArgs)).To(Equal("--env=BAR='BAZ' --env=BAZ='a\nb' --env=FOO='b'\\''ar '"))
|
Expect(e.Export(ExportFormatDockerArgs)).To(Equal("--env=BAR='BAZ' --env=BAZ='a\nb' --env=FOO='b'\\''ar '"))
|
||||||
|
Expect(e.Export(ExportFormatDockerArgsKeys)).To(Equal("--env=BAR --env=BAZ --env=FOO"))
|
||||||
Expect(e.Export(ExportFormatShell)).To(Equal("BAR='BAZ' BAZ='a\nb' FOO='b'\\''ar '"))
|
Expect(e.Export(ExportFormatShell)).To(Equal("BAR='BAZ' BAZ='a\nb' FOO='b'\\''ar '"))
|
||||||
Expect(e.Export(ExportFormatExports)).To(Equal("export BAR='BAZ'\nexport BAZ='a\nb'\nexport FOO='b'\\''ar '"))
|
Expect(e.Export(ExportFormatExports)).To(Equal("export BAR='BAZ'\nexport BAZ='a\nb'\nexport FOO='b'\\''ar '"))
|
||||||
Expect(e.Export(ExportFormatPretty)).To(Equal("BAR: BAZ\nBAZ: a\nb\nFOO: b'ar"))
|
Expect(e.Export(ExportFormatPretty)).To(Equal("BAR: BAZ\nBAZ: a\nb\nFOO: b'ar"))
|
||||||
|
|||||||
38
plugins/config/functions.go
Normal file
38
plugins/config/functions.go
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
package config
|
||||||
|
|
||||||
|
import "fmt"
|
||||||
|
|
||||||
|
func export(appName string, global bool, merged bool, format string) error {
|
||||||
|
appName, err := getAppNameOrGlobal(appName, global)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
env := getEnvironment(appName, merged)
|
||||||
|
exportType := ExportFormatExports
|
||||||
|
suffix := "\n"
|
||||||
|
|
||||||
|
exportTypes := map[string]ExportFormat{
|
||||||
|
"exports": ExportFormatExports,
|
||||||
|
"envfile": ExportFormatEnvfile,
|
||||||
|
"docker-args": ExportFormatDockerArgs,
|
||||||
|
"docker-args-keys": ExportFormatDockerArgsKeys,
|
||||||
|
"shell": ExportFormatShell,
|
||||||
|
"pretty": ExportFormatPretty,
|
||||||
|
"json": ExportFormatJSON,
|
||||||
|
"json-list": ExportFormatJSONList,
|
||||||
|
}
|
||||||
|
|
||||||
|
exportType, ok := exportTypes[format]
|
||||||
|
if !ok {
|
||||||
|
return fmt.Errorf("Unknown export format: %v", format)
|
||||||
|
}
|
||||||
|
|
||||||
|
if exportType == ExportFormatShell {
|
||||||
|
suffix = " "
|
||||||
|
}
|
||||||
|
|
||||||
|
exported := env.Export(exportType)
|
||||||
|
fmt.Print(exported + suffix)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core config plugin"
|
description = "dokku core config plugin"
|
||||||
version = "0.23.2"
|
version = "0.23.3"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ func main() {
|
|||||||
args := flag.NewFlagSet("config:export", flag.ExitOnError)
|
args := flag.NewFlagSet("config:export", flag.ExitOnError)
|
||||||
global := args.Bool("global", false, "--global: use the global environment")
|
global := args.Bool("global", false, "--global: use the global environment")
|
||||||
merged := args.Bool("merged", false, "--merged: merge app environment and global environment")
|
merged := args.Bool("merged", false, "--merged: merge app environment and global environment")
|
||||||
format := args.String("format", "exports", "--format: [ exports | envfile | docker-args | shell | pretty | json | json-list ] which format to export as)")
|
format := args.String("format", "exports", "--format: [ exports | envfile | docker-args | docker-args-keys | shell | pretty | json | json-list ] which format to export as)")
|
||||||
args.Parse(os.Args[2:])
|
args.Parse(os.Args[2:])
|
||||||
if !*global {
|
if !*global {
|
||||||
appName = args.Arg(0)
|
appName = args.Arg(0)
|
||||||
|
|||||||
@@ -18,6 +18,12 @@ func main() {
|
|||||||
|
|
||||||
var err error
|
var err error
|
||||||
switch trigger {
|
switch trigger {
|
||||||
|
case "config-export":
|
||||||
|
appName := flag.Arg(0)
|
||||||
|
global := flag.Arg(1)
|
||||||
|
merged := flag.Arg(2)
|
||||||
|
format := flag.Arg(3)
|
||||||
|
config.TriggerConfigExport(appName, global, merged, format)
|
||||||
case "config-get":
|
case "config-get":
|
||||||
appName := flag.Arg(0)
|
appName := flag.Arg(0)
|
||||||
key := flag.Arg(1)
|
key := flag.Arg(1)
|
||||||
|
|||||||
@@ -33,37 +33,7 @@ func CommandClear(appName string, global bool, noRestart bool) error {
|
|||||||
|
|
||||||
// CommandExport implements config:export
|
// CommandExport implements config:export
|
||||||
func CommandExport(appName string, global bool, merged bool, format string) error {
|
func CommandExport(appName string, global bool, merged bool, format string) error {
|
||||||
appName, err := getAppNameOrGlobal(appName, global)
|
return export(appName, global, merged, format)
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
env := getEnvironment(appName, merged)
|
|
||||||
exportType := ExportFormatExports
|
|
||||||
suffix := "\n"
|
|
||||||
|
|
||||||
exportTypes := map[string]ExportFormat{
|
|
||||||
"exports": ExportFormatExports,
|
|
||||||
"envfile": ExportFormatEnvfile,
|
|
||||||
"docker-args": ExportFormatDockerArgs,
|
|
||||||
"shell": ExportFormatShell,
|
|
||||||
"pretty": ExportFormatPretty,
|
|
||||||
"json": ExportFormatJSON,
|
|
||||||
"json-list": ExportFormatJSONList,
|
|
||||||
}
|
|
||||||
|
|
||||||
exportType, ok := exportTypes[format]
|
|
||||||
if !ok {
|
|
||||||
return fmt.Errorf("Unknown export format: %v", format)
|
|
||||||
}
|
|
||||||
|
|
||||||
if exportType == ExportFormatShell {
|
|
||||||
suffix = " "
|
|
||||||
}
|
|
||||||
|
|
||||||
exported := env.Export(exportType)
|
|
||||||
fmt.Print(exported + suffix)
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// CommandGet implements config:get
|
// CommandGet implements config:get
|
||||||
|
|||||||
@@ -1,6 +1,23 @@
|
|||||||
package config
|
package config
|
||||||
|
|
||||||
import "fmt"
|
import (
|
||||||
|
"fmt"
|
||||||
|
"strconv"
|
||||||
|
)
|
||||||
|
|
||||||
|
// TriggerConfigExport returns a global config value by key
|
||||||
|
func TriggerConfigExport(appName string, global string, merged string, format string) error {
|
||||||
|
g, err := strconv.ParseBool(global)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
m, err := strconv.ParseBool(merged)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return export(appName, g, m, format)
|
||||||
|
}
|
||||||
|
|
||||||
// TriggerConfigGet returns an app config value by key
|
// TriggerConfigGet returns an app config value by key
|
||||||
func TriggerConfigGet(appName string, key string) error {
|
func TriggerConfigGet(appName string, key string) error {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core cron plugin"
|
description = "dokku core cron plugin"
|
||||||
version = "0.23.2"
|
version = "0.23.3"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core docker-options plugin"
|
description = "dokku core docker-options plugin"
|
||||||
version = "0.23.2"
|
version = "0.23.3"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core domains plugin"
|
description = "dokku core domains plugin"
|
||||||
version = "0.23.2"
|
version = "0.23.3"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core enter plugin"
|
description = "dokku core enter plugin"
|
||||||
version = "0.23.2"
|
version = "0.23.3"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core git plugin"
|
description = "dokku core git plugin"
|
||||||
version = "0.23.2"
|
version = "0.23.3"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core logs plugin"
|
description = "dokku core logs plugin"
|
||||||
version = "0.23.2"
|
version = "0.23.3"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ func TriggerDockerArgsProcessDeploy(appName string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if maxSize != "unlimited" {
|
if maxSize != "unlimited" {
|
||||||
fmt.Printf(" --log-opt max-size=%s ", maxSize)
|
fmt.Printf(" --log-opt=max-size=%s ", maxSize)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core network plugin"
|
description = "dokku core network plugin"
|
||||||
version = "0.23.2"
|
version = "0.23.3"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core nginx-vhosts plugin"
|
description = "dokku core nginx-vhosts plugin"
|
||||||
version = "0.23.2"
|
version = "0.23.3"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core plugin plugin"
|
description = "dokku core plugin plugin"
|
||||||
version = "0.23.2"
|
version = "0.23.3"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core proxy plugin"
|
description = "dokku core proxy plugin"
|
||||||
version = "0.23.2"
|
version = "0.23.3"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core ps plugin"
|
description = "dokku core ps plugin"
|
||||||
version = "0.23.2"
|
version = "0.23.3"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core repo plugin"
|
description = "dokku core repo plugin"
|
||||||
version = "0.23.2"
|
version = "0.23.3"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core resource plugin"
|
description = "dokku core resource plugin"
|
||||||
version = "0.23.2"
|
version = "0.23.3"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core scheduler-docker-local plugin"
|
description = "dokku core scheduler-docker-local plugin"
|
||||||
version = "0.23.2"
|
version = "0.23.3"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
@@ -17,15 +17,18 @@ trigger-scheduler-docker-local-scheduler-deploy() {
|
|||||||
|
|
||||||
rm -f "${DOKKU_LIB_ROOT}/data/scheduler-docker-local/$APP/failed-containers"
|
rm -f "${DOKKU_LIB_ROOT}/data/scheduler-docker-local/$APP/failed-containers"
|
||||||
|
|
||||||
local DOCKER_RUN_LABEL_ARGS="--label=com.dokku.app-name=$APP"
|
local DOCKER_RUN_LABEL_ARGS="--label=com.dokku.app-name=$APP --label=com.dokku.container-type=deploy"
|
||||||
local DOKKU_DOCKER_STOP_TIMEOUT DOKKU_HEROKUISH DOKKU_NETWORK_BIND_ALL IMAGE
|
local DOKKU_DOCKER_STOP_TIMEOUT DOKKU_HEROKUISH DOKKU_NETWORK_BIND_ALL IMAGE
|
||||||
DOKKU_HEROKUISH=false
|
DOKKU_HEROKUISH=false
|
||||||
|
DOKKU_CNB=false
|
||||||
IMAGE=$(get_deploying_app_image_name "$APP" "$IMAGE_TAG")
|
IMAGE=$(get_deploying_app_image_name "$APP" "$IMAGE_TAG")
|
||||||
plugn trigger pre-deploy "$APP" "$IMAGE_TAG"
|
plugn trigger pre-deploy "$APP" "$IMAGE_TAG"
|
||||||
|
|
||||||
|
is_image_cnb_based "$IMAGE" && DOKKU_CNB=true
|
||||||
is_image_herokuish_based "$IMAGE" "$APP" && DOKKU_HEROKUISH=true
|
is_image_herokuish_based "$IMAGE" "$APP" && DOKKU_HEROKUISH=true
|
||||||
local IMAGE_SOURCE_TYPE="dockerfile"
|
local IMAGE_SOURCE_TYPE="dockerfile"
|
||||||
[[ "$DOKKU_HEROKUISH" == "true" ]] && IMAGE_SOURCE_TYPE="herokuish"
|
[[ "$DOKKU_HEROKUISH" == "true" ]] && IMAGE_SOURCE_TYPE="herokuish"
|
||||||
|
[[ "$DOKKU_CNB" == "true" ]] && IMAGE_SOURCE_TYPE="cnb"
|
||||||
local DOKKU_SCALE_FILE="$DOKKU_ROOT/$APP/DOKKU_SCALE"
|
local DOKKU_SCALE_FILE="$DOKKU_ROOT/$APP/DOKKU_SCALE"
|
||||||
local oldids=$(get_app_container_ids "$APP")
|
local oldids=$(get_app_container_ids "$APP")
|
||||||
|
|
||||||
@@ -72,43 +75,41 @@ trigger-scheduler-docker-local-scheduler-deploy() {
|
|||||||
# start the app
|
# start the app
|
||||||
local DOCKER_ARGS
|
local DOCKER_ARGS
|
||||||
DOCKER_ARGS=$(: | plugn trigger docker-args-deploy "$APP" "$IMAGE_TAG" "$PROC_TYPE" "$CONTAINER_INDEX")
|
DOCKER_ARGS=$(: | plugn trigger docker-args-deploy "$APP" "$IMAGE_TAG" "$PROC_TYPE" "$CONTAINER_INDEX")
|
||||||
DOCKER_ARGS+=" -e DYNO=$DYNO "
|
DOCKER_ARGS+=" --label=com.dokku.process-type=$PROC_TYPE --label=com.dokku.dyno=$DYNO "
|
||||||
|
DOCKER_ARGS+=" --env=DYNO=$DYNO "
|
||||||
|
DOCKER_ARGS+=" --init "
|
||||||
|
DOCKER_ARGS+=" $DOCKER_RUN_LABEL_ARGS $DOKKU_GLOBAL_RUN_ARGS "
|
||||||
DOCKER_ARGS+=$(: | plugn trigger docker-args-process-deploy "$APP" "$IMAGE_SOURCE_TYPE" "$IMAGE_TAG" "$PROC_TYPE" "$CONTAINER_INDEX")
|
DOCKER_ARGS+=$(: | plugn trigger docker-args-process-deploy "$APP" "$IMAGE_SOURCE_TYPE" "$IMAGE_TAG" "$PROC_TYPE" "$CONTAINER_INDEX")
|
||||||
[[ "$DOKKU_TRACE" ]] && DOCKER_ARGS+=" -e TRACE=true "
|
[[ "$DOKKU_TRACE" ]] && DOCKER_ARGS+=" --env=TRACE=true "
|
||||||
|
|
||||||
declare -a ARG_ARRAY
|
|
||||||
eval "ARG_ARRAY=($DOCKER_ARGS)"
|
|
||||||
|
|
||||||
local START_CMD
|
local START_CMD
|
||||||
[[ "$DOKKU_HEROKUISH" == "true" ]] && START_CMD="/start $PROC_TYPE"
|
[[ "$DOKKU_HEROKUISH" == "true" ]] && START_CMD="/start $PROC_TYPE"
|
||||||
|
[[ "$DOKKU_CNB" == "true" ]] && START_CMD=""
|
||||||
[[ -n "$DOKKU_START_CMD" ]] && START_CMD="$DOKKU_START_CMD"
|
[[ -n "$DOKKU_START_CMD" ]] && START_CMD="$DOKKU_START_CMD"
|
||||||
|
|
||||||
|
local DOKKU_PORT=""
|
||||||
if [[ "$PROC_TYPE" == "web" ]]; then
|
if [[ "$PROC_TYPE" == "web" ]]; then
|
||||||
ports=($(plugn trigger network-compute-ports "$APP" "$PROC_TYPE" "$DOKKU_HEROKUISH" "$CONTAINER_INDEX"))
|
ports=($(plugn trigger network-compute-ports "$APP" "$PROC_TYPE" "$DOKKU_HEROKUISH" "$CONTAINER_INDEX"))
|
||||||
local DOKKU_DOCKER_PORT_ARGS=""
|
local DOKKU_DOCKER_PORT_ARGS=""
|
||||||
local DOKKU_PORT=""
|
|
||||||
for p in "${ports[@]}"; do
|
for p in "${ports[@]}"; do
|
||||||
if [[ ! "$p" =~ .*udp.* ]]; then
|
if [[ ! "$p" =~ .*udp.* ]]; then
|
||||||
DOKKU_PORT=${DOKKU_PORT:="$p"}
|
DOKKU_PORT=${DOKKU_PORT:="$p"}
|
||||||
fi
|
fi
|
||||||
DOKKU_DOCKER_PORT_ARGS+=" -p $p "
|
|
||||||
|
if [[ "$DOKKU_NETWORK_BIND_ALL" == "true" ]]; then
|
||||||
|
DOCKER_ARGS+=" -p $p "
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
START_CMD=$(fn-scheduler-docker-local-extract-start-cmd "$APP" "$PROC_TYPE" "$START_CMD" "$DOKKU_HEROKUISH" "$DOKKU_PORT")
|
|
||||||
if [[ "$DOKKU_NETWORK_BIND_ALL" == "false" ]]; then
|
|
||||||
# shellcheck disable=SC2086
|
|
||||||
cid=$("$DOCKER_BIN" container create --label=com.dokku.container-type=deploy --label=com.dokku.process-type=$PROC_TYPE --label=com.dokku.dyno=$DYNO "${DOCKER_RUN_LABEL_ARGS[@]}" $DOKKU_GLOBAL_RUN_ARGS --init --env PORT=$DOKKU_PORT "${ARG_ARRAY[@]}" $IMAGE $START_CMD)
|
|
||||||
else
|
|
||||||
# shellcheck disable=SC2086
|
|
||||||
cid=$("$DOCKER_BIN" container create --label=com.dokku.container-type=deploy --label=com.dokku.process-type=$PROC_TYPE --label=com.dokku.dyno=$DYNO "${DOCKER_RUN_LABEL_ARGS[@]}" $DOKKU_GLOBAL_RUN_ARGS --init $DOKKU_DOCKER_PORT_ARGS --env PORT=$DOKKU_PORT "${ARG_ARRAY[@]}" $IMAGE $START_CMD)
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
START_CMD=$(fn-scheduler-docker-local-extract-start-cmd "$APP" "$PROC_TYPE" "$START_CMD" "$DOKKU_HEROKUISH")
|
|
||||||
|
|
||||||
# shellcheck disable=SC2086
|
|
||||||
cid=$("$DOCKER_BIN" container create --label=com.dokku.container-type=deploy --label=com.dokku.process-type=$PROC_TYPE --label=com.dokku.dyno=$DYNO "${DOCKER_RUN_LABEL_ARGS[@]}" $DOKKU_GLOBAL_RUN_ARGS --init --env PORT=$DOKKU_PORT "${ARG_ARRAY[@]}" $IMAGE $START_CMD)
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
DOCKER_ARGS+=" --env=PORT=$DOKKU_PORT "
|
||||||
|
|
||||||
|
START_CMD=$(fn-scheduler-docker-local-extract-start-cmd "$APP" "$PROC_TYPE" "$START_CMD" "$DOKKU_HEROKUISH" "$DOKKU_PORT")
|
||||||
|
DOCKER_ARGS+=" $IMAGE "
|
||||||
|
DOCKER_ARGS+=" $START_CMD "
|
||||||
|
|
||||||
|
cid=$(fn-start-app-container "$DOCKER_ARGS")
|
||||||
|
|
||||||
plugn trigger post-container-create "app" "$cid" "$APP" "deploy" "$PROC_TYPE"
|
plugn trigger post-container-create "app" "$cid" "$APP" "deploy" "$PROC_TYPE"
|
||||||
"$DOCKER_BIN" container start "$cid" >/dev/null || true
|
"$DOCKER_BIN" container start "$cid" >/dev/null || true
|
||||||
|
|
||||||
@@ -208,7 +209,7 @@ trigger-scheduler-docker-local-scheduler-deploy() {
|
|||||||
fn-scheduler-docker-local-extract-start-cmd() {
|
fn-scheduler-docker-local-extract-start-cmd() {
|
||||||
declare APP="$1" PROC_TYPE="$2" START_CMD="$3" DOKKU_HEROKUISH="$4" PORT="$5"
|
declare APP="$1" PROC_TYPE="$2" START_CMD="$3" DOKKU_HEROKUISH="$4" PORT="$5"
|
||||||
local DOKKU_DOCKERFILE_START_CMD DOKKU_PROCFILE_START_CMD START_CMD
|
local DOKKU_DOCKERFILE_START_CMD DOKKU_PROCFILE_START_CMD START_CMD
|
||||||
if [[ "$DOKKU_HEROKUISH" != "false" ]]; then
|
if [[ "$DOKKU_HEROKUISH" != "false" ]] && [[ -n "$START_CMD" ]]; then
|
||||||
echo "$START_CMD"
|
echo "$START_CMD"
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
@@ -219,4 +220,14 @@ fn-scheduler-docker-local-extract-start-cmd() {
|
|||||||
echo "$START_CMD"
|
echo "$START_CMD"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn-start-app-container() {
|
||||||
|
declare desc="starts a single app container"
|
||||||
|
declare DOCKER_ARGS="$1"
|
||||||
|
|
||||||
|
declare -a __DOKKU_DOCKER_ARG_ARRAY
|
||||||
|
eval "__DOKKU_DOCKER_ARG_ARRAY=($DOCKER_ARGS)"
|
||||||
|
eval "$(config_export app "$APP")"
|
||||||
|
"$DOCKER_BIN" container create "${__DOKKU_DOCKER_ARG_ARRAY[@]}"
|
||||||
|
}
|
||||||
|
|
||||||
trigger-scheduler-docker-local-scheduler-deploy "$@"
|
trigger-scheduler-docker-local-scheduler-deploy "$@"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core shell plugin"
|
description = "dokku core shell plugin"
|
||||||
version = "0.23.2"
|
version = "0.23.3"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core ssh-keys plugin"
|
description = "dokku core ssh-keys plugin"
|
||||||
version = "0.23.2"
|
version = "0.23.3"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core storage plugin"
|
description = "dokku core storage plugin"
|
||||||
version = "0.23.2"
|
version = "0.23.3"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core tags plugin"
|
description = "dokku core tags plugin"
|
||||||
version = "0.23.2"
|
version = "0.23.3"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core tar plugin"
|
description = "dokku core tar plugin"
|
||||||
version = "0.23.2"
|
version = "0.23.3"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
description = "dokku core trace plugin"
|
description = "dokku core trace plugin"
|
||||||
version = "0.23.2"
|
version = "0.23.3"
|
||||||
[plugin.config]
|
[plugin.config]
|
||||||
|
|||||||
15
tests/apps/php/composer.lock
generated
15
tests/apps/php/composer.lock
generated
@@ -1000,21 +1000,19 @@
|
|||||||
"packages-dev": [
|
"packages-dev": [
|
||||||
{
|
{
|
||||||
"name": "heroku/heroku-buildpack-php",
|
"name": "heroku/heroku-buildpack-php",
|
||||||
"version": "v188",
|
"version": "v189",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/heroku/heroku-buildpack-php.git",
|
"url": "https://github.com/heroku/heroku-buildpack-php.git",
|
||||||
"reference": "9e577b876c529a24c0ba18d2df063d1a06c55af7"
|
"reference": "967a2b977b849d8d11112e40401c04927bda3f64"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/heroku/heroku-buildpack-php/zipball/9e577b876c529a24c0ba18d2df063d1a06c55af7",
|
"url": "https://api.github.com/repos/heroku/heroku-buildpack-php/zipball/967a2b977b849d8d11112e40401c04927bda3f64",
|
||||||
"reference": "9e577b876c529a24c0ba18d2df063d1a06c55af7",
|
"reference": "967a2b977b849d8d11112e40401c04927bda3f64",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"bin": [
|
"bin": [
|
||||||
"bin/heroku-hhvm-apache2",
|
|
||||||
"bin/heroku-hhvm-nginx",
|
|
||||||
"bin/heroku-php-apache2",
|
"bin/heroku-php-apache2",
|
||||||
"bin/heroku-php-nginx"
|
"bin/heroku-php-nginx"
|
||||||
],
|
],
|
||||||
@@ -1029,18 +1027,17 @@
|
|||||||
"email": "dz@heroku.com"
|
"email": "dz@heroku.com"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"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",
|
"description": "Toolkit for starting a PHP application locally, with or without foreman, using the same config for PHP and Apache2/Nginx as on Heroku",
|
||||||
"homepage": "https://github.com/heroku/heroku-buildpack-php",
|
"homepage": "https://github.com/heroku/heroku-buildpack-php",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"apache",
|
"apache",
|
||||||
"apache2",
|
"apache2",
|
||||||
"foreman",
|
"foreman",
|
||||||
"heroku",
|
"heroku",
|
||||||
"hhvm",
|
|
||||||
"nginx",
|
"nginx",
|
||||||
"php"
|
"php"
|
||||||
],
|
],
|
||||||
"time": "2021-01-08T20:33:01+00:00"
|
"time": "2021-02-05T19:38:34+00:00"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"aliases": [],
|
"aliases": [],
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
https://github.com/dokku/buildpack-null.git
|
|
||||||
@@ -7,7 +7,7 @@ cron: python3 worker.py
|
|||||||
web: python3 web.py # testing inline comment
|
web: python3 web.py # testing inline comment
|
||||||
worker: python3 worker.py
|
worker: python3 worker.py
|
||||||
custom: echo -n
|
custom: echo -n
|
||||||
release: touch /app/release.test
|
release: python3 release.py
|
||||||
|
|
||||||
|
|
||||||
# Old version with separate processes (use this if you have issues with the threaded version)
|
# Old version with separate processes (use this if you have issues with the threaded version)
|
||||||
|
|||||||
10
tests/apps/python/release.py
Normal file
10
tests/apps/python/release.py
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
import os
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
print("SECRET_KEY: {0}".format(os.getenv('SECRET_KEY')))
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
main()
|
||||||
1
tests/apps/python/requirements.txt
Normal file
1
tests/apps/python/requirements.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
flask
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
import http.server
|
import http.server
|
||||||
|
import json
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
|
||||||
@@ -7,7 +8,12 @@ class GetHandler(http.server.BaseHTTPRequestHandler):
|
|||||||
self.send_response(200)
|
self.send_response(200)
|
||||||
self.send_header("Content-Type", "text/plain; charset=utf-8")
|
self.send_header("Content-Type", "text/plain; charset=utf-8")
|
||||||
self.end_headers()
|
self.end_headers()
|
||||||
self.wfile.write("python/http.server".encode("utf-8"))
|
|
||||||
|
if self.path == '/':
|
||||||
|
self.wfile.write("python/http.server".encode("utf-8"))
|
||||||
|
else:
|
||||||
|
data = json.dumps(dict(os.environ), sort_keys=True, indent=4)
|
||||||
|
self.wfile.write(data.encode("utf-8"))
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|||||||
@@ -1,6 +1,12 @@
|
|||||||
#!/usr/bin/env bats
|
#!/usr/bin/env bats
|
||||||
load test_helper
|
load test_helper
|
||||||
|
|
||||||
|
setup_file() {
|
||||||
|
add-apt-repository --yes ppa:cncf-buildpacks/pack-cli
|
||||||
|
apt-get update
|
||||||
|
apt-get --yes install pack-cli
|
||||||
|
}
|
||||||
|
|
||||||
setup() {
|
setup() {
|
||||||
global_setup
|
global_setup
|
||||||
create_app
|
create_app
|
||||||
@@ -103,3 +109,23 @@ teardown() {
|
|||||||
echo "status: $status"
|
echo "status: $status"
|
||||||
assert_success
|
assert_success
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@test "(app-json) app.json cnb release" {
|
||||||
|
run /bin/bash -c "dokku config:set --no-restart $TEST_APP DOKKU_CNB_EXPERIMENTAL=1 SECRET_KEY=fjdkslafjdk"
|
||||||
|
echo "output: $output"
|
||||||
|
echo "status: $status"
|
||||||
|
assert_success
|
||||||
|
|
||||||
|
run deploy_app python dokku@dokku.me:$TEST_APP add_requirements_txt
|
||||||
|
echo "output: $output"
|
||||||
|
echo "status: $status"
|
||||||
|
assert_success
|
||||||
|
assert_output_contains "Executing release task from Procfile"
|
||||||
|
assert_output_contains "SECRET_KEY: fjdkslafjdk"
|
||||||
|
|
||||||
|
run /bin/bash -c "curl $(dokku url $TEST_APP)/env"
|
||||||
|
echo "output: $output"
|
||||||
|
echo "status: $status"
|
||||||
|
assert_success
|
||||||
|
assert_output_contains '"SECRET_KEY": "fjdkslafjdk"'
|
||||||
|
}
|
||||||
|
|||||||
@@ -303,9 +303,14 @@ teardown() {
|
|||||||
echo "output: $output"
|
echo "output: $output"
|
||||||
echo "status: $status"
|
echo "status: $status"
|
||||||
assert_success
|
assert_success
|
||||||
|
|
||||||
run /bin/bash -c "dokku docker-options:add $TEST_APP build \"--link postgres\""
|
run /bin/bash -c "dokku docker-options:add $TEST_APP build \"--link postgres\""
|
||||||
echo "output: $output"
|
echo "output: $output"
|
||||||
echo "status: $status"
|
echo "status: $status"
|
||||||
assert_success
|
assert_success
|
||||||
deploy_app dockerfile
|
|
||||||
|
run deploy_app dockerfile
|
||||||
|
echo "output: $output"
|
||||||
|
echo "status: $status"
|
||||||
|
assert_success
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -385,7 +385,7 @@ teardown() {
|
|||||||
echo "output: $output"
|
echo "output: $output"
|
||||||
echo "status: $status"
|
echo "status: $status"
|
||||||
assert_success
|
assert_success
|
||||||
assert_output "--log-opt max-size=20m"
|
assert_output "--log-opt=max-size=20m"
|
||||||
|
|
||||||
run /bin/bash -c "dokku docker-options:add $TEST_APP deploy --log-driver=local" 2>&1
|
run /bin/bash -c "dokku docker-options:add $TEST_APP deploy --log-driver=local" 2>&1
|
||||||
echo "output: $output"
|
echo "output: $output"
|
||||||
@@ -396,7 +396,7 @@ teardown() {
|
|||||||
echo "output: $output"
|
echo "output: $output"
|
||||||
echo "status: $status"
|
echo "status: $status"
|
||||||
assert_success
|
assert_success
|
||||||
assert_output "--log-opt max-size=20m"
|
assert_output "--log-opt=max-size=20m"
|
||||||
|
|
||||||
run /bin/bash -c "dokku docker-options:add $TEST_APP deploy --log-driver=json-file" 2>&1
|
run /bin/bash -c "dokku docker-options:add $TEST_APP deploy --log-driver=json-file" 2>&1
|
||||||
echo "output: $output"
|
echo "output: $output"
|
||||||
@@ -407,7 +407,7 @@ teardown() {
|
|||||||
echo "output: $output"
|
echo "output: $output"
|
||||||
echo "status: $status"
|
echo "status: $status"
|
||||||
assert_success
|
assert_success
|
||||||
assert_output "--log-opt max-size=20m"
|
assert_output "--log-opt=max-size=20m"
|
||||||
|
|
||||||
run /bin/bash -c "dokku docker-options:add $TEST_APP deploy --log-driver=journald" 2>&1
|
run /bin/bash -c "dokku docker-options:add $TEST_APP deploy --log-driver=journald" 2>&1
|
||||||
echo "output: $output"
|
echo "output: $output"
|
||||||
|
|||||||
37
tests/unit/ps-cnb.bats
Normal file
37
tests/unit/ps-cnb.bats
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
#!/usr/bin/env bats
|
||||||
|
|
||||||
|
load test_helper
|
||||||
|
|
||||||
|
setup_file() {
|
||||||
|
add-apt-repository --yes ppa:cncf-buildpacks/pack-cli
|
||||||
|
apt-get update
|
||||||
|
apt-get --yes install pack-cli
|
||||||
|
}
|
||||||
|
|
||||||
|
setup() {
|
||||||
|
global_setup
|
||||||
|
create_app
|
||||||
|
}
|
||||||
|
|
||||||
|
teardown() {
|
||||||
|
destroy_app
|
||||||
|
global_teardown
|
||||||
|
}
|
||||||
|
|
||||||
|
@test "(ps) cnb env vars" {
|
||||||
|
run /bin/bash -c "dokku config:set $TEST_APP DOKKU_CNB_EXPERIMENTAL=1"
|
||||||
|
echo "output: $output"
|
||||||
|
echo "status: $status"
|
||||||
|
assert_success
|
||||||
|
|
||||||
|
run deploy_app python dokku@dokku.me:$TEST_APP add_requirements_txt
|
||||||
|
echo "output: $output"
|
||||||
|
echo "status: $status"
|
||||||
|
assert_success
|
||||||
|
|
||||||
|
run /bin/bash -c "curl $(dokku url $TEST_APP)/env"
|
||||||
|
echo "output: $output"
|
||||||
|
echo "status: $status"
|
||||||
|
assert_success
|
||||||
|
assert_output_contains '"DOKKU_CNB_EXPERIMENTAL": "1"'
|
||||||
|
}
|
||||||
@@ -9,7 +9,6 @@ setup() {
|
|||||||
|
|
||||||
teardown() {
|
teardown() {
|
||||||
destroy_app
|
destroy_app
|
||||||
destroy_app 0 "$MYAPP" || true
|
|
||||||
global_teardown
|
global_teardown
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -513,6 +513,13 @@ add_release_command() {
|
|||||||
echo "release: touch /app/release.test" >> "$APP_REPO_DIR/Procfile"
|
echo "release: touch /app/release.test" >> "$APP_REPO_DIR/Procfile"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
add_requirements_txt() {
|
||||||
|
local APP="$1"
|
||||||
|
local APP_REPO_DIR="$2"
|
||||||
|
[[ -z "$APP" ]] && local APP="$TEST_APP"
|
||||||
|
echo "flask" >> "$APP_REPO_DIR/requirements.txt"
|
||||||
|
}
|
||||||
|
|
||||||
build_nginx_config() {
|
build_nginx_config() {
|
||||||
# simulate nginx post-deploy
|
# simulate nginx post-deploy
|
||||||
dokku domains:setup "$TEST_APP"
|
dokku domains:setup "$TEST_APP"
|
||||||
|
|||||||
Reference in New Issue
Block a user