@@ -1,3 +1,4 @@
|
|||||||
|
---
|
||||||
version: 2.1
|
version: 2.1
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
|
---
|
||||||
exclude_paths:
|
exclude_paths:
|
||||||
- vendor/**/*
|
- vendor/**/*
|
||||||
- tests/**/*
|
- tests/**/*
|
||||||
- "**_test.go"
|
- "**_test.go"
|
||||||
- contrib/*
|
- contrib/*
|
||||||
|
|||||||
10
.github/linters/.markdown-lint.yml
vendored
Normal file
10
.github/linters/.markdown-lint.yml
vendored
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
---
|
||||||
|
default: true
|
||||||
|
|
||||||
|
# Line length
|
||||||
|
# https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md#md013
|
||||||
|
MD013: false
|
||||||
|
|
||||||
|
# Inline HTML
|
||||||
|
# https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md#md033
|
||||||
|
MD033: false
|
||||||
5
.github/linters/.yamllint.yml
vendored
Normal file
5
.github/linters/.yamllint.yml
vendored
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
extends: default
|
||||||
|
|
||||||
|
rules:
|
||||||
|
line-length: disable
|
||||||
35
.github/workflows/bump-formula.yml
vendored
35
.github/workflows/bump-formula.yml
vendored
@@ -1,23 +1,26 @@
|
|||||||
|
---
|
||||||
name: bump-formula
|
name: bump-formula
|
||||||
|
|
||||||
|
# yamllint disable-line rule:truthy
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- '*'
|
- '*'
|
||||||
jobs:
|
jobs:
|
||||||
bump-formula:
|
bump-formula:
|
||||||
runs-on: macos-latest
|
runs-on: macos-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
- name: Get version
|
- name: Get version
|
||||||
id: get_version
|
id: get_version
|
||||||
run: echo ::set-output name=version::${GITHUB_REF/refs\/tags\//}
|
run: echo ::set-output name=version::${GITHUB_REF/refs\/tags\//}
|
||||||
- name: Bump Brew
|
- name: Bump Brew
|
||||||
env:
|
env:
|
||||||
HOMEBREW_GITHUB_USERNAME: ${{ secrets.HOMEBREW_GITHUB_USERNAME }}
|
HOMEBREW_GITHUB_USERNAME: ${{ secrets.HOMEBREW_GITHUB_USERNAME }}
|
||||||
HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }}
|
HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
git config --global user.name 'Dokku Bot'
|
git config --global user.name 'Dokku Bot'
|
||||||
git config --global user.email no-reply@dokku.com
|
git config --global user.email no-reply@dokku.com
|
||||||
brew tap dokku/repo "https://$HOMEBREW_GITHUB_USERNAME:$HOMEBREW_GITHUB_API_TOKEN@github.com/dokku/homebrew-repo.git"
|
brew tap dokku/repo "https://$HOMEBREW_GITHUB_USERNAME:$HOMEBREW_GITHUB_API_TOKEN@github.com/dokku/homebrew-repo.git"
|
||||||
brew bump-formula-pr -f --no-browse --no-audit --no-fork --url "https://github.com/dokku/dokku/archive/${{ steps.get_version.outputs.version }}.tar.gz" dokku/repo/dokku
|
brew bump-formula-pr -f --no-browse --no-audit --no-fork --url "https://github.com/dokku/dokku/archive/${{ steps.get_version.outputs.version }}.tar.gz" dokku/repo/dokku
|
||||||
|
|||||||
164
.github/workflows/ci.yml
vendored
164
.github/workflows/ci.yml
vendored
@@ -1,5 +1,7 @@
|
|||||||
|
---
|
||||||
name: CI
|
name: CI
|
||||||
|
|
||||||
|
# yamllint disable-line rule:truthy
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
@@ -18,23 +20,23 @@ jobs:
|
|||||||
fail-fast: true
|
fail-fast: true
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: build package
|
- name: build package
|
||||||
run: ./tests/ci/setup.sh build
|
run: ./tests/ci/setup.sh build
|
||||||
|
|
||||||
- name: set matrix for build
|
- name: set matrix for build
|
||||||
id: set-matrix
|
id: set-matrix
|
||||||
run: |
|
run: |
|
||||||
json=$(python .github/commands/matrix)
|
json=$(python .github/commands/matrix)
|
||||||
echo $json
|
echo $json
|
||||||
echo "::set-output name=matrix::$(echo "$json")"
|
echo "::set-output name=matrix::$(echo "$json")"
|
||||||
|
|
||||||
- name: upload packages
|
- name: upload packages
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: build
|
name: build
|
||||||
path: build
|
path: build
|
||||||
|
|
||||||
unit-tests:
|
unit-tests:
|
||||||
name: unit.${{ matrix.index }}
|
name: unit.${{ matrix.index }}
|
||||||
@@ -45,30 +47,30 @@ jobs:
|
|||||||
matrix: ${{fromJson(needs.build.outputs.matrix)}}
|
matrix: ${{fromJson(needs.build.outputs.matrix)}}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: download packages
|
- name: download packages
|
||||||
uses: actions/download-artifact@v1
|
uses: actions/download-artifact@v1
|
||||||
with:
|
with:
|
||||||
name: build
|
name: build
|
||||||
|
|
||||||
- name: ci-setup
|
- name: ci-setup
|
||||||
run: ./.github/commands/ci-setup
|
run: ./.github/commands/ci-setup
|
||||||
|
|
||||||
# - name: start ssh session
|
# - name: start ssh session
|
||||||
# uses: luchihoratiu/debug-via-ssh@main
|
# uses: luchihoratiu/debug-via-ssh@main
|
||||||
# with:
|
# with:
|
||||||
# NGROK_AUTH_TOKEN: ${{ secrets.NGROK_AUTH_TOKEN }}
|
# NGROK_AUTH_TOKEN: ${{ secrets.NGROK_AUTH_TOKEN }}
|
||||||
# SSH_PASS: ${{ secrets.SSH_PASS }}
|
# SSH_PASS: ${{ secrets.SSH_PASS }}
|
||||||
|
|
||||||
- name: run ci
|
- name: run ci
|
||||||
timeout-minutes: 30
|
timeout-minutes: 30
|
||||||
run: sudo -E ./.github/commands/ci-run ${{ matrix.index }}
|
run: sudo -E ./.github/commands/ci-run ${{ matrix.index }}
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v2
|
- uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: test-results-${{ matrix.index }}
|
name: test-results-${{ matrix.index }}
|
||||||
path: test-results
|
path: test-results
|
||||||
|
|
||||||
docker-deploy-tests:
|
docker-deploy-tests:
|
||||||
name: docker
|
name: docker
|
||||||
@@ -78,22 +80,22 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: download packages
|
- name: download packages
|
||||||
uses: actions/download-artifact@v1
|
uses: actions/download-artifact@v1
|
||||||
with:
|
with:
|
||||||
name: build
|
name: build
|
||||||
|
|
||||||
- name: ci-setup
|
- name: ci-setup
|
||||||
run: ./.github/commands/ci-setup
|
run: ./.github/commands/ci-setup
|
||||||
|
|
||||||
- name: test docker deploys
|
- name: test docker deploys
|
||||||
shell: bash
|
shell: bash
|
||||||
timeout-minutes: 20
|
timeout-minutes: 20
|
||||||
run: |
|
run: |
|
||||||
./tests/ci/setup.sh docker
|
./tests/ci/setup.sh docker
|
||||||
DOKKU_SSH_PORT=3022 sudo -E make -e test-ci-docker
|
DOKKU_SSH_PORT=3022 sudo -E make -e test-ci-docker
|
||||||
|
|
||||||
go-tests:
|
go-tests:
|
||||||
name: go.${{ matrix.index }}
|
name: go.${{ matrix.index }}
|
||||||
@@ -107,33 +109,33 @@ jobs:
|
|||||||
GITHUB_NODE_INDEX: ${{ matrix.index }}
|
GITHUB_NODE_INDEX: ${{ matrix.index }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: download packages
|
- name: download packages
|
||||||
uses: actions/download-artifact@v1
|
uses: actions/download-artifact@v1
|
||||||
with:
|
with:
|
||||||
name: build
|
name: build
|
||||||
|
|
||||||
- name: ci-setup
|
- name: ci-setup
|
||||||
run: ./.github/commands/ci-setup
|
run: ./.github/commands/ci-setup
|
||||||
|
|
||||||
- name: run go tests
|
- name: run go tests
|
||||||
run: |
|
run: |
|
||||||
export CIRCLE_SHA1=$GITHUB_SHA
|
export CIRCLE_SHA1=$GITHUB_SHA
|
||||||
echo "CODACY_TOKEN=$CODACY_TOKEN"
|
echo "CODACY_TOKEN=$CODACY_TOKEN"
|
||||||
if [ "$CODACY_TOKEN" != "" ]; then
|
if [ "$CODACY_TOKEN" != "" ]; then
|
||||||
echo "Detected value for CODACY_TOKEN"
|
echo "Detected value for CODACY_TOKEN"
|
||||||
fi
|
fi
|
||||||
case $GITHUB_NODE_INDEX in
|
case $GITHUB_NODE_INDEX in
|
||||||
0) sudo -E make -e lint-ci go-tests ci-go-coverage ;;
|
0) sudo -E make -e lint-ci go-tests ci-go-coverage ;;
|
||||||
1) sudo -E make -e deploy-test-checks-root deploy-test-config ;;
|
1) sudo -E make -e deploy-test-checks-root deploy-test-config ;;
|
||||||
2) sudo -E make -e deploy-test-multi ;;
|
2) sudo -E make -e deploy-test-multi ;;
|
||||||
3) sudo -E make -e deploy-test-go-fail-predeploy deploy-test-go-fail-postdeploy ;;
|
3) sudo -E make -e deploy-test-go-fail-predeploy deploy-test-go-fail-postdeploy ;;
|
||||||
esac
|
esac
|
||||||
- uses: actions/upload-artifact@v2
|
- uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: coverage.${{ matrix.index }}
|
name: coverage.${{ matrix.index }}
|
||||||
path: test-results/coverage
|
path: test-results/coverage
|
||||||
|
|
||||||
publish-test-results:
|
publish-test-results:
|
||||||
name: publish-test-results
|
name: publish-test-results
|
||||||
@@ -143,15 +145,15 @@ jobs:
|
|||||||
if: success() || failure()
|
if: success() || failure()
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: download test-results
|
- name: download test-results
|
||||||
uses: actions/download-artifact@v2
|
uses: actions/download-artifact@v2
|
||||||
with:
|
with:
|
||||||
path: test-results
|
path: test-results
|
||||||
|
|
||||||
- name: Publish Unit Test Results
|
- name: Publish Unit Test Results
|
||||||
uses: docker://ghcr.io/enricomi/publish-unit-test-result-action:v1.6
|
uses: docker://ghcr.io/enricomi/publish-unit-test-result-action:v1.6
|
||||||
with:
|
with:
|
||||||
check_name: Unit Test Results
|
check_name: Unit Test Results
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
files: test-results/**/*.xml
|
files: test-results/**/*.xml
|
||||||
comment_on_pr: false
|
comment_on_pr: false
|
||||||
|
|||||||
58
.github/workflows/codeql-analysis.yml
vendored
58
.github/workflows/codeql-analysis.yml
vendored
@@ -1,3 +1,4 @@
|
|||||||
|
---
|
||||||
# For most projects, this workflow file will not need changing; you simply need
|
# For most projects, this workflow file will not need changing; you simply need
|
||||||
# to commit it to your repository.
|
# to commit it to your repository.
|
||||||
#
|
#
|
||||||
@@ -12,12 +13,13 @@
|
|||||||
|
|
||||||
name: "CodeQL"
|
name: "CodeQL"
|
||||||
|
|
||||||
|
# yamllint disable-line rule:truthy
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ master ]
|
branches: [master]
|
||||||
pull_request:
|
pull_request:
|
||||||
# The branches below must be a subset of the branches above
|
# The branches below must be a subset of the branches above
|
||||||
branches: [ master ]
|
branches: [master]
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '18 22 * * 2'
|
- cron: '18 22 * * 2'
|
||||||
|
|
||||||
@@ -29,40 +31,40 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
language: [ 'go' ]
|
language: ['go']
|
||||||
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
|
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
|
||||||
# Learn more:
|
# Learn more:
|
||||||
# https://docs.github.com/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
|
# https://docs.github.com/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
# Initializes the CodeQL tools for scanning.
|
# Initializes the CodeQL tools for scanning.
|
||||||
- name: Initialize CodeQL
|
- name: Initialize CodeQL
|
||||||
uses: github/codeql-action/init@v1
|
uses: github/codeql-action/init@v1
|
||||||
with:
|
with:
|
||||||
languages: ${{ matrix.language }}
|
languages: ${{ matrix.language }}
|
||||||
# If you wish to specify custom queries, you can do so here or in a config file.
|
# If you wish to specify custom queries, you can do so here or in a config file.
|
||||||
# By default, queries listed here will override any specified in a config file.
|
# By default, queries listed here will override any specified in a config file.
|
||||||
# Prefix the list here with "+" to use these queries and those in the config file.
|
# Prefix the list here with "+" to use these queries and those in the config file.
|
||||||
# queries: ./path/to/local/query, your-org/your-repo/queries@main
|
# queries: ./path/to/local/query, your-org/your-repo/queries@main
|
||||||
|
|
||||||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
||||||
# If this step fails, then you should remove it and run the build manually (see below)
|
# If this step fails, then you should remove it and run the build manually (see below)
|
||||||
- name: Autobuild
|
- name: Autobuild
|
||||||
uses: github/codeql-action/autobuild@v1
|
uses: github/codeql-action/autobuild@v1
|
||||||
|
|
||||||
# ℹ️ Command-line programs to run using the OS shell.
|
# ℹ️ Command-line programs to run using the OS shell.
|
||||||
# 📚 https://git.io/JvXDl
|
# 📚 https://git.io/JvXDl
|
||||||
|
|
||||||
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
|
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
|
||||||
# and modify them (or add more) to build your code if your project
|
# and modify them (or add more) to build your code if your project
|
||||||
# uses a compiled language
|
# uses a compiled language
|
||||||
|
|
||||||
#- run: |
|
# - run: |
|
||||||
# make bootstrap
|
# make bootstrap
|
||||||
# make release
|
# make release
|
||||||
|
|
||||||
- name: Perform CodeQL Analysis
|
- name: Perform CodeQL Analysis
|
||||||
uses: github/codeql-action/analyze@v1
|
uses: github/codeql-action/analyze@v1
|
||||||
|
|||||||
74
.github/workflows/lint.yml
vendored
Normal file
74
.github/workflows/lint.yml
vendored
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
---
|
||||||
|
name: 'lint'
|
||||||
|
|
||||||
|
# yamllint disable-line rule:truthy
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- '*'
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- 'master'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
hadolint:
|
||||||
|
name: hadolint
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
steps:
|
||||||
|
- name: Clone
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Run hadolint
|
||||||
|
uses: brpaz/hadolint-action@1623ba61710b974b55ba455930e6f2c8ef919778
|
||||||
|
# v1.3.1 => 1623ba61710b974b55ba455930e6f2c8ef919778
|
||||||
|
|
||||||
|
markdown-lint:
|
||||||
|
name: markdown-lint
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
steps:
|
||||||
|
- name: Clone
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Run markdown-lint
|
||||||
|
uses: avto-dev/markdown-lint@04d43ee9191307b50935a753da3b775ab695eceb
|
||||||
|
# v1.5.0 => 04d43ee9191307b50935a753da3b775ab695eceb
|
||||||
|
with:
|
||||||
|
config: '.github/linters/.markdown-lint.yml'
|
||||||
|
args: './README.md'
|
||||||
|
|
||||||
|
shellcheck:
|
||||||
|
name: shellcheck
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
steps:
|
||||||
|
- name: Clone
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Run shellcheck
|
||||||
|
uses: ludeeus/action-shellcheck@d586102c117f97e63d7e3b56629d269efc9a7c60
|
||||||
|
# 1.0.0 => d586102c117f97e63d7e3b56629d269efc9a7c60
|
||||||
|
env:
|
||||||
|
# keep in sync with tests/shellcheck-exclude
|
||||||
|
SHELLCHECK_OPTS: -e SC1001 -e SC1003 -e SC1090 -e SC1091 -e SC1117 -e SC2029 -e SC2034 -e SC2046 -e SC2064 -e SC2068 -e SC2086 -e SC2119 -e SC2120 -e SC2128 -e SC2148 -e SC2153 -e SC2154 -e SC2155 -e SC2162 -e SC2174 -e SC2179 -e SC2191 -e SC2199 -e SC2207 -e SC2219 -e SC2220 -e SC2230 -e SC2231 -e SC2235
|
||||||
|
|
||||||
|
shfmt:
|
||||||
|
name: shfmt
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
steps:
|
||||||
|
- name: Clone
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Run shfmt
|
||||||
|
uses: luizm/action-sh-checker@442951059cb22d260c6e69309ae59cb7bb2334b8
|
||||||
|
# v0.1.12 => 442951059cb22d260c6e69309ae59cb7bb2334b8
|
||||||
|
env:
|
||||||
|
SHFMT_OPTS: -l -bn -ci -i 2 -d
|
||||||
|
with:
|
||||||
|
sh_checker_shellcheck_disable: true
|
||||||
|
|
||||||
|
yamllint:
|
||||||
|
name: yamllint
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
steps:
|
||||||
|
- name: Clone
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Run yamllint
|
||||||
|
uses: ibiqlik/action-yamllint@b2aeacc1b7eeb8c23e84bba320d04fb5d6a323ee
|
||||||
|
# v3.0.0 => b2aeacc1b7eeb8c23e84bba320d04fb5d6a323ee
|
||||||
|
with:
|
||||||
|
config_file: '.github/linters/.yamllint.yml'
|
||||||
@@ -15,6 +15,9 @@ RUN addgroup --gid $DOKKU_GID dokku \
|
|||||||
|
|
||||||
COPY ./tests/dhparam.pem /tmp/dhparam.pem
|
COPY ./tests/dhparam.pem /tmp/dhparam.pem
|
||||||
COPY ./build/dokku.deb /tmp/dokku.deb
|
COPY ./build/dokku.deb /tmp/dokku.deb
|
||||||
|
|
||||||
|
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
||||||
|
# hadolint ignore=DL3005,DL3008
|
||||||
RUN echo "dokku dokku/hostname string $DOKKU_HOSTNAME" | debconf-set-selections \
|
RUN echo "dokku dokku/hostname string $DOKKU_HOSTNAME" | debconf-set-selections \
|
||||||
&& echo "dokku dokku/skip_key_file boolean $DOKKU_SKIP_KEY_FILE" | debconf-set-selections \
|
&& echo "dokku dokku/skip_key_file boolean $DOKKU_SKIP_KEY_FILE" | debconf-set-selections \
|
||||||
&& echo "dokku dokku/vhost_enable boolean $DOKKU_VHOST_ENABLE" | debconf-set-selections \
|
&& echo "dokku dokku/vhost_enable boolean $DOKKU_VHOST_ENABLE" | debconf-set-selections \
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
# Dokku
|
# Dokku
|
||||||
|
|
||||||
[](https://github.com/dokku/dokku/actions?query=workflow%3ACI)
|
[](https://github.com/dokku/dokku/actions?query=workflow%3ACI)
|
||||||
[](https://packagecloud.io/dokku/dokku)
|
[](https://packagecloud.io/dokku/dokku)
|
||||||
[](https://aur.archlinux.org/packages/dokku/)
|
[](https://aur.archlinux.org/packages/dokku/)
|
||||||
@@ -46,7 +47,6 @@ Become a sponsor and get your logo on our README on Github with a link to your s
|
|||||||
<a href="https://opencollective.com/dokku/sponsor/28/website" target="_blank"><img src="https://opencollective.com/dokku/sponsor/28/avatar.svg"></a>
|
<a href="https://opencollective.com/dokku/sponsor/28/website" target="_blank"><img src="https://opencollective.com/dokku/sponsor/28/avatar.svg"></a>
|
||||||
<a href="https://opencollective.com/dokku/sponsor/29/website" target="_blank"><img src="https://opencollective.com/dokku/sponsor/29/avatar.svg"></a>
|
<a href="https://opencollective.com/dokku/sponsor/29/website" target="_blank"><img src="https://opencollective.com/dokku/sponsor/29/avatar.svg"></a>
|
||||||
|
|
||||||
|
|
||||||
## Backers
|
## Backers
|
||||||
|
|
||||||
Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/dokku#backer)]
|
Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/dokku#backer)]
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ cmd-events-help() {
|
|||||||
local plugin_name="events"
|
local plugin_name="events"
|
||||||
local plugin_description="Manage event logging"
|
local plugin_description="Manage event logging"
|
||||||
|
|
||||||
if [[ "$CMD" == "$plugin_name:help" ]]; then
|
if [[ "$CMD" == "${plugin_name}:help" ]]; then
|
||||||
echo -e "Usage: dokku $plugin_name[:COMMAND]"
|
echo -e "Usage: dokku ${plugin_name}[:COMMAND]"
|
||||||
echo ''
|
echo ''
|
||||||
echo "$plugin_description"
|
echo "$plugin_description"
|
||||||
echo ''
|
echo ''
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ trigger-builder-cnb-builder-build() {
|
|||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
local stack="$(plugn trigger buildpack-stack-name "$APP")"
|
local stack="$(plugn trigger buildpack-stack-name "$APP")"
|
||||||
if [[ -z "$stack" ]]; then
|
if [[ -z "$stack" ]]; then
|
||||||
DOKKU_CNB_STACK="$stack"
|
DOKKU_CNB_STACK="$stack"
|
||||||
@@ -32,7 +31,7 @@ trigger-builder-cnb-builder-build() {
|
|||||||
local TMP_FILE=$(mktemp "/tmp/dokku-${DOKKU_PID}-${FUNCNAME[0]}.XXXXXX")
|
local TMP_FILE=$(mktemp "/tmp/dokku-${DOKKU_PID}-${FUNCNAME[0]}.XXXXXX")
|
||||||
trap "rm -rf '$TMP_FILE' >/dev/null" RETURN INT TERM
|
trap "rm -rf '$TMP_FILE' >/dev/null" RETURN INT TERM
|
||||||
|
|
||||||
config_export app "$APP" --format envfile --merged > "$TMP_FILE"
|
config_export app "$APP" --format envfile --merged >"$TMP_FILE"
|
||||||
|
|
||||||
plugn trigger pre-build-cnb "$APP" "$SOURCECODE_WORK_DIR"
|
plugn trigger pre-build-cnb "$APP" "$SOURCECODE_WORK_DIR"
|
||||||
|
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ cmd-certs-help() {
|
|||||||
local plugin_name="certs"
|
local plugin_name="certs"
|
||||||
local plugin_description="Manage SSL (TLS) certs"
|
local plugin_description="Manage SSL (TLS) certs"
|
||||||
|
|
||||||
if [[ "$CMD" == "$plugin_name:help" ]]; then
|
if [[ "$CMD" == "${plugin_name}:help" ]]; then
|
||||||
echo -e "Usage: dokku $plugin_name[:COMMAND]"
|
echo -e "Usage: dokku ${plugin_name}[:COMMAND]"
|
||||||
echo ''
|
echo ''
|
||||||
echo "$plugin_description"
|
echo "$plugin_description"
|
||||||
echo ''
|
echo ''
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ cmd-checks-help() {
|
|||||||
local plugin_name="checks"
|
local plugin_name="checks"
|
||||||
local plugin_description="Manage zero-downtime settings"
|
local plugin_description="Manage zero-downtime settings"
|
||||||
|
|
||||||
if [[ "$CMD" == "$plugin_name:help" ]]; then
|
if [[ "$CMD" == "${plugin_name}:help" ]]; then
|
||||||
echo -e "Usage: dokku $plugin_name[:COMMAND]"
|
echo -e "Usage: dokku ${plugin_name}[:COMMAND]"
|
||||||
echo ''
|
echo ''
|
||||||
echo "$plugin_description"
|
echo "$plugin_description"
|
||||||
echo ''
|
echo ''
|
||||||
|
|||||||
@@ -148,14 +148,14 @@ dokku_log_exit() {
|
|||||||
dokku_log_fail_quiet() {
|
dokku_log_fail_quiet() {
|
||||||
declare desc="log fail formatter"
|
declare desc="log fail formatter"
|
||||||
if [[ -z "$DOKKU_QUIET_OUTPUT" ]]; then
|
if [[ -z "$DOKKU_QUIET_OUTPUT" ]]; then
|
||||||
echo " ! $@" 1>&2
|
echo " ! $*" 1>&2
|
||||||
fi
|
fi
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
dokku_log_fail() {
|
dokku_log_fail() {
|
||||||
declare desc="log fail formatter"
|
declare desc="log fail formatter"
|
||||||
echo " ! $@" 1>&2
|
echo " ! $*" 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -917,7 +917,7 @@ get_app_urls() {
|
|||||||
if [[ -n "$urls" ]]; then
|
if [[ -n "$urls" ]]; then
|
||||||
echo "$urls" | sort
|
echo "$urls" | sort
|
||||||
else
|
else
|
||||||
internal_get_app_urls "$URL_TYPE" "$APP"
|
internal_get_app_urls "$URL_TYPE" "$APP" | sort
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ get_phase_file_path() {
|
|||||||
get_phases() {
|
get_phases() {
|
||||||
declare desc="returns array of passed passes if all are in allowed array"
|
declare desc="returns array of passed passes if all are in allowed array"
|
||||||
local passed_phases_list="$1"
|
local passed_phases_list="$1"
|
||||||
|
# shellcheck disable=SC2001
|
||||||
local -r phases_allowed=$(sed -e 's/ /\|/g' <<<"${AVAILABLE_PHASES[@]}")
|
local -r phases_allowed=$(sed -e 's/ /\|/g' <<<"${AVAILABLE_PHASES[@]}")
|
||||||
local phase
|
local phase
|
||||||
local passed_phases
|
local passed_phases
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ cmd-docker-options-help() {
|
|||||||
local plugin_name="docker-options"
|
local plugin_name="docker-options"
|
||||||
local plugin_description="Manage docker options for an app"
|
local plugin_description="Manage docker options for an app"
|
||||||
|
|
||||||
if [[ "$CMD" == "$plugin_name:help" ]]; then
|
if [[ "$CMD" == "${plugin_name}:help" ]]; then
|
||||||
echo -e "Usage: dokku $plugin_name[:COMMAND]"
|
echo -e "Usage: dokku ${plugin_name}[:COMMAND]"
|
||||||
echo ''
|
echo ''
|
||||||
echo "$plugin_description"
|
echo "$plugin_description"
|
||||||
echo ''
|
echo ''
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ domains_add() {
|
|||||||
done
|
done
|
||||||
|
|
||||||
for DOMAIN in "$@"; do
|
for DOMAIN in "$@"; do
|
||||||
if grep -x --line-regexp --fixed-strings "$DOMAIN" "$APP_VHOST_PATH" 2> /dev/null; then
|
if grep -x --line-regexp --fixed-strings "$DOMAIN" "$APP_VHOST_PATH" 2>/dev/null; then
|
||||||
dokku_log_info1 "Skipping: $DOMAIN already added to $APP"
|
dokku_log_info1 "Skipping: $DOMAIN already added to $APP"
|
||||||
else
|
else
|
||||||
echo "$DOMAIN" >>"$APP_VHOST_PATH"
|
echo "$DOMAIN" >>"$APP_VHOST_PATH"
|
||||||
@@ -149,7 +149,7 @@ domains_add_global() {
|
|||||||
done
|
done
|
||||||
|
|
||||||
for DOMAIN in "$@"; do
|
for DOMAIN in "$@"; do
|
||||||
if grep -q --line-regexp --fixed-strings "$DOMAIN" "$GLOBAL_VHOST_PATH" 2> /dev/null; then
|
if grep -q --line-regexp --fixed-strings "$DOMAIN" "$GLOBAL_VHOST_PATH" 2>/dev/null; then
|
||||||
dokku_log_info1 "Skipping $DOMAIN: already added"
|
dokku_log_info1 "Skipping $DOMAIN: already added"
|
||||||
else
|
else
|
||||||
echo "$DOMAIN" >>"$GLOBAL_VHOST_PATH"
|
echo "$DOMAIN" >>"$GLOBAL_VHOST_PATH"
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ cmd-domains-help() {
|
|||||||
local plugin_name="domains"
|
local plugin_name="domains"
|
||||||
local plugin_description="Manage domains used by the proxy"
|
local plugin_description="Manage domains used by the proxy"
|
||||||
|
|
||||||
if [[ "$CMD" == "$plugin_name:help" ]]; then
|
if [[ "$CMD" == "${plugin_name}:help" ]]; then
|
||||||
echo -e "Usage: dokku $plugin_name[:COMMAND]"
|
echo -e "Usage: dokku ${plugin_name}[:COMMAND]"
|
||||||
echo ''
|
echo ''
|
||||||
echo "$plugin_description"
|
echo "$plugin_description"
|
||||||
echo ''
|
echo ''
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ cmd-enter-help() {
|
|||||||
local plugin_name="enter"
|
local plugin_name="enter"
|
||||||
local plugin_description="Enter running app containers"
|
local plugin_description="Enter running app containers"
|
||||||
|
|
||||||
if [[ "$CMD" == "$plugin_name:help" ]]; then
|
if [[ "$CMD" == "${plugin_name}:help" ]]; then
|
||||||
echo -e "Usage: dokku $plugin_name[:COMMAND]"
|
echo -e "Usage: dokku ${plugin_name}[:COMMAND]"
|
||||||
echo ''
|
echo ''
|
||||||
echo "$plugin_description"
|
echo "$plugin_description"
|
||||||
echo ''
|
echo ''
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ cmd-git-help() {
|
|||||||
local plugin_name="git"
|
local plugin_name="git"
|
||||||
local plugin_description="Manage app deploys via git"
|
local plugin_description="Manage app deploys via git"
|
||||||
|
|
||||||
if [[ "$CMD" == "$plugin_name:help" ]]; then
|
if [[ "$CMD" == "${plugin_name}:help" ]]; then
|
||||||
echo -e "Usage: dokku $plugin_name[:COMMAND]"
|
echo -e "Usage: dokku ${plugin_name}[:COMMAND]"
|
||||||
echo ''
|
echo ''
|
||||||
echo "$plugin_description"
|
echo "$plugin_description"
|
||||||
echo ''
|
echo ''
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ cmd-git-allow-host() {
|
|||||||
declare HOST="$1"
|
declare HOST="$1"
|
||||||
[[ -z "$HOST" ]] && dokku_log_fail "Please supply a git host"
|
[[ -z "$HOST" ]] && dokku_log_fail "Please supply a git host"
|
||||||
|
|
||||||
ssh-keyscan -t rsa "$HOST" >> "$DOKKU_ROOT/.ssh/known_hosts"
|
ssh-keyscan -t rsa "$HOST" >>"$DOKKU_ROOT/.ssh/known_hosts"
|
||||||
dokku_log_info1 "$HOST added to known hosts"
|
dokku_log_info1 "$HOST added to known hosts"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -215,19 +215,19 @@ fn-git-fetch() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
DOKKU_DEPLOY_BRANCH="$(fn-git-deploy-branch "$APP")"
|
DOKKU_DEPLOY_BRANCH="$(fn-git-deploy-branch "$APP")"
|
||||||
if ! git -C "$APP_ROOT" check-ref-format --branch "$DOKKU_DEPLOY_BRANCH" >/dev/null 2>&1; then
|
if ! git -C "$APP_ROOT" check-ref-format --branch "$DOKKU_DEPLOY_BRANCH" >/dev/null 2>&1; then
|
||||||
echo $'\e[1G\e[K'"-----> WARNING: Invalid branch name '$DOKKU_DEPLOY_BRANCH' specified via DOKKU_DEPLOY_BRANCH."
|
echo $'\e[1G\e[K'"-----> WARNING: Invalid branch name '$DOKKU_DEPLOY_BRANCH' specified via DOKKU_DEPLOY_BRANCH."
|
||||||
echo $'\e[1G\e[K'"-----> For more details, please see the man page for 'git-check-ref-format.'"
|
echo $'\e[1G\e[K'"-----> For more details, please see the man page for 'git-check-ref-format.'"
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
git -C "$APP_ROOT" remote rm remote > /dev/null 2>&1 || true
|
git -C "$APP_ROOT" remote rm remote >/dev/null 2>&1 || true
|
||||||
git -C "$APP_ROOT" remote add --mirror=fetch --no-tags remote "$GIT_REMOTE"
|
git -C "$APP_ROOT" remote add --mirror=fetch --no-tags remote "$GIT_REMOTE"
|
||||||
if [[ -z "$GIT_REF" ]]; then
|
if [[ -z "$GIT_REF" ]]; then
|
||||||
git -C "$APP_ROOT" fetch --update-head-ok remote "$DOKKU_DEPLOY_BRANCH"
|
git -C "$APP_ROOT" fetch --update-head-ok remote "$DOKKU_DEPLOY_BRANCH"
|
||||||
else
|
else
|
||||||
git -C "$APP_ROOT" fetch --update-head-ok remote
|
git -C "$APP_ROOT" fetch --update-head-ok remote
|
||||||
git -C "$APP_ROOT" update-ref "refs/heads/$DOKKU_DEPLOY_BRANCH" "$GIT_REF"
|
git -C "$APP_ROOT" update-ref "refs/heads/$DOKKU_DEPLOY_BRANCH" "$GIT_REF"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ cmd-nginx-vhosts-help() {
|
|||||||
local plugin_name="nginx"
|
local plugin_name="nginx"
|
||||||
local plugin_description="Manage the nginx proxy"
|
local plugin_description="Manage the nginx proxy"
|
||||||
|
|
||||||
if [[ "$CMD" == "$plugin_name:help" ]]; then
|
if [[ "$CMD" == "${plugin_name}:help" ]]; then
|
||||||
echo -e "Usage: dokku $plugin_name[:COMMAND]"
|
echo -e "Usage: dokku ${plugin_name}[:COMMAND]"
|
||||||
echo ''
|
echo ''
|
||||||
echo "$plugin_description"
|
echo "$plugin_description"
|
||||||
echo ''
|
echo ''
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ cmd-plugin-help() {
|
|||||||
local plugin_name="plugin"
|
local plugin_name="plugin"
|
||||||
local plugin_description="Manage installed plugins"
|
local plugin_description="Manage installed plugins"
|
||||||
|
|
||||||
if [[ "$CMD" == "$plugin_name:help" ]]; then
|
if [[ "$CMD" == "${plugin_name}:help" ]]; then
|
||||||
echo -e "Usage: dokku $plugin_name[:COMMAND]"
|
echo -e "Usage: dokku ${plugin_name}[:COMMAND]"
|
||||||
echo ''
|
echo ''
|
||||||
echo "$plugin_description"
|
echo "$plugin_description"
|
||||||
echo ''
|
echo ''
|
||||||
|
|||||||
@@ -209,6 +209,7 @@ trigger-scheduler-docker-local-check-deploy() {
|
|||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
if OUTPUT=$(curl -# $CURL_ARGS 2>&1); then
|
if OUTPUT=$(curl -# $CURL_ARGS 2>&1); then
|
||||||
# OUTPUT contains the HTTP response
|
# OUTPUT contains the HTTP response
|
||||||
|
# shellcheck disable=SC2076
|
||||||
if [[ "$OUTPUT" =~ "$EXPECTED" ]]; then
|
if [[ "$OUTPUT" =~ "$EXPECTED" ]]; then
|
||||||
SUCCESS=1
|
SUCCESS=1
|
||||||
break
|
break
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ cmd-scheduler-docker-local-help() {
|
|||||||
local plugin_name="scheduler-docker-local"
|
local plugin_name="scheduler-docker-local"
|
||||||
local plugin_description="Manage the docker-local scheduler integration for an app"
|
local plugin_description="Manage the docker-local scheduler integration for an app"
|
||||||
|
|
||||||
if [[ "$CMD" == "$plugin_name:help" ]]; then
|
if [[ "$CMD" == "${plugin_name}:help" ]]; then
|
||||||
echo -e "Usage: dokku $plugin_name[:COMMAND]"
|
echo -e "Usage: dokku ${plugin_name}[:COMMAND]"
|
||||||
echo ''
|
echo ''
|
||||||
echo "$plugin_description"
|
echo "$plugin_description"
|
||||||
echo ''
|
echo ''
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ scheduler-docker-local-pre-deploy-chown-app() {
|
|||||||
CONTAINER_PATHS=$(echo "$APP_PATHS" | awk -F ':' '{ print $2 }' | xargs)
|
CONTAINER_PATHS=$(echo "$APP_PATHS" | awk -F ':' '{ print $2 }' | xargs)
|
||||||
DOCKER_ARGS=$(: | plugn trigger docker-args-deploy "$APP" "$IMAGE_TAG")
|
DOCKER_ARGS=$(: | plugn trigger docker-args-deploy "$APP" "$IMAGE_TAG")
|
||||||
# strip --restart args from DOCKER_ARGS
|
# strip --restart args from DOCKER_ARGS
|
||||||
|
# shellcheck disable=SC2001
|
||||||
DOCKER_ARGS=$(sed -e "s/--restart=[[:graph:]]\+[[:blank:]]\?//g" <<<"$DOCKER_ARGS")
|
DOCKER_ARGS=$(sed -e "s/--restart=[[:graph:]]\+[[:blank:]]\?//g" <<<"$DOCKER_ARGS")
|
||||||
eval "ARG_ARRAY=($DOCKER_ARGS)"
|
eval "ARG_ARRAY=($DOCKER_ARGS)"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ cmd-shell-help() {
|
|||||||
local plugin_name="shell"
|
local plugin_name="shell"
|
||||||
local plugin_description="Interactive dokku prompt"
|
local plugin_description="Interactive dokku prompt"
|
||||||
|
|
||||||
if [[ "$CMD" == "$plugin_name:help" ]]; then
|
if [[ "$CMD" == "${plugin_name}:help" ]]; then
|
||||||
echo -e "Usage: dokku $plugin_name[:COMMAND]"
|
echo -e "Usage: dokku ${plugin_name}[:COMMAND]"
|
||||||
echo ''
|
echo ''
|
||||||
echo "$plugin_description"
|
echo "$plugin_description"
|
||||||
echo ''
|
echo ''
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ cmd-ssh-keys-help() {
|
|||||||
local plugin_name="ssh-keys"
|
local plugin_name="ssh-keys"
|
||||||
local plugin_description="Manage public ssh keys used for deployment"
|
local plugin_description="Manage public ssh keys used for deployment"
|
||||||
|
|
||||||
if [[ "$CMD" == "$plugin_name:help" ]]; then
|
if [[ "$CMD" == "${plugin_name}:help" ]]; then
|
||||||
echo -e "Usage: dokku $plugin_name[:COMMAND]"
|
echo -e "Usage: dokku ${plugin_name}[:COMMAND]"
|
||||||
echo ''
|
echo ''
|
||||||
echo "$plugin_description"
|
echo "$plugin_description"
|
||||||
echo ''
|
echo ''
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ cmd-storage-help() {
|
|||||||
local plugin_name="storage"
|
local plugin_name="storage"
|
||||||
local plugin_description="Manage mounted volumes"
|
local plugin_description="Manage mounted volumes"
|
||||||
|
|
||||||
if [[ "$CMD" == "$plugin_name:help" ]]; then
|
if [[ "$CMD" == "${plugin_name}:help" ]]; then
|
||||||
echo -e "Usage: dokku $plugin_name[:COMMAND]"
|
echo -e "Usage: dokku ${plugin_name}[:COMMAND]"
|
||||||
echo ''
|
echo ''
|
||||||
echo "$plugin_description"
|
echo "$plugin_description"
|
||||||
echo ''
|
echo ''
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ cmd-tags-help() {
|
|||||||
local plugin_name="tags"
|
local plugin_name="tags"
|
||||||
local plugin_description="Manage docker image tags"
|
local plugin_description="Manage docker image tags"
|
||||||
|
|
||||||
if [[ "$CMD" == "$plugin_name:help" ]]; then
|
if [[ "$CMD" == "${plugin_name}:help" ]]; then
|
||||||
echo -e "Usage: dokku $plugin_name[:COMMAND]"
|
echo -e "Usage: dokku ${plugin_name}[:COMMAND]"
|
||||||
echo ''
|
echo ''
|
||||||
echo "$plugin_description"
|
echo "$plugin_description"
|
||||||
echo ''
|
echo ''
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ cmd-tar-help() {
|
|||||||
local plugin_name="tar"
|
local plugin_name="tar"
|
||||||
local plugin_description="Manage app deploys via tar"
|
local plugin_description="Manage app deploys via tar"
|
||||||
|
|
||||||
if [[ "$CMD" == "$plugin_name:help" ]]; then
|
if [[ "$CMD" == "${plugin_name}:help" ]]; then
|
||||||
echo -e "Usage: dokku $plugin_name[:COMMAND]"
|
echo -e "Usage: dokku ${plugin_name}[:COMMAND]"
|
||||||
echo ''
|
echo ''
|
||||||
echo "$plugin_description"
|
echo "$plugin_description"
|
||||||
echo ''
|
echo ''
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ cmd-trace-help() {
|
|||||||
local plugin_name="trace"
|
local plugin_name="trace"
|
||||||
local plugin_description="Manage trace mode"
|
local plugin_description="Manage trace mode"
|
||||||
|
|
||||||
if [[ "$CMD" == "$plugin_name:help" ]]; then
|
if [[ "$CMD" == "${plugin_name}:help" ]]; then
|
||||||
echo -e "Usage: dokku $plugin_name[:COMMAND]"
|
echo -e "Usage: dokku ${plugin_name}[:COMMAND]"
|
||||||
echo ''
|
echo ''
|
||||||
echo "$plugin_description"
|
echo "$plugin_description"
|
||||||
echo ''
|
echo ''
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -e
|
set -e
|
||||||
output="$(curl -s -S -i -N -H \"Connection: Upgrade\" -H \"Upgrade: websocket\" -H \"Host: $1\" -H \"Origin: $1\" $1 -m 2)"
|
output="$(curl -s -S -i -N -H \"Connection: Upgrade\" -H \"Upgrade: websocket\" -H \"Host: $1\" -H \"Origin: $1\" $1 -m 2)"
|
||||||
echo $output
|
echo "$output"
|
||||||
test "$output" == "bazingaa"
|
test "$output" == "bazingaa"
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
if [[ "$1" == touch* ]]; then
|
if [[ "$1" == touch* ]]; then
|
||||||
echo "entrypoint script started with arguments $@"
|
echo "entrypoint script started with arguments $*"
|
||||||
touch "$(echo $@ | awk '{print $2}')"
|
touch "$(echo $@ | awk '{print $2}')"
|
||||||
else
|
else
|
||||||
exec "$@"
|
exec "$@"
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ install_dokku() {
|
|||||||
build_dokku
|
build_dokku
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cat << EOF | sudo debconf-set-selections
|
cat <<EOF | sudo debconf-set-selections
|
||||||
dokku dokku/hostname string dokku.me
|
dokku dokku/hostname string dokku.me
|
||||||
dokku dokku/key_file string /root/.ssh/id_rsa.pub
|
dokku dokku/key_file string /root/.ssh/id_rsa.pub
|
||||||
dokku dokku/nginx_enable boolean true
|
dokku dokku/nginx_enable boolean true
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ teardown() {
|
|||||||
build_nginx_config
|
build_nginx_config
|
||||||
assert_urls "http://${TEST_APP}.dokku.me"
|
assert_urls "http://${TEST_APP}.dokku.me"
|
||||||
add_domain "test.dokku.me"
|
add_domain "test.dokku.me"
|
||||||
assert_urls "http://test.dokku.me" "http://${TEST_APP}.dokku.me"
|
assert_urls "http://${TEST_APP}.dokku.me" "http://test.dokku.me"
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "(core) urls (app ssl)" {
|
@test "(core) urls (app ssl)" {
|
||||||
@@ -71,7 +71,7 @@ teardown() {
|
|||||||
build_nginx_config
|
build_nginx_config
|
||||||
assert_urls "http://${TEST_APP}.dokku.me" "https://${TEST_APP}.dokku.me"
|
assert_urls "http://${TEST_APP}.dokku.me" "https://${TEST_APP}.dokku.me"
|
||||||
add_domain "test.dokku.me"
|
add_domain "test.dokku.me"
|
||||||
assert_urls "http://test.dokku.me" "http://${TEST_APP}.dokku.me" "https://test.dokku.me" "https://${TEST_APP}.dokku.me"
|
assert_urls "http://${TEST_APP}.dokku.me" "https://${TEST_APP}.dokku.me" "https://test.dokku.me" "http://test.dokku.me"
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "(core) url (app ssl)" {
|
@test "(core) url (app ssl)" {
|
||||||
@@ -87,9 +87,9 @@ teardown() {
|
|||||||
build_nginx_config
|
build_nginx_config
|
||||||
assert_urls "http://${TEST_APP}.dokku.me" "https://${TEST_APP}.dokku.me"
|
assert_urls "http://${TEST_APP}.dokku.me" "https://${TEST_APP}.dokku.me"
|
||||||
add_domain "test.dokku.me"
|
add_domain "test.dokku.me"
|
||||||
assert_urls "http://test.dokku.me" "http://${TEST_APP}.dokku.me" "https://test.dokku.me" "https://${TEST_APP}.dokku.me"
|
assert_urls "http://${TEST_APP}.dokku.me" "https://${TEST_APP}.dokku.me" "https://test.dokku.me" "http://test.dokku.me"
|
||||||
add_domain "dokku.example.com"
|
add_domain "dokku.example.com"
|
||||||
assert_urls "http://dokku.example.com" "http://test.dokku.me" "http://${TEST_APP}.dokku.me" "https://dokku.example.com" "https://test.dokku.me" "https://${TEST_APP}.dokku.me"
|
assert_urls "http://dokku.example.com" "http://${TEST_APP}.dokku.me" "https://dokku.example.com" "https://${TEST_APP}.dokku.me" "https://test.dokku.me" "http://test.dokku.me"
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "(core) git-remote (off-port)" {
|
@test "(core) git-remote (off-port)" {
|
||||||
|
|||||||
@@ -258,7 +258,7 @@ assert_nonssl_domain() {
|
|||||||
assert_app_domain() {
|
assert_app_domain() {
|
||||||
local domain=$1
|
local domain=$1
|
||||||
run /bin/bash -c "dokku domains:report $TEST_APP --domains-app-vhosts | tr \" \" \"\n\" | grep -xF ${domain}"
|
run /bin/bash -c "dokku domains:report $TEST_APP --domains-app-vhosts | tr \" \" \"\n\" | grep -xF ${domain}"
|
||||||
echo "app domains: $(dokku domains:report "$TEST_APP" --domains-app-vhosts | tr \" \" \"\n\")"
|
echo "app domains: $(dokku domains:report "$TEST_APP" --domains-app-vhosts)"
|
||||||
echo "output: $output"
|
echo "output: $output"
|
||||||
echo "status: $status"
|
echo "status: $status"
|
||||||
assert_output "${domain}"
|
assert_output "${domain}"
|
||||||
@@ -290,7 +290,7 @@ assert_not_external_port() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
assert_url() {
|
assert_url() {
|
||||||
url=$1
|
url="$1"
|
||||||
run /bin/bash -c "dokku url $TEST_APP"
|
run /bin/bash -c "dokku url $TEST_APP"
|
||||||
echo "output: $output"
|
echo "output: $output"
|
||||||
echo "status: $status"
|
echo "status: $status"
|
||||||
@@ -299,12 +299,13 @@ assert_url() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
assert_urls() {
|
assert_urls() {
|
||||||
urls=$@
|
# shellcheck disable=SC2124
|
||||||
run /bin/bash -c "dokku urls $TEST_APP"
|
urls="$@"
|
||||||
|
run /bin/bash -c "dokku urls $TEST_APP | xargs"
|
||||||
echo "output: $output"
|
echo "output: $output"
|
||||||
echo "status: $status"
|
echo "status: $status"
|
||||||
echo "urls:" "$(tr ' ' '\n' <<<"${urls}" | sort)"
|
echo "urls:" "$urls"
|
||||||
assert_output < <(tr ' ' '\n' <<<"${urls}" | sort)
|
assert_output "$urls"
|
||||||
}
|
}
|
||||||
|
|
||||||
deploy_app() {
|
deploy_app() {
|
||||||
@@ -510,14 +511,14 @@ add_release_command() {
|
|||||||
local APP="$1"
|
local APP="$1"
|
||||||
local APP_REPO_DIR="$2"
|
local APP_REPO_DIR="$2"
|
||||||
[[ -z "$APP" ]] && local APP="$TEST_APP"
|
[[ -z "$APP" ]] && local APP="$TEST_APP"
|
||||||
echo "release: touch /app/release.test" >> "$APP_REPO_DIR/Procfile"
|
echo "release: touch /app/release.test" >>"$APP_REPO_DIR/Procfile"
|
||||||
}
|
}
|
||||||
|
|
||||||
add_requirements_txt() {
|
add_requirements_txt() {
|
||||||
local APP="$1"
|
local APP="$1"
|
||||||
local APP_REPO_DIR="$2"
|
local APP_REPO_DIR="$2"
|
||||||
[[ -z "$APP" ]] && local APP="$TEST_APP"
|
[[ -z "$APP" ]] && local APP="$TEST_APP"
|
||||||
echo "flask" >> "$APP_REPO_DIR/requirements.txt"
|
echo "flask" >>"$APP_REPO_DIR/requirements.txt"
|
||||||
}
|
}
|
||||||
|
|
||||||
build_nginx_config() {
|
build_nginx_config() {
|
||||||
|
|||||||
Reference in New Issue
Block a user