Compare commits

...

34 Commits

Author SHA1 Message Date
Jose Diaz-Gonzalez
197f0c7c95 Release 0.23.3
Some checks failed
bump-formula / bump-formula (push) Has been cancelled
# 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
2021-02-11 07:58:47 -05:00
Jose Diaz-Gonzalez
ef2682945c Merge pull request #4397 from dokku/cnb-deployment-tasks
Correctly handle environment variables in deployment tasks for Cloud Native Buildpacks
2021-02-11 07:57:55 -05:00
Jose Diaz-Gonzalez
5e7ea4217f tests: install pack for app-json tests 2021-02-11 07:34:27 -05:00
Jose Diaz-Gonzalez
123fbea7c0 feat: add a deployment task test for cnb 2021-02-11 07:16:54 -05:00
Jose Diaz-Gonzalez
0673fdff2d fix: handle new herokuish image detection in deployment tasks 2021-02-11 07:16:43 -05:00
Jose Diaz-Gonzalez
e07befb93c Merge pull request #4396 from nerg4l/documentation-patch-cloud-native-buildpacks-link
Invalid link to Herokuish Buildpack Deployment in Cloud Native Buildpacks
2021-02-11 07:15:49 -05:00
László Görög
8e1f890322 docs: fix link
[ci skip]
2021-02-11 13:12:07 +01:00
Jose Diaz-Gonzalez
8ca713f6bb fix: handle empty start command for cnb apps
We should instead fetch the command from the Procfile.
2021-02-11 06:53:48 -05:00
Jose Diaz-Gonzalez
da1ddee0ba fix: override the launcher for cnb apps since the default launcher is the process launcher... 2021-02-11 06:51:01 -05:00
Jose Diaz-Gonzalez
d48cf24c4d fix: unify IsImageHerokuishBased with shell version
Really we should just spit this out into a bin and then have the shell version wrap the golang ones...
2021-02-11 06:49:19 -05:00
Jose Diaz-Gonzalez
5614475521 refactor: reverse if statements
The shell version of IsImageHerokuishBased returns true if it is CNB for legacy reasons...
2021-02-11 06:48:38 -05:00
Jose Diaz-Gonzalez
b826770687 fix: add cnb fix to copy_from_image 2021-02-11 06:43:37 -05:00
Jose Diaz-Gonzalez
34807028db feat: ensure we inject environment variables into the docker container create call in app-json
This fixes an issue where the values are empty for CNB applications.
2021-02-11 06:43:15 -05:00
Jose Diaz-Gonzalez
0405b36ab4 fix: implement config-export hook
This will allow dropping many of the "source config/functions" calls littered over the codebase. Plugin triggers are the way to perform cross-plugin communication :)
2021-02-11 06:41:11 -05:00
Jose Diaz-Gonzalez
291f59999c Merge pull request #4395 from dokku/cnb-env-vars
Add environment variable support to CNB-based containers
2021-02-11 05:21:31 -05:00
Jose Diaz-Gonzalez
1568fc7827 refactor: only special case cnb for now 2021-02-11 04:21:08 -05:00
Jose Diaz-Gonzalez
681fd6abf6 fix: install pack for tests 2021-02-11 04:04:25 -05:00
Jose Diaz-Gonzalez
031159c1b9 fix: correct dockblock 2021-02-11 04:02:06 -05:00
Jose Diaz-Gonzalez
812e34c6f5 feat: properly export env vars for cnb apps
They are not baked into the image like they are for herokuish, so we need to manually set them via --env. Additionally, due to newline constraints in docker, we need to use `--env=key` format to correctly pull the values into place.
2021-02-11 03:52:02 -05:00
Jose Diaz-Gonzalez
5921692f83 feat: add ability to export env vars as a --env=key ... string 2021-02-11 03:50:51 -05:00
Jose Diaz-Gonzalez
33d5dd44d9 refactor: pull container creation into standalone function
this is necessary for us to be able to inject env vars into the call.
2021-02-11 03:50:08 -05:00
Jose Diaz-Gonzalez
d7562d36e6 chore: drop unused destroy 2021-02-11 03:48:42 -05:00
Jose Diaz-Gonzalez
49a2f8ab82 fix: properly specify as argument array 2021-02-11 02:21:43 -05:00
Jose Diaz-Gonzalez
82afae6447 tests: add missing assertion 2021-02-11 02:21:29 -05:00
Jose Diaz-Gonzalez
25ab915883 refactor: standardize on using long-form and equal sign for docker arguments 2021-02-11 02:21:16 -05:00
Jose Diaz-Gonzalez
0963c403ab refactor: simplify container creation call 2021-02-10 11:18:12 -05:00
Jose Diaz-Gonzalez
9c1852fcdb Merge pull request #4393 from dokku/cnb-docker-image-labeler
Use docker-image-labeler in cnb builder-build trigger
2021-02-10 10:33:27 -05:00
Jose Diaz-Gonzalez
a6aef82236 Merge pull request #4394 from dokku/fix-custom-shell
Swap order of arguments on config-get call
2021-02-10 10:33:17 -05:00
Jose Diaz-Gonzalez
8b4e31bb22 refactor: use docker-image-labeler in cnb builder-build trigger 2021-02-10 05:24:11 -05:00
Jose Diaz-Gonzalez
7c923a0fa1 fix: swap order of arguments on config-get call 2021-02-10 05:23:42 -05:00
Jose Diaz-Gonzalez
169f202994 Merge pull request #4390 from dokku/faster-null-runs
Run tests faster by not cloning the buildpack each time
2021-02-08 12:28:56 -05:00
Jose Diaz-Gonzalez
4448e60a8b tests: run tests faster by not cloning the buildpack each time
This is now included in herokuish.
2021-02-08 11:17:14 -05:00
Jose Diaz-Gonzalez
c744c25d35 Merge pull request #4389 from dokku/dependabot/composer/tests/apps/php/heroku/heroku-buildpack-php-189
chore(deps-dev): bump heroku/heroku-buildpack-php from 188 to 189 in /tests/apps/php
2021-02-08 10:51:03 -05:00
dependabot-preview[bot]
f9ebdae66d chore(deps-dev): bump heroku/heroku-buildpack-php in /tests/apps/php
Bumps [heroku/heroku-buildpack-php](https://github.com/heroku/heroku-buildpack-php) from 188 to 189.
- [Release notes](https://github.com/heroku/heroku-buildpack-php/releases)
- [Changelog](https://github.com/heroku/heroku-buildpack-php/blob/main/CHANGELOG.md)
- [Commits](https://github.com/heroku/heroku-buildpack-php/compare/v188...v189)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-02-08 06:53:06 +00:00
78 changed files with 469 additions and 214 deletions

View File

@@ -1,5 +1,39 @@
# 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
Install/update via the bootstrap script:

View File

@@ -1,7 +1,7 @@
DOKKU_VERSION ?= master
DOCKER_IMAGE_LABELER_VERSION ?= 0.2.2
HEROKUISH_VERSION ?= 0.5.19
HEROKUISH_VERSION ?= 0.5.25
PLUGN_VERSION ?= 0.6.1
PROCFILE_VERSION ?= 0.11.0
SIGIL_VERSION ?= 0.6.0

View File

@@ -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`:
```shell
wget https://raw.githubusercontent.com/dokku/dokku/v0.23.2/bootstrap.sh
sudo DOKKU_TAG=v0.23.2 bash bootstrap.sh
wget https://raw.githubusercontent.com/dokku/dokku/v0.23.3/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.

View File

@@ -15,7 +15,7 @@ import subprocess
import sys
import threading
VERSION = 'v0.23.2'
VERSION = 'v0.23.3'
def bytes_to_string(b):
if type(b) == bytes:

2
debian/control vendored
View File

@@ -1,5 +1,5 @@
Package: dokku
Version: 0.23.2
Version: 0.23.3
Section: web
Priority: optional
Architecture: amd64

View File

@@ -35,35 +35,35 @@ dokku plugin:list
```
plugn: dev
00_dokku-standard 0.23.2 enabled dokku core standard plugin
20_events 0.23.2 enabled dokku core events logging plugin
app-json 0.23.2 enabled dokku core app-json plugin
apps 0.23.2 enabled dokku core apps plugin
build-env 0.23.2 enabled dokku core build-env plugin
buildpacks 0.23.2 enabled dokku core buildpacks plugin
certs 0.23.2 enabled dokku core certificate management plugin
checks 0.23.2 enabled dokku core checks plugin
common 0.23.2 enabled dokku core common plugin
config 0.23.2 enabled dokku core config plugin
docker-options 0.23.2 enabled dokku core docker-options plugin
domains 0.23.2 enabled dokku core domains plugin
enter 0.23.2 enabled dokku core enter plugin
git 0.23.2 enabled dokku core git plugin
logs 0.23.2 enabled dokku core logs plugin
network 0.23.2 enabled dokku core network plugin
nginx-vhosts 0.23.2 enabled dokku core nginx-vhosts plugin
plugin 0.23.2 enabled dokku core plugin plugin
proxy 0.23.2 enabled dokku core proxy plugin
ps 0.23.2 enabled dokku core ps plugin
repo 0.23.2 enabled dokku core repo plugin
resource 0.23.2 enabled dokku core resource plugin
scheduler-docker-local 0.23.2 enabled dokku core scheduler-docker-local plugin
shell 0.23.2 enabled dokku core shell plugin
ssh-keys 0.23.2 enabled dokku core ssh-keys plugin
storage 0.23.2 enabled dokku core storage plugin
tags 0.23.2 enabled dokku core tags plugin
tar 0.23.2 enabled dokku core tar plugin
trace 0.23.2 enabled dokku core trace plugin
00_dokku-standard 0.23.3 enabled dokku core standard plugin
20_events 0.23.3 enabled dokku core events logging plugin
app-json 0.23.3 enabled dokku core app-json plugin
apps 0.23.3 enabled dokku core apps plugin
build-env 0.23.3 enabled dokku core build-env plugin
buildpacks 0.23.3 enabled dokku core buildpacks plugin
certs 0.23.3 enabled dokku core certificate management plugin
checks 0.23.3 enabled dokku core checks plugin
common 0.23.3 enabled dokku core common plugin
config 0.23.3 enabled dokku core config plugin
docker-options 0.23.3 enabled dokku core docker-options plugin
domains 0.23.3 enabled dokku core domains plugin
enter 0.23.3 enabled dokku core enter plugin
git 0.23.3 enabled dokku core git plugin
logs 0.23.3 enabled dokku core logs plugin
network 0.23.3 enabled dokku core network plugin
nginx-vhosts 0.23.3 enabled dokku core nginx-vhosts plugin
plugin 0.23.3 enabled dokku core plugin plugin
proxy 0.23.3 enabled dokku core proxy plugin
ps 0.23.3 enabled dokku core ps plugin
repo 0.23.3 enabled dokku core repo plugin
resource 0.23.3 enabled dokku core resource plugin
scheduler-docker-local 0.23.3 enabled dokku core scheduler-docker-local plugin
shell 0.23.3 enabled dokku core shell plugin
ssh-keys 0.23.3 enabled dokku core ssh-keys plugin
storage 0.23.3 enabled dokku core storage plugin
tags 0.23.3 enabled dokku core tags plugin
tar 0.23.3 enabled dokku core tar 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.

View File

@@ -2,10 +2,10 @@
<browserconfig>
<msapplication>
<tile>
<square70x70logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.2/docs/assets/favicons/mstile-70x70.png"/>
<square150x150logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.2/docs/assets/favicons/mstile-150x150.png"/>
<square310x310logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.2/docs/assets/favicons/mstile-310x310.png"/>
<wide310x150logo src="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.2/docs/assets/favicons/mstile-310x150.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.3/docs/assets/favicons/mstile-150x150.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.3/docs/assets/favicons/mstile-310x150.png"/>
<TileColor>#da532c</TileColor>
</tile>
</msapplication>

View File

@@ -2,37 +2,37 @@
"name": "Dokku",
"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",
"type": "image\/png",
"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",
"type": "image\/png",
"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",
"type": "image\/png",
"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",
"type": "image\/png",
"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",
"type": "image\/png",
"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",
"type": "image\/png",
"density": "4.0"

View File

@@ -39,13 +39,13 @@ h1 {
font-size: 1.6em;
}
.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;
}
.blurb {
color: #424242;
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;
text-align: center;
}

View File

@@ -20,6 +20,6 @@
"0.20.4",
"0.21.4",
"0.22.9",
"0.23.2"
"0.23.3"
]
}

View File

@@ -5,7 +5,7 @@
```
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.

View File

@@ -261,6 +261,21 @@ help_content
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`
- Description: Fetches the app config value for a key

View File

@@ -29,7 +29,7 @@ The workflow looks like this:
```shell
# having dokku-arch in ../dokku-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
git add PKGBUILD .SRCINFO
git commit -m 'Update to dokku 0.9.9'

View File

@@ -3,7 +3,7 @@
Pull the dokku/dokku image:
```shell
docker pull dokku/dokku:0.23.2
docker pull dokku/dokku:0.23.3
```
Next, run the image.
@@ -17,7 +17,7 @@ docker run \
--publish 8443:443 \
--volume /var/lib/dokku:/mnt/dokku \
--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:

View File

@@ -21,8 +21,8 @@ To install the latest stable version of Dokku, you can run the following shell c
```shell
# for debian systems, installs Dokku via apt-get
wget https://raw.githubusercontent.com/dokku/dokku/v0.23.2/bootstrap.sh;
sudo DOKKU_TAG=v0.23.2 bash bootstrap.sh
wget https://raw.githubusercontent.com/dokku/dokku/v0.23.3/bootstrap.sh;
sudo DOKKU_TAG=v0.23.3 bash bootstrap.sh
```
The installation process takes about 5-10 minutes, depending upon internet connection speed.

View File

@@ -10,30 +10,30 @@
<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>
<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="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="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="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="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="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="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="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="180x180" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.2/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.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.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.2/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="shortcut icon" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.2/docs/assets/favicons/favicon.ico">
<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.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.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.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.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.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.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.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.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.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.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.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.3/docs/assets/favicons/favicon-16x16.png" sizes="16x16">
<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.3/docs/assets/favicons/favicon.ico">
<meta name="apple-mobile-web-app-title" content="Dokku">
<meta name="application-name" content="Dokku">
<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-config" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.2/docs/assets/favicons/browserconfig.xml">
<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.3/docs/assets/favicons/browserconfig.xml">
<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://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"> -->
<style>
.sponsors {
@@ -130,12 +130,12 @@
<p class="line">
<span class="path"></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 class="line">
<span class="path"></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 class="line">
<span class="output">&nbsp;# go to your server's IP and follow the web installer</span>

View File

@@ -9,26 +9,26 @@
<meta name="author" content="">
<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="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="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="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="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="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="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="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="180x180" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.2/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.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.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.2/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="shortcut icon" href="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.2/docs/assets/favicons/favicon.ico">
<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.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.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.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.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.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.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.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.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.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.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.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.3/docs/assets/favicons/favicon-16x16.png" sizes="16x16">
<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.3/docs/assets/favicons/favicon.ico">
<meta name="apple-mobile-web-app-title" content="Dokku">
<meta name="application-name" content="Dokku">
<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-config" content="https://cdn.jsdelivr.net/gh/dokku/dokku@v0.23.2/docs/assets/favicons/browserconfig.xml">
<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.3/docs/assets/favicons/browserconfig.xml">
<meta name="theme-color" content="#ffffff">
<script>
@@ -42,7 +42,7 @@
</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://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="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css" rel="stylesheet">
<style>

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core standard plugin"
version = "0.23.2"
version = "0.23.3"
[plugin.config]

View File

@@ -0,0 +1 @@
hook

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core events logging plugin"
version = "0.23.2"
version = "0.23.3"
[plugin.config]

View File

@@ -16,7 +16,7 @@ import (
"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 {
words, err := shellquote.Split(strings.TrimSpace(command))
if err != nil {
@@ -31,7 +31,7 @@ func constructScript(command string, shell string, isHerokuishImage bool, hasEnt
script = append(script, "set -x;")
}
if isHerokuishImage {
if isHerokuishImage && !isCnbImage {
script = append(script, []string{
"if [[ -d '/app' ]]; then",
" 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))
if isHerokuishImage {
if isHerokuishImage && !isCnbImage {
script = append(script, []string{
"if [[ -d '/cache' ]]; then",
" rm -f /tmp/cache;",
@@ -127,7 +127,7 @@ func getDokkuAppShell(appName string) string {
return nil
})
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[:]))
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))
isHerokuishImage := common.IsImageHerokuishBased(image, appName)
isCnbImage := common.IsImageCnbBased(image)
dockerfileEntrypoint := ""
dockerfileCommand := ""
if !isHerokuishImage {
@@ -173,11 +174,13 @@ func executeScript(appName string, image string, imageTag string, phase string)
hasEntrypoint := dockerfileEntrypoint != ""
dokkuAppShell := getDokkuAppShell(appName)
script := constructScript(command, dokkuAppShell, isHerokuishImage, hasEntrypoint)
script := constructScript(command, dokkuAppShell, isHerokuishImage, isCnbImage, hasEntrypoint)
imageSourceType := "dockerfile"
if isHerokuishImage {
imageSourceType = "herokuish"
} else if isCnbImage {
imageSourceType = "cnb"
}
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") != "" {
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)
if err != nil {
@@ -246,7 +256,7 @@ func executeScript(appName string, image string, imageTag string, phase string)
}
commitArgs := []string{"container", "commit"}
if !isHerokuishImage {
if !isHerokuishImage || isCnbImage {
if 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, 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(
common.DockerBin(),
arguments...,
)
var stderr bytes.Buffer
containerCreateCmd.Env = env
containerCreateCmd.ShowOutput = false
containerCreateCmd.Command.Stderr = &stderr
b, err := containerCreateCmd.Output()
b, err = containerCreateCmd.Output()
if err != nil {
return "", errors.New(stderr.String())
}

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core app-json plugin"
version = "0.23.2"
version = "0.23.3"
[plugin.config]

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core apps plugin"
version = "0.23.2"
version = "0.23.3"
[plugin.config]

View File

@@ -38,7 +38,7 @@ trigger-builder-cnb-builder-build() {
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"
}

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core builder-cnb plugin"
version = "0.23.2"
version = "0.23.3"
[plugin.config]

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core builder-dockerfile plugin"
version = "0.23.2"
version = "0.23.3"
[plugin.config]

View File

@@ -47,14 +47,14 @@ trigger-builder-herokuish-builder-build() {
plugn trigger pre-build-buildpack "$APP" "$SOURCECODE_WORK_DIR"
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")
declare -a ARG_ARRAY
eval "ARG_ARRAY=($DOCKER_ARGS)"
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"
"$DOCKER_BIN" container start "$CID" >/dev/null || DOKKU_CONTAINER_EXIT_CODE=$?
"$DOCKER_BIN" container attach "$CID"

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core builder-herokuish plugin"
version = "0.23.2"
version = "0.23.3"
[plugin.config]

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core buildpacks plugin"
version = "0.23.2"
version = "0.23.3"
[plugin.config]

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core certificate management plugin"
version = "0.23.2"
version = "0.23.3"
[plugin.config]

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core checks plugin"
version = "0.23.2"
version = "0.23.3"
[plugin.config]

View File

@@ -66,7 +66,9 @@ func CopyFromImage(appName string, image string, source string, destination stri
workDir := ""
if !IsAbsPath(source) {
if IsImageHerokuishBased(image, appName) {
if IsImageCnbBased(image) {
workDir = "/workspace"
} else if IsImageHerokuishBased(image, appName) {
workDir = "/app"
} else {
workDir, _ = DockerInspect(image, "{{.Config.WorkingDir}}")
@@ -257,9 +259,42 @@ func DockerInspect(containerOrImageID, format string) (output string, err error)
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
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 {
return false
}

View File

@@ -477,10 +477,10 @@ copy_from_image() {
if verify_image "$IMAGE"; then
if ! is_abs_path "$SRC_FILE"; then
if is_image_herokuish_based "$IMAGE" "$APP"; then
WORKDIR="/app"
elif is_image_cnb_based "$IMAGE"; then
if is_image_cnb_based "$IMAGE"; then
WORKDIR="/workspace"
elif is_image_herokuish_based "$IMAGE" "$APP"; then
WORKDIR="/app"
else
WORKDIR="$("$DOCKER_BIN" image inspect --format '{{.Config.WorkingDir}}' "$IMAGE")"
fi

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core common plugin"
version = "0.23.2"
version = "0.23.3"
[plugin.config]

View File

@@ -1,5 +1,5 @@
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
PLUGIN_NAME = config

View File

@@ -14,6 +14,12 @@ trigger-config-docker-args() {
STDIN=$(cat)
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
ENV_ARGS="$(config_export app "$APP" --format docker-args --merged)"
echo -n "$STDIN $ENV_ARGS"

View File

@@ -24,8 +24,10 @@ const (
ExportFormatExports ExportFormat = iota
//ExportFormatEnvfile format: dotenv file
ExportFormatEnvfile
//ExportFormatDockerArgs format: --env args for docker
//ExportFormatDockerArgs format: --env KEY=VALUE args for docker
ExportFormatDockerArgs
//ExportFormatDockerArgsKeys format: --env KEY args for docker
ExportFormatDockerArgsKeys
//ExportFormatShell format: env arguments for shell
ExportFormatShell
//ExportFormatPretty format: pretty-printed in columns
@@ -171,6 +173,8 @@ func (e *Env) Export(format ExportFormat) string {
return e.EnvfileString()
case ExportFormatDockerArgs:
return e.DockerArgsString()
case ExportFormatDockerArgsKeys:
return e.DockerArgsKeysString()
case ExportFormatShell:
return e.ShellString()
case ExportFormatPretty:
@@ -201,6 +205,16 @@ func (e *Env) DockerArgsString() string {
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
func (e *Env) JSONString() string {
data, err := json.Marshal(e.Map())

View File

@@ -54,6 +54,7 @@ func TestExport(t *testing.T) {
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(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(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"))

View 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
}

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core config plugin"
version = "0.23.2"
version = "0.23.3"
[plugin.config]

View File

@@ -49,7 +49,7 @@ func main() {
args := flag.NewFlagSet("config:export", flag.ExitOnError)
global := args.Bool("global", false, "--global: use the 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:])
if !*global {
appName = args.Arg(0)

View File

@@ -18,6 +18,12 @@ func main() {
var err error
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":
appName := flag.Arg(0)
key := flag.Arg(1)

View File

@@ -33,37 +33,7 @@ func CommandClear(appName string, global bool, noRestart bool) error {
// CommandExport implements config:export
func CommandExport(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,
"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
return export(appName, global, merged, format)
}
// CommandGet implements config:get

View File

@@ -1,6 +1,23 @@
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
func TriggerConfigGet(appName string, key string) error {

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core cron plugin"
version = "0.23.2"
version = "0.23.3"
[plugin.config]

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core docker-options plugin"
version = "0.23.2"
version = "0.23.3"
[plugin.config]

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core domains plugin"
version = "0.23.2"
version = "0.23.3"
[plugin.config]

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core enter plugin"
version = "0.23.2"
version = "0.23.3"
[plugin.config]

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core git plugin"
version = "0.23.2"
version = "0.23.3"
[plugin.config]

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core logs plugin"
version = "0.23.2"
version = "0.23.3"
[plugin.config]

View File

@@ -49,7 +49,7 @@ func TriggerDockerArgsProcessDeploy(appName string) error {
}
if maxSize != "unlimited" {
fmt.Printf(" --log-opt max-size=%s ", maxSize)
fmt.Printf(" --log-opt=max-size=%s ", maxSize)
}
}

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core network plugin"
version = "0.23.2"
version = "0.23.3"
[plugin.config]

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core nginx-vhosts plugin"
version = "0.23.2"
version = "0.23.3"
[plugin.config]

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core plugin plugin"
version = "0.23.2"
version = "0.23.3"
[plugin.config]

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core proxy plugin"
version = "0.23.2"
version = "0.23.3"
[plugin.config]

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core ps plugin"
version = "0.23.2"
version = "0.23.3"
[plugin.config]

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core repo plugin"
version = "0.23.2"
version = "0.23.3"
[plugin.config]

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core resource plugin"
version = "0.23.2"
version = "0.23.3"
[plugin.config]

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core scheduler-docker-local plugin"
version = "0.23.2"
version = "0.23.3"
[plugin.config]

View File

@@ -17,15 +17,18 @@ trigger-scheduler-docker-local-scheduler-deploy() {
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
DOKKU_HEROKUISH=false
DOKKU_CNB=false
IMAGE=$(get_deploying_app_image_name "$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
local IMAGE_SOURCE_TYPE="dockerfile"
[[ "$DOKKU_HEROKUISH" == "true" ]] && IMAGE_SOURCE_TYPE="herokuish"
[[ "$DOKKU_CNB" == "true" ]] && IMAGE_SOURCE_TYPE="cnb"
local DOKKU_SCALE_FILE="$DOKKU_ROOT/$APP/DOKKU_SCALE"
local oldids=$(get_app_container_ids "$APP")
@@ -72,43 +75,41 @@ trigger-scheduler-docker-local-scheduler-deploy() {
# start the app
local DOCKER_ARGS
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")
[[ "$DOKKU_TRACE" ]] && DOCKER_ARGS+=" -e TRACE=true "
declare -a ARG_ARRAY
eval "ARG_ARRAY=($DOCKER_ARGS)"
[[ "$DOKKU_TRACE" ]] && DOCKER_ARGS+=" --env=TRACE=true "
local START_CMD
[[ "$DOKKU_HEROKUISH" == "true" ]] && START_CMD="/start $PROC_TYPE"
[[ "$DOKKU_CNB" == "true" ]] && START_CMD=""
[[ -n "$DOKKU_START_CMD" ]] && START_CMD="$DOKKU_START_CMD"
local DOKKU_PORT=""
if [[ "$PROC_TYPE" == "web" ]]; then
ports=($(plugn trigger network-compute-ports "$APP" "$PROC_TYPE" "$DOKKU_HEROKUISH" "$CONTAINER_INDEX"))
local DOKKU_DOCKER_PORT_ARGS=""
local DOKKU_PORT=""
for p in "${ports[@]}"; do
if [[ ! "$p" =~ .*udp.* ]]; then
DOKKU_PORT=${DOKKU_PORT:="$p"}
fi
DOKKU_DOCKER_PORT_ARGS+=" -p $p "
if [[ "$DOKKU_NETWORK_BIND_ALL" == "true" ]]; then
DOCKER_ARGS+=" -p $p "
fi
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
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"
"$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() {
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
if [[ "$DOKKU_HEROKUISH" != "false" ]]; then
if [[ "$DOKKU_HEROKUISH" != "false" ]] && [[ -n "$START_CMD" ]]; then
echo "$START_CMD"
return
fi
@@ -219,4 +220,14 @@ fn-scheduler-docker-local-extract-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 "$@"

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core shell plugin"
version = "0.23.2"
version = "0.23.3"
[plugin.config]

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core ssh-keys plugin"
version = "0.23.2"
version = "0.23.3"
[plugin.config]

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core storage plugin"
version = "0.23.2"
version = "0.23.3"
[plugin.config]

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core tags plugin"
version = "0.23.2"
version = "0.23.3"
[plugin.config]

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core tar plugin"
version = "0.23.2"
version = "0.23.3"
[plugin.config]

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core trace plugin"
version = "0.23.2"
version = "0.23.3"
[plugin.config]

View File

@@ -1000,21 +1000,19 @@
"packages-dev": [
{
"name": "heroku/heroku-buildpack-php",
"version": "v188",
"version": "v189",
"source": {
"type": "git",
"url": "https://github.com/heroku/heroku-buildpack-php.git",
"reference": "9e577b876c529a24c0ba18d2df063d1a06c55af7"
"reference": "967a2b977b849d8d11112e40401c04927bda3f64"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/heroku/heroku-buildpack-php/zipball/9e577b876c529a24c0ba18d2df063d1a06c55af7",
"reference": "9e577b876c529a24c0ba18d2df063d1a06c55af7",
"url": "https://api.github.com/repos/heroku/heroku-buildpack-php/zipball/967a2b977b849d8d11112e40401c04927bda3f64",
"reference": "967a2b977b849d8d11112e40401c04927bda3f64",
"shasum": ""
},
"bin": [
"bin/heroku-hhvm-apache2",
"bin/heroku-hhvm-nginx",
"bin/heroku-php-apache2",
"bin/heroku-php-nginx"
],
@@ -1029,18 +1027,17 @@
"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",
"keywords": [
"apache",
"apache2",
"foreman",
"heroku",
"hhvm",
"nginx",
"php"
],
"time": "2021-01-08T20:33:01+00:00"
"time": "2021-02-05T19:38:34+00:00"
}
],
"aliases": [],

View File

@@ -1 +0,0 @@
https://github.com/dokku/buildpack-null.git

View File

@@ -7,7 +7,7 @@ cron: python3 worker.py
web: python3 web.py # testing inline comment
worker: python3 worker.py
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)

View 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()

View File

@@ -0,0 +1 @@
flask

View File

@@ -1,4 +1,5 @@
import http.server
import json
import os
@@ -7,7 +8,12 @@ class GetHandler(http.server.BaseHTTPRequestHandler):
self.send_response(200)
self.send_header("Content-Type", "text/plain; charset=utf-8")
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__":

View File

@@ -1,6 +1,12 @@
#!/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
@@ -103,3 +109,23 @@ teardown() {
echo "status: $status"
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"'
}

View File

@@ -303,9 +303,14 @@ teardown() {
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "dokku docker-options:add $TEST_APP build \"--link postgres\""
echo "output: $output"
echo "status: $status"
assert_success
deploy_app dockerfile
run deploy_app dockerfile
echo "output: $output"
echo "status: $status"
assert_success
}

View File

@@ -385,7 +385,7 @@ teardown() {
echo "output: $output"
echo "status: $status"
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
echo "output: $output"
@@ -396,7 +396,7 @@ teardown() {
echo "output: $output"
echo "status: $status"
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
echo "output: $output"
@@ -407,7 +407,7 @@ teardown() {
echo "output: $output"
echo "status: $status"
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
echo "output: $output"

37
tests/unit/ps-cnb.bats Normal file
View 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"'
}

View File

@@ -9,7 +9,6 @@ setup() {
teardown() {
destroy_app
destroy_app 0 "$MYAPP" || true
global_teardown
}

View File

@@ -513,6 +513,13 @@ add_release_command() {
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() {
# simulate nginx post-deploy
dokku domains:setup "$TEST_APP"