Compare commits

...

114 Commits

Author SHA1 Message Date
Jose Diaz-Gonzalez
0dc904c85f Release 1.40.1
Some checks failed
tagged-release / tagged-release (push) Has been cancelled
2025-06-01 22:46:20 -04:00
Jose Diaz-Gonzalez
8fa1c65aa5 Merge pull request #274 from dokku/dependabot/docker/redis-8.0.2
chore(deps): bump redis from 8.0.1 to 8.0.2
2025-06-01 22:43:54 -04:00
dependabot[bot]
0fe00ee95b chore(deps): bump redis from 8.0.1 to 8.0.2
Bumps redis from 8.0.1 to 8.0.2.

---
updated-dependencies:
- dependency-name: redis
  dependency-version: 8.0.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-01 20:30:26 +00:00
Jose Diaz-Gonzalez
6cccf014ab Merge pull request #273 from palfrey/stripped-down-default-config
Don't download default config
2025-06-01 16:29:19 -04:00
Tom Parker-Shemilt
09f1b1a858 Don't download default config 2025-05-25 19:23:05 +01:00
Jose Diaz-Gonzalez
772f677d0f Release 1.40.0
Some checks failed
tagged-release / tagged-release (push) Has been cancelled
2025-05-22 00:28:28 -04:00
Jose Diaz-Gonzalez
078c2c58d4 Merge pull request #271 from dokku/dependabot/docker/redis-8.0.1
chore(deps): bump redis from 7.4.3 to 8.0.1
2025-05-22 00:27:11 -04:00
dependabot[bot]
6316eb7d7d chore(deps): bump redis from 7.4.3 to 8.0.1
Bumps redis from 7.4.3 to 8.0.1.

---
updated-dependencies:
- dependency-name: redis
  dependency-version: 8.0.1
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-14 15:03:49 +00:00
Jose Diaz-Gonzalez
7f254ed43e Release 1.39.4
Some checks failed
tagged-release / tagged-release (push) Has been cancelled
2025-04-28 23:56:59 -04:00
Jose Diaz-Gonzalez
07c5006247 Merge pull request #269 from dokku/revert-249-fix/url-checker
Revert "Fix url checker. Old code fail if any variables contain the alias or REDIS_URL"
2025-04-28 23:30:06 -04:00
Jose Diaz-Gonzalez
985ef3d19f Revert "Fix url checker. Old code fail if any variables contain the alias or REDIS_URL" 2025-04-28 23:29:58 -04:00
Jose Diaz-Gonzalez
02e828c6aa docs: update readme 2025-04-28 23:16:51 -04:00
Jose Diaz-Gonzalez
1f8a288d80 Merge pull request #249 from grizmio/fix/url-checker
Fix url checker. Old code fail if any variables contain the alias or REDIS_URL
2025-04-28 23:15:57 -04:00
Jose Diaz-Gonzalez
91734c6a15 Merge pull request #267 from dokku/dependabot/docker/redis-7.4.3
chore(deps): bump redis from 7.4.2 to 7.4.3
2025-04-28 23:13:27 -04:00
Jose Diaz-Gonzalez
6d0637c581 Merge pull request #265 from dokku/dependabot/github_actions/softprops/action-gh-release-2.2.2
chore(deps): bump softprops/action-gh-release from 2.2.1 to 2.2.2
2025-04-28 23:13:16 -04:00
Jose Diaz-Gonzalez
0a3a272b5e Merge pull request #268 from dokku/fix-typo
docs: fix typo in generated docs
2025-04-28 23:11:18 -04:00
Jose Diaz-Gonzalez
435ca9f8dc docs: correct typo in generated readme 2025-04-28 23:07:50 -04:00
dependabot[bot]
88ab215473 chore(deps): bump redis from 7.4.2 to 7.4.3
Bumps redis from 7.4.2 to 7.4.3.

---
updated-dependencies:
- dependency-name: redis
  dependency-version: 7.4.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-25 15:09:39 +00:00
dependabot[bot]
731429e175 chore(deps): bump softprops/action-gh-release from 2.2.1 to 2.2.2
Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 2.2.1 to 2.2.2.
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](https://github.com/softprops/action-gh-release/compare/v2.2.1...v2.2.2)

---
updated-dependencies:
- dependency-name: softprops/action-gh-release
  dependency-version: 2.2.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-21 16:23:39 +00:00
Jose Diaz-Gonzalez
2211d7a095 Merge pull request #264 from dokku/update-workflows
chore: bump runs-on image from ubuntu-22.04 to ubuntu-24.04
2025-04-17 21:11:36 -04:00
Jose Diaz-Gonzalez
4567903371 fix: use maintained version of python 2025-04-17 20:46:21 -04:00
Jose Diaz-Gonzalez
cd1923eb9f chore: bump runs-on image from ubuntu-22.04 to ubuntu-24.04 2025-04-17 20:43:55 -04:00
Jose Diaz-Gonzalez
a488c74d28 Release 1.39.3
Some checks failed
tagged-release / tagged-release (push) Has been cancelled
2025-04-14 10:42:38 -04:00
Jose Diaz-Gonzalez
fc2e7ef408 Merge pull request #263 from kbuilds/fix-config-file-repo
Download the default redis config file from the official Redis repo
2025-04-14 10:41:28 -04:00
Kurtis Jensen
095eb6f89b Add -f flag to curl command
The `-f` flag will make curl fail if there is an http error. This should prevent this command from silently failing (and adding literal "404 error" string to the config file).
2025-04-09 17:21:26 -04:00
Kurtis Jensen
19a339f943 Download the default redis config file from the official Redis repository 2025-04-07 14:19:55 -04:00
Jose Diaz-Gonzalez
7ded70f338 Merge pull request #258 from dokku/maintained-action
ci: use maintained action for creating automated releases
2025-03-13 18:51:18 -05:00
Jose Diaz-Gonzalez
ff7c58599f ci: use maintained action for creating automated releases 2025-03-13 19:46:51 -04:00
Jose Diaz-Gonzalez
7dddac7059 Release 1.39.2
Some checks failed
tagged-release / tagged-release (push) Has been cancelled
2025-03-09 07:12:11 -04:00
Jose Diaz-Gonzalez
e7f710e40a Merge pull request #257 from dokku/7470-name-argument
docs: ensure --name flag is used in installation docs
2025-03-09 06:05:44 -05:00
Jose Diaz-Gonzalez
65e083a34e docs: ensure --name flag is used in installation docs
Closes dokku/dokku#7470
2025-03-09 07:04:00 -04:00
Jose Diaz-Gonzalez
c6cc9491e2 Release 1.39.1
Some checks failed
tagged-release / tagged-release (push) Has been cancelled
2025-02-02 00:44:41 -05:00
Jose Diaz-Gonzalez
5f3d30d789 Merge pull request #256 from dokku/dependabot/docker/redis-7.4.2
chore(deps): bump redis from 7.4.1 to 7.4.2
2025-02-01 23:44:33 -06:00
dependabot[bot]
7e8c8a13a9 chore(deps): bump redis from 7.4.1 to 7.4.2
Bumps redis from 7.4.1 to 7.4.2.

---
updated-dependencies:
- dependency-name: redis
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-07 15:14:37 +00:00
Jose Diaz-Gonzalez
fa170c55b6 Release 1.39.0
Some checks failed
tagged-release / tagged-release (push) Has been cancelled
2024-11-24 22:19:11 -05:00
Jose Diaz-Gonzalez
247561556c Merge pull request #255 from dokku/use-gpg-public-key-encryption
feat: implement GPG Public Key encryption support
2024-11-24 21:18:35 -05:00
Jose Diaz-Gonzalez
437a8be70d feat: implement GPG Public Key encryption support 2024-11-24 20:21:59 -05:00
Jose Diaz-Gonzalez
d9aba028c4 Merge pull request #254 from dokku/enable-image-overrides
feat: enable env overrides for support images and update all to latest
2024-11-24 19:57:34 -05:00
Jose Diaz-Gonzalez
dbaeebb3f8 feat: enable env overrides for support images and update all to latest 2024-11-24 19:15:23 -05:00
Jose Diaz-Gonzalez
13a379f2dd Release 1.38.0
Some checks failed
tagged-release / tagged-release (push) Has been cancelled
2024-10-10 10:47:06 -04:00
Jose Diaz-Gonzalez
003a8f23d9 Merge pull request #253 from dokku/dependabot/docker/redis-7.4.1
chore(deps): bump redis from 7.2.5 to 7.4.1
2024-10-10 10:46:50 -04:00
dependabot[bot]
d7ddc3f1ce chore(deps): bump redis from 7.2.5 to 7.4.1
Bumps redis from 7.2.5 to 7.4.1.

---
updated-dependencies:
- dependency-name: redis
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-08 15:24:51 +00:00
Enzo Macari
62e132ed2d Fix url checker. Old code fail if any variables contain the alias so FOO_REDIS_URL would match and believe its already defined. 2024-08-05 12:54:44 -04:00
Jose Diaz-Gonzalez
4cffb97b38 Release 1.37.6
Some checks failed
tagged-release / tagged-release (push) Has been cancelled
2024-07-18 19:20:47 -04:00
Jose Diaz-Gonzalez
cb8334e8dd Release 1.37.5
Some checks failed
tagged-release / tagged-release (push) Has been cancelled
2024-06-30 13:48:03 -04:00
Jose Diaz-Gonzalez
1c291d68d4 Merge pull request #243 from dokku/dependabot/docker/redis-7.2.5
chore(deps): bump redis from 7.2.4 to 7.2.5
2024-06-30 13:47:54 -04:00
dependabot[bot]
0d171fa06e ---
updated-dependencies:
- dependency-name: redis
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-29 07:50:54 +00:00
Jose Diaz-Gonzalez
38721a896d Merge pull request #246 from dokku/exclude-SC1091
tests: exclude SC1091 from shellcheck rules
2024-06-29 03:49:05 -04:00
Jose Diaz-Gonzalez
c7bce9872a tests: exclude SC1091 from shellcheck rules 2024-06-29 03:45:01 -04:00
Jose Diaz-Gonzalez
61bee552d1 Merge pull request #245 from dokku/fix-tests
fix: use .DNSNames instead of .Aliases in tests
2024-06-29 03:41:16 -04:00
Jose Diaz-Gonzalez
b35f5443f2 fix: use .DNSNames instead of .Aliases in tests
Docker has changed their output in an unclear manner, but this is the correct way to check for what dns records are available for usage by apps.
2024-06-29 03:25:41 -04:00
Jose Diaz-Gonzalez
c3a6e3af3c Release 1.37.4
Some checks failed
tagged-release / tagged-release (push) Has been cancelled
2024-01-29 10:10:11 -05:00
Jose Diaz-Gonzalez
14c0a11f3a Merge pull request #221 from nerg4l/fix/make-ubuntu-arm64
fix: use correct repository on arm64 ubuntu image
2024-01-29 10:05:52 -05:00
Jose Diaz-Gonzalez
944329c818 Release 1.37.3
Some checks failed
tagged-release / tagged-release (push) Has been cancelled
2024-01-29 08:31:26 -05:00
Jose Diaz-Gonzalez
b942ff35f0 Merge pull request #231 from dokku/dependabot/docker/redis-7.2.4
chore(deps): bump redis from 7.2.3 to 7.2.4
2024-01-29 08:31:08 -05:00
dependabot[bot]
4425dc2f29 chore(deps): bump redis from 7.2.3 to 7.2.4
Bumps redis from 7.2.3 to 7.2.4.

---
updated-dependencies:
- dependency-name: redis
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-10 15:31:32 +00:00
Jose Diaz-Gonzalez
2295773982 Merge pull request #230 from dokku/dependabot/github_actions/actions/upload-artifact-4
chore(deps): bump actions/upload-artifact from 3 to 4
2023-12-19 00:23:44 -05:00
dependabot[bot]
20c92de6c7 chore(deps): bump actions/upload-artifact from 3 to 4
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3 to 4.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-15 15:20:29 +00:00
László GÖRÖG
d90f3bb02a Merge branch 'master' into fix/make-ubuntu-arm64 2023-12-10 10:22:06 +01:00
Jose Diaz-Gonzalez
78a1cb36ed Release 1.37.2
Some checks failed
tagged-release / tagged-release (push) Has been cancelled
2023-12-09 23:56:16 -05:00
Jose Diaz-Gonzalez
a30dd2e727 docs: update docs and generation script 2023-12-09 23:55:46 -05:00
Jose Diaz-Gonzalez
d52e58f623 Merge pull request #229 from dokku/dependabot/github_actions/actions/setup-python-5
chore(deps): bump actions/setup-python from 4 to 5
2023-12-09 13:53:44 -05:00
Jose Diaz-Gonzalez
eb46fc4ae0 Merge pull request #228 from dokku/dependabot/docker/redis-7.2.3
chore(deps): bump redis from 7.2.1 to 7.2.3
2023-12-09 13:53:34 -05:00
Jose Diaz-Gonzalez
99c812fc2f chore: fix typo 2023-12-09 13:51:12 -05:00
Jose Diaz-Gonzalez
0d75a8e46f chore: fix typo 2023-12-09 13:48:37 -05:00
dependabot[bot]
ea92f11ab6 chore(deps): bump actions/setup-python from 4 to 5
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4 to 5.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-06 15:16:41 +00:00
dependabot[bot]
61ed70c5df chore(deps): bump redis from 7.2.1 to 7.2.3
Bumps redis from 7.2.1 to 7.2.3.

---
updated-dependencies:
- dependency-name: redis
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-06 15:06:59 +00:00
Jose Diaz-Gonzalez
2c2042535a Release 1.37.1
Some checks failed
tagged-release / tagged-release (push) Has been cancelled
2023-09-09 22:41:22 -04:00
Jose Diaz-Gonzalez
c5139b9169 Release 1.37.0
Some checks failed
tagged-release / tagged-release (push) Has been cancelled
2023-09-09 22:40:00 -04:00
Jose Diaz-Gonzalez
28dbf6bcd9 Merge pull request #225 from dokku/dependabot/docker/redis-7.2.1
chore(deps): bump redis from 7.2.0 to 7.2.1
2023-09-09 22:35:18 -04:00
dependabot[bot]
c4a7504881 chore(deps): bump redis from 7.2.0 to 7.2.1
Bumps redis from 7.2.0 to 7.2.1.

---
updated-dependencies:
- dependency-name: redis
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-08 15:38:16 +00:00
Jose Diaz-Gonzalez
5bbbfd1cc9 Merge pull request #223 from dokku/dependabot/github_actions/actions/checkout-4
chore(deps): bump actions/checkout from 3 to 4
2023-09-06 23:45:02 -04:00
dependabot[bot]
1e2125c800 chore(deps): bump actions/checkout from 3 to 4
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-07 02:55:29 +00:00
Jose Diaz-Gonzalez
afe76f799a Merge pull request #224 from dokku/newer-ubuntu
feat: upgrade test suite from ubuntu 20.04 to 22.04
2023-09-06 22:54:43 -04:00
Jose Diaz-Gonzalez
648d137007 feat: upgrade test suite from ubuntu 20.04 to 22.04 2023-09-06 22:37:22 -04:00
Jose Diaz-Gonzalez
9a95ed8299 Release 1.36.0
Some checks failed
tagged-release / tagged-release (push) Has been cancelled
2023-08-17 19:57:06 -04:00
Jose Diaz-Gonzalez
f66c0d945e Merge pull request #222 from dokku/dependabot/docker/redis-7.2.0
chore(deps): bump redis from 7.0.12 to 7.2.0
2023-08-17 19:56:55 -04:00
dependabot[bot]
8a65d7c1cd chore(deps): bump redis from 7.0.12 to 7.2.0
Bumps redis from 7.0.12 to 7.2.0.

---
updated-dependencies:
- dependency-name: redis
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-17 15:58:01 +00:00
László GÖRÖG
3ad35ef009 fix: use correct repository on arm64 ubuntu image 2023-08-07 17:37:30 +02:00
Jose Diaz-Gonzalez
f8b3c5eb42 Release 1.35.0
Some checks failed
tagged-release / tagged-release (push) Has been cancelled
2023-07-11 16:50:04 -04:00
Jose Diaz-Gonzalez
62e24bdb71 Merge pull request #218 from dokku/dependabot/docker/redis-7.0.12
chore(deps): bump redis from 7.0.11 to 7.0.12
2023-07-11 16:49:48 -04:00
dependabot[bot]
d5a87c21f5 chore(deps): bump redis from 7.0.11 to 7.0.12
Bumps redis from 7.0.11 to 7.0.12.

---
updated-dependencies:
- dependency-name: redis
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-11 15:38:12 +00:00
Jose Diaz-Gonzalez
9776ebdf6a Release 1.34.0
Some checks failed
tagged-release / tagged-release (push) Has been cancelled
2023-05-28 01:00:06 -04:00
Jose Diaz-Gonzalez
7be49f9bbe Release 1.32.4
Some checks failed
tagged-release / tagged-release (push) Has been cancelled
2023-04-27 21:59:57 -04:00
josegonzalez
5aa50b86e5 Merge pull request #216 from dokku/dependabot/docker/redis-7.0.11
chore(deps): bump redis from 7.0.10 to 7.0.11
2023-04-27 21:59:46 -04:00
dependabot[bot]
6783620cd7 chore(deps): bump redis from 7.0.10 to 7.0.11
Bumps redis from 7.0.10 to 7.0.11.

---
updated-dependencies:
- dependency-name: redis
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-18 15:57:49 +00:00
Jose Diaz-Gonzalez
38278ab9d9 Release 1.32.3
Some checks failed
tagged-release / tagged-release (push) Has been cancelled
2023-03-21 16:16:27 -04:00
Jose Diaz-Gonzalez
e04200a99c Release 1.32.2
Some checks failed
tagged-release / tagged-release (push) Has been cancelled
2023-03-21 13:28:50 -04:00
josegonzalez
ea3781cd28 Merge pull request #215 from dokku/dependabot/docker/redis-7.0.10
chore(deps): bump redis from 7.0.9 to 7.0.10
2023-03-21 13:28:23 -04:00
dependabot[bot]
cf59cac18a chore(deps): bump redis from 7.0.9 to 7.0.10
Bumps redis from 7.0.9 to 7.0.10.

---
updated-dependencies:
- dependency-name: redis
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-21 16:02:35 +00:00
Jose Diaz-Gonzalez
e76a457c74 Release 1.32.1
Some checks failed
tagged-release / tagged-release (push) Has been cancelled
2023-03-19 05:30:41 -04:00
josegonzalez
8b653f74b0 Merge pull request #214 from dokku/dependabot/docker/redis-7.0.9
chore(deps): bump redis from 7.0.8 to 7.0.9
2023-03-19 05:30:31 -04:00
dependabot[bot]
57f7b138f4 chore(deps): bump redis from 7.0.8 to 7.0.9
Bumps redis from 7.0.8 to 7.0.9.

---
updated-dependencies:
- dependency-name: redis
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-01 16:00:16 +00:00
Jose Diaz-Gonzalez
a443bc7912 Release 1.32.0
Some checks failed
tagged-release / tagged-release (push) Has been cancelled
2023-02-25 22:13:23 -05:00
josegonzalez
b1d94ed87a Merge pull request #213 from dokku/error-when-link-exists
Show an error when an ambassador container already exists but we don't have expose configuration
2023-02-25 22:12:05 -05:00
Jose Diaz-Gonzalez
352794aa05 fix: show an error when an ambassador container already exists but we don't have expose configuration
Closes dokku/dokku-redis#200
2023-02-25 20:10:37 -05:00
Jose Diaz-Gonzalez
2369ebf94a Release 1.31.0
Some checks failed
tagged-release / tagged-release (push) Has been cancelled
2023-02-25 02:23:31 -05:00
josegonzalez
ac78cb842c Merge pull request #211 from dokku/no-restart-link
Add ability to skip restarts on link and unlink
2023-02-25 02:13:18 -05:00
Jose Diaz-Gonzalez
a902165547 fix: update link docs to remove erroneous copy-paste 2023-02-25 01:50:30 -05:00
Jose Diaz-Gonzalez
dbaa985fe6 tests: link service before unlinking 2023-02-25 00:47:26 -05:00
Jose Diaz-Gonzalez
5e78f7d1e5 chore: remove extra newline 2023-02-21 00:49:18 -05:00
Jose Diaz-Gonzalez
b3747635b2 fix: update tests to properly handle case where app is not running 2023-02-21 00:48:23 -05:00
Jose Diaz-Gonzalez
3154beb12d fix: move arg-less flags to the front 2023-02-21 00:29:30 -05:00
Jose Diaz-Gonzalez
3cb6d2fe7b tests: add output/status and flesh out restart tests a bit more 2023-02-21 00:08:53 -05:00
Jose Diaz-Gonzalez
577d73e7f0 tests: add test for --no-restart to link tests 2023-02-20 23:51:28 -05:00
Jose Diaz-Gonzalez
6b39dea20e tests: add test for --no-restart to unlink tests 2023-02-20 23:47:03 -05:00
Jose Diaz-Gonzalez
ba0f46a8b5 chore: make all the service names used in the service_unlink tests the same 2023-02-20 23:40:09 -05:00
Jose Diaz-Gonzalez
673fc4c9bb chore: make all the service names used in the service_link tests the same 2023-02-20 23:35:12 -05:00
Jose Diaz-Gonzalez
3c6b6e1c0f feat: add ability to skip restarts on link and unlink
Refs dokku/dokku-redis#192
2023-02-20 23:26:44 -05:00
Jose Diaz-Gonzalez
9fd0ede9f3 Release 1.30.1
Some checks failed
tagged-release / tagged-release (push) Has been cancelled
2023-02-09 03:12:27 -05:00
Jose Diaz-Gonzalez
7fb98d7cfc fix: drop extra files from being included in release 2023-02-09 03:07:31 -05:00
josegonzalez
4da3491a6c Merge pull request #210 from dokku/auto-release-tags
feat: automatically create releases from tags
2023-02-09 03:03:10 -05:00
Jose Diaz-Gonzalez
79d204a682 feat: automatically create releases from tags
This will also include release notes, allowing downstream consumers of plugins to better understand what the release includes.
2023-02-09 03:00:43 -05:00
Jose Diaz-Gonzalez
9a6b80c837 Release 1.30.0 2023-02-09 00:47:48 -05:00
24 changed files with 559 additions and 194 deletions

View File

@@ -5,7 +5,7 @@ name: CI
on:
pull_request:
branches:
- '*'
- "*"
push:
branches:
- master
@@ -17,18 +17,18 @@ concurrency:
jobs:
unit-tests-master:
name: unit-tests
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
env:
DOKKU_VERSION: master
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.7.x'
python-version: "3.13"
- run: make setup
@@ -51,7 +51,7 @@ jobs:
- run: make test
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
if: failure()
with:
name: tmp/test-results
@@ -59,18 +59,18 @@ jobs:
unit-tests-0_19_0:
name: unit-tests-0.19.0
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
env:
DOKKU_TAG: v0.19.0
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.7.x'
python-version: "3.13"
- run: make setup
@@ -93,7 +93,7 @@ jobs:
- run: make test
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
if: failure()
with:
name: tmp/test-results

20
.github/workflows/tagged-release.yml vendored Normal file
View File

@@ -0,0 +1,20 @@
---
name: "tagged-release"
# yamllint disable-line rule:truthy
on:
push:
tags:
- "*"
jobs:
tagged-release:
name: tagged-release
runs-on: ubuntu-24.04
steps:
- name: Release
uses: softprops/action-gh-release@v2.2.2
with:
generate_release_notes: true
make_latest: "true"

View File

@@ -1 +1 @@
FROM redis:7.0.8
FROM redis:8.0.2

View File

@@ -1,5 +1,6 @@
HARDWARE = $(shell uname -m)
SYSTEM_NAME = $(shell uname -s | tr '[:upper:]' '[:lower:]')
ARCH = $(shell dpkg --print-architecture)
SHFMT_VERSION = 3.0.2
XUNIT_TO_GITHUB_VERSION = 0.3.0
XUNIT_READER_VERSION = 0.1.0
@@ -21,7 +22,11 @@ ifneq ($(shell shellcheck --version >/dev/null 2>&1 ; echo $$?),0)
ifeq ($(SYSTEM_NAME),darwin)
brew install shellcheck
else
sudo add-apt-repository 'deb http://archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse'
ifeq ($(ARCH),arm64)
sudo add-apt-repository 'deb http://ports.ubuntu.com/ubuntu-ports jammy-backports main restricted universe multiverse'
else
sudo add-apt-repository 'deb http://archive.ubuntu.com/ubuntu jammy-backports main restricted universe multiverse'
endif
sudo rm -rf /var/lib/apt/lists/* && sudo apt-get clean
sudo apt-get update -qq && sudo apt-get install -qq -y shellcheck
endif

View File

@@ -1,6 +1,6 @@
# dokku redis [![Build Status](https://img.shields.io/github/actions/workflow/status/dokku/dokku-redis/ci.yml?branch=master&style=flat-square "Build Status")](https://github.com/dokku/dokku-redis/actions/workflows/ci.yml?query=branch%3Amaster) [![IRC Network](https://img.shields.io/badge/irc-libera-blue.svg?style=flat-square "IRC Libera")](https://webchat.libera.chat/?channels=dokku)
Official redis plugin for dokku. Currently defaults to installing [redis 7.0.8](https://hub.docker.com/_/redis/).
Official redis plugin for dokku. Currently defaults to installing [redis 8.0.2](https://hub.docker.com/_/redis/).
## Requirements
@@ -11,7 +11,7 @@ Official redis plugin for dokku. Currently defaults to installing [redis 7.0.8](
```shell
# on 0.19.x+
sudo dokku plugin:install https://github.com/dokku/dokku-redis.git redis
sudo dokku plugin:install https://github.com/dokku/dokku-redis.git --name redis
```
## Commands
@@ -24,8 +24,10 @@ redis:backup-deauth <service> # remove backup authenticatio
redis:backup-schedule <service> <schedule> <bucket-name> [--use-iam] # schedule a backup of the redis service
redis:backup-schedule-cat <service> # cat the contents of the configured backup cronfile for the service
redis:backup-set-encryption <service> <passphrase> # set encryption for all future backups of redis service
redis:backup-set-public-key-encryption <service> <public-key-id> # set GPG Public Key encryption for all future backups of redis service
redis:backup-unschedule <service> # unschedule the backup of the redis service
redis:backup-unset-encryption <service> # unset encryption for future backups of the redis service
redis:backup-unset-public-key-encryption <service> # unset GPG Public Key encryption for future backups of the redis service
redis:clone <service> <new-service> [--clone-flags...] # create container <new-name> then copy data from <name> into <new-name>
redis:connect <service> # connect to the service via the redis connection tool
redis:create <service> [--create-flags...] # create a redis service
@@ -74,9 +76,9 @@ flags:
- `-m|--memory MEMORY`: container memory limit in megabytes (default: unlimited)
- `-N|--initial-network INITIAL_NETWORK`: the initial network to attach the service to
- `-p|--password PASSWORD`: override the user-level service password
- `-P|--post-create-network NETWORKS`: a comman-separated list of networks to attach the service container to after service creation
- `-P|--post-create-network NETWORKS`: a comma-separated list of networks to attach the service container to after service creation
- `-r|--root-password PASSWORD`: override the root-level service password
- `-S|--post-start-network NETWORKS`: a comman-separated list of networks to attach the service container to after service start
- `-S|--post-start-network NETWORKS`: a comma-separated list of networks to attach the service container to after service start
- `-s|--shm-size SHM_SIZE`: override shared memory size for redis docker container
Create a redis service named lollipop:
@@ -93,7 +95,7 @@ export REDIS_IMAGE_VERSION="${PLUGIN_IMAGE_VERSION}"
dokku redis:create lollipop
```
You can also specify custom environment variables to start the redis service in semi-colon separated form.
You can also specify custom environment variables to start the redis service in semicolon-separated form.
```shell
export REDIS_CUSTOM_ENV="USER=alpha;HOST=beta"
@@ -151,7 +153,7 @@ dokku redis:info lollipop --version
```shell
# usage
dokku redis:list
dokku redis:list
```
List all services:
@@ -200,6 +202,7 @@ flags:
- `-a|--alias "BLUE_DATABASE"`: an alternative alias to use for linking to an app via environment variable
- `-q|--querystring "pool=5"`: ampersand delimited querystring arguments to append to the service link
- `-n|--no-restart "false"`: whether or not to restart the app on link (default: true)
A redis service can be linked to a container. This will use native docker links via the docker-options plugin. Here we link it to our `playground` app.
@@ -252,6 +255,10 @@ redis2://:SOME_PASSWORD@dokku-redis-lollipop:6379
dokku redis:unlink <service> <app>
```
flags:
- `-n|--no-restart "false"`: whether or not to restart the app on unlink (default: true)
You can unlink a redis service:
> NOTE: this will restart your app and unset related environment variables
@@ -338,7 +345,7 @@ Expose the service on the service's normal ports, allowing access to it from the
dokku redis:expose lollipop 6379
```
Expose the service on the service's normal ports, with the first on a specified ip adddress (127.0.0.1):
Expose the service on the service's normal ports, with the first on a specified ip address (127.0.0.1):
```shell
dokku redis:expose lollipop 127.0.0.1:6379
@@ -452,9 +459,9 @@ flags:
- `-i|--image IMAGE`: the image name to start the service with
- `-I|--image-version IMAGE_VERSION`: the image version to start the service with
- `-N|--initial-network INITIAL_NETWORK`: the initial network to attach the service to
- `-P|--post-create-network NETWORKS`: a comman-separated list of networks to attach the service container to after service creation
- `-R|--restart-apps "true"`: whether to force an app restart
- `-S|--post-start-network NETWORKS`: a comman-separated list of networks to attach the service container to after service start
- `-P|--post-create-network NETWORKS`: a comma-separated list of networks to attach the service container to after service creation
- `-R|--restart-apps "true"`: whether or not to force an app restart (default: false)
- `-S|--post-start-network NETWORKS`: a comma-separated list of networks to attach the service container to after service start
- `-s|--shm-size SHM_SIZE`: override shared memory size for redis docker container
You can upgrade an existing service to a new image or image-version:
@@ -496,9 +503,9 @@ flags:
- `-m|--memory MEMORY`: container memory limit in megabytes (default: unlimited)
- `-N|--initial-network INITIAL_NETWORK`: the initial network to attach the service to
- `-p|--password PASSWORD`: override the user-level service password
- `-P|--post-create-network NETWORKS`: a comman-separated list of networks to attach the service container to after service creation
- `-P|--post-create-network NETWORKS`: a comma-separated list of networks to attach the service container to after service creation
- `-r|--root-password PASSWORD`: override the root-level service password
- `-S|--post-start-network NETWORKS`: a comman-separated list of networks to attach the service container to after service start
- `-S|--post-start-network NETWORKS`: a comma-separated list of networks to attach the service container to after service start
- `-s|--shm-size SHM_SIZE`: override shared memory size for redis docker container
You can clone an existing service to a new one:
@@ -670,6 +677,19 @@ Set the GPG-compatible passphrase for encrypting backups for backups:
dokku redis:backup-set-encryption lollipop
```
### set GPG Public Key encryption for all future backups of redis service
```shell
# usage
dokku redis:backup-set-public-key-encryption <service> <public-key-id>
```
Set the `GPG` Public Key for encrypting backups:
```shell
dokku redis:backup-set-public-key-encryption lollipop
```
### unset encryption for future backups of the redis service
```shell
@@ -683,6 +703,19 @@ Unset the `GPG` encryption passphrase for backups:
dokku redis:backup-unset-encryption lollipop
```
### unset GPG Public Key encryption for future backups of the redis service
```shell
# usage
dokku redis:backup-unset-public-key-encryption <service>
```
Unset the `GPG` Public Key encryption for backups:
```shell
dokku redis:backup-unset-public-key-encryption lollipop
```
### schedule a backup of the redis service
```shell

2
Vagrantfile vendored
View File

@@ -1,7 +1,7 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :
BOX_NAME = ENV["BOX_NAME"] || "bento/ubuntu-20.04"
BOX_NAME = ENV["BOX_NAME"] || "bento/ubuntu-24.04"
BOX_MEMORY = ENV["BOX_MEMORY"] || "2048"
DOKKU_VERSION = "master"

View File

@@ -1,15 +1,30 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from __future__ import print_function
import os
import re
def compile(service, version, variable, alias, image, scheme, ports, sponsors, options, unimplemented, dokku_version):
prefix = "\n\n".join([
header(service),
description(service, image, version),
])
def compile(
service,
version,
variable,
alias,
image,
scheme,
ports,
sponsors,
options,
unimplemented,
dokku_version,
):
prefix = "\n\n".join(
[
header(service),
description(service, image, version),
]
)
if len(sponsors) > 0:
prefix += "\n\n"
@@ -21,8 +36,19 @@ def compile(service, version, variable, alias, image, scheme, ports, sponsors, o
prefix,
requirements_section(dokku_version),
installation_section(service, dokku_version),
commands_section(service, variable, alias, image, scheme, ports, unimplemented),
usage_section(service, variable, alias, image, scheme, ports, options, unimplemented),
commands_section(
service, variable, alias, image, scheme, ports, unimplemented
),
usage_section(
service,
variable,
alias,
image,
scheme,
ports,
options,
unimplemented,
),
]
)
.replace("\n\n\n\n\n", "\n")
@@ -55,17 +81,25 @@ def sponsors_section(service, sponsors):
if len(sponsors) == 0:
return ""
sponsor_data = ["## Sponsors", "", f"The {service} plugin was generously sponsored by the following:", ""]
sponsor_data = [
"## Sponsors",
"",
f"The {service} plugin was generously sponsored by the following:",
"",
]
sponsor_data.extend([f"- [{s}](https://github.com/{s})" for s in sponsors])
return "\n".join(
sponsor_data
)
return "\n".join(sponsor_data)
def requirements_section(dokku_version):
return "\n".join(
["## Requirements", "", f"- dokku {dokku_version}", "- docker 1.8.x",]
[
"## Requirements",
"",
f"- dokku {dokku_version}",
"- docker 1.8.x",
]
)
@@ -76,7 +110,7 @@ def installation_section(service, dokku_version):
"",
"```shell",
f"# on {dokku_version}",
f"sudo dokku plugin:install https://github.com/dokku/dokku-{service}.git {service}",
f"sudo dokku plugin:install https://github.com/dokku/dokku-{service}.git --name {service}",
"```",
]
)
@@ -115,17 +149,31 @@ def commands_section(service, variable, alias, image, scheme, ports, unimplement
return "\n".join(content)
def usage_section(service, variable, alias, image, scheme, ports, options, unimplemented):
def usage_section(
service, variable, alias, image, scheme, ports, options, unimplemented
):
return "\n\n".join(
[
"## Usage",
f"Help for any commands can be displayed by specifying the command as an argument to {service}:help. Plugin help output in conjunction with any files in the `docs/` folder is used to generate the plugin documentation. Please consult the `{service}:help` command for any undocumented commands.",
usage_intro(service, variable, alias, image, scheme, ports, options, unimplemented),
usage_lifecycle(service, variable, alias, image, scheme, ports, options, unimplemented),
usage_automation(service, variable, alias, image, scheme, ports, options, unimplemented),
usage_data_management(service, variable, alias, image, scheme, ports, options, unimplemented),
usage_backup(service, variable, alias, image, scheme, ports, options, unimplemented),
usage_docker_pull(service, variable, alias, image, scheme, ports, options, unimplemented),
usage_intro(
service, variable, alias, image, scheme, ports, options, unimplemented
),
usage_lifecycle(
service, variable, alias, image, scheme, ports, options, unimplemented
),
usage_automation(
service, variable, alias, image, scheme, ports, options, unimplemented
),
usage_data_management(
service, variable, alias, image, scheme, ports, options, unimplemented
),
usage_backup(
service, variable, alias, image, scheme, ports, options, unimplemented
),
usage_docker_pull(
service, variable, alias, image, scheme, ports, options, unimplemented
),
]
)
@@ -135,11 +183,22 @@ def usage_intro(service, variable, alias, image, scheme, ports, options, unimple
content = ["### Basic Usage"]
return fetch_commands_content(
service, variable, alias, image, scheme, ports, options, unimplemented, commands, content
service,
variable,
alias,
image,
scheme,
ports,
options,
unimplemented,
commands,
content,
)
def usage_lifecycle(service, variable, alias, image, scheme, ports, options, unimplemented):
def usage_lifecycle(
service, variable, alias, image, scheme, ports, options, unimplemented
):
commands = [
"connect",
"enter",
@@ -160,11 +219,22 @@ def usage_lifecycle(service, variable, alias, image, scheme, ports, options, uni
]
return fetch_commands_content(
service, variable, alias, image, scheme, ports, options, unimplemented, commands, content
service,
variable,
alias,
image,
scheme,
ports,
options,
unimplemented,
commands,
content,
)
def usage_automation(service, variable, alias, image, scheme, ports, options, unimplemented):
def usage_automation(
service, variable, alias, image, scheme, ports, options, unimplemented
):
commands = ["app-links", "clone", "exists", "linked", "links"]
content = [
"### Service Automation",
@@ -174,11 +244,22 @@ def usage_automation(service, variable, alias, image, scheme, ports, options, un
]
return fetch_commands_content(
service, variable, alias, image, scheme, ports, options, unimplemented, commands, content
service,
variable,
alias,
image,
scheme,
ports,
options,
unimplemented,
commands,
content,
)
def usage_data_management(service, variable, alias, image, scheme, ports, options, unimplemented):
def usage_data_management(
service, variable, alias, image, scheme, ports, options, unimplemented
):
commands = ["import", "export"]
content = [
"### Data Management",
@@ -188,17 +269,30 @@ def usage_data_management(service, variable, alias, image, scheme, ports, option
]
return fetch_commands_content(
service, variable, alias, image, scheme, ports, options, unimplemented, commands, content
service,
variable,
alias,
image,
scheme,
ports,
options,
unimplemented,
commands,
content,
)
def usage_backup(service, variable, alias, image, scheme, ports, options, unimplemented):
def usage_backup(
service, variable, alias, image, scheme, ports, options, unimplemented
):
commands = [
"backup-auth",
"backup-deauth",
"backup",
"backup-set-encryption",
"backup-set-public-key-encryption",
"backup-unset-encryption",
"backup-unset-public-key-encryption",
"backup-schedule",
"backup-schedule-cat",
"backup-unschedule",
@@ -215,11 +309,22 @@ def usage_backup(service, variable, alias, image, scheme, ports, options, unimpl
]
return fetch_commands_content(
service, variable, alias, image, scheme, ports, options, unimplemented, commands, content
service,
variable,
alias,
image,
scheme,
ports,
options,
unimplemented,
commands,
content,
)
def usage_docker_pull(service, variable, alias, image, scheme, ports, options, unimplemented):
def usage_docker_pull(
service, variable, alias, image, scheme, ports, options, unimplemented
):
service_prefix = service.upper()
return "\n".join(
[
@@ -233,11 +338,30 @@ def usage_docker_pull(service, variable, alias, image, scheme, ports, options, u
def fetch_commands_content(
service, variable, alias, image, scheme, ports, options, unimplemented, commands, content
service,
variable,
alias,
image,
scheme,
ports,
options,
unimplemented,
commands,
content,
):
i = 0
for command in commands:
output = command_help(command, service, variable, alias, image, scheme, ports, options, unimplemented)
output = command_help(
command,
service,
variable,
alias,
image,
scheme,
ports,
options,
unimplemented,
)
if output == "":
continue
content.append(output)
@@ -275,7 +399,9 @@ def parse_args(line):
return " ".join(arguments)
def command_help(command, service, variable, alias, image, scheme, ports, options, unimplemented):
def command_help(
command, service, variable, alias, image, scheme, ports, options, unimplemented
):
if command in unimplemented:
return ""
@@ -285,7 +411,7 @@ def command_help(command, service, variable, alias, image, scheme, ports, option
"",
"```shell",
"# usage",
f"dokku {service}:{command} {data['arguments_string']}",
f"dokku {service}:{command} {data['arguments_string']}".strip(),
"```",
]
@@ -442,11 +568,11 @@ def process_sentence(sentence_lines):
parts = []
for word in sentence.strip().split(" "):
if word.isupper() and len(word) > 1:
for ending in [':', '.']:
for ending in [":", "."]:
if word.endswith(ending):
word = '`{0}`{1}'.format(word[:-1], ending)
word = "`{0}`{1}".format(word[:-1], ending)
else:
word = '`{0}`'.format(word)
word = "`{0}`".format(word)
parts.append(word)
text.append(" ".join(parts))
@@ -491,10 +617,10 @@ def main():
with open("Dockerfile") as f:
for line in f.readlines():
if "FROM " in line:
image, version = line.split(" ")[1].split(":")
image = image.strip()
version = version.strip()
if "FROM " in line:
image, version = line.split(" ")[1].split(":")
image = image.strip()
version = version.strip()
with open("config") as f:
for line in f.readlines():
@@ -524,10 +650,22 @@ def main():
with open("plugin.toml") as f:
for line in f.readlines():
if line.startswith("sponsors"):
sponsors = re.search("\[([\"\w\s,_-]+)\]", line).group(1)
sponsors = [s.strip("\"") for s in sponsors.split(",")]
sponsors = re.search('\[(["\w\s,_-]+)\]', line).group(1)
sponsors = [s.strip('"') for s in sponsors.split(",")]
text = compile(service, version, variable, alias, image, scheme, ports, sponsors, options, unimplemented, "0.19.x+")
text = compile(
service,
version,
variable,
alias,
image,
scheme,
ports,
sponsors,
options,
unimplemented,
"0.19.x+",
)
base_path = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
readme_file = os.path.join(base_path, "README.md")

View File

@@ -62,7 +62,7 @@ fn-services-list() {
[[ -d $f ]] || continue
services+=("$f")
done
popd &>/dev/null || pushd "/tmp" >/dev/null
popd >/dev/null 2>&1 || pushd "/tmp" >/dev/null
if [[ "${#services[@]}" -eq 0 ]]; then
return
@@ -282,7 +282,7 @@ service_backup() {
BACKUP_TMPDIR=$(mktemp -d --tmpdir)
trap 'rm -rf "$BACKUP_TMPDIR" > /dev/null' RETURN INT TERM EXIT
"$DOCKER_BIN" container inspect "$ID" &>/dev/null || dokku_log_fail "Service container does not exist"
"$DOCKER_BIN" container inspect "$ID" >/dev/null 2>&1 || dokku_log_fail "Service container does not exist"
is_container_status "$ID" "Running" || dokku_log_fail "Service container is not running"
(service_export "$SERVICE" >"${BACKUP_TMPDIR}/export")
@@ -308,6 +308,10 @@ service_backup() {
BACKUP_PARAMETERS="$BACKUP_PARAMETERS -e ENCRYPTION_KEY=$(cat "$BACKUP_ENCRYPTION_CONFIG_ROOT/ENCRYPTION_KEY")"
fi
if [[ -f "$BACKUP_ENCRYPTION_CONFIG_ROOT/ENCRYPT_WITH_PUBLIC_KEY_ID" ]]; then
BACKUP_PARAMETERS="$BACKUP_PARAMETERS -e ENCRYPT_WITH_PUBLIC_KEY_ID=$(cat "$BACKUP_ENCRYPTION_CONFIG_ROOT/ENCRYPT_WITH_PUBLIC_KEY_ID")"
fi
# shellcheck disable=SC2086
"$DOCKER_BIN" container run --rm $BACKUP_PARAMETERS "$PLUGIN_S3BACKUP_IMAGE"
}
@@ -433,6 +437,16 @@ service_backup_set_encryption() {
echo "$ENCRYPTION_KEY" >"${SERVICE_BACKUP_ENCRYPTION_ROOT}/ENCRYPTION_KEY"
}
service_backup_set_public_key_encryption() {
declare desc="set up backup GPG Public Key encryption"
declare SERVICE="$1" ENCRYPT_WITH_PUBLIC_KEY_ID="$2"
local SERVICE_ROOT="${PLUGIN_DATA_ROOT}/${SERVICE}"
local SERVICE_BACKUP_ENCRYPTION_ROOT="${SERVICE_ROOT}/backup-encryption/"
mkdir "$SERVICE_BACKUP_ENCRYPTION_ROOT"
echo "$ENCRYPT_WITH_PUBLIC_KEY_ID" >"${SERVICE_BACKUP_ENCRYPTION_ROOT}/ENCRYPT_WITH_PUBLIC_KEY_ID"
}
service_backup_unschedule() {
declare desc="unschedule the backup of the service"
declare SERVICE="$1"
@@ -450,6 +464,15 @@ service_backup_unset_encryption() {
rm -rf "$SERVICE_BACKUP_ENCRYPTION_ROOT"
}
service_backup_unset_encryption() {
declare desc="remove backup encryption"
declare SERVICE="$1"
local SERVICE_ROOT="${PLUGIN_DATA_ROOT}/${SERVICE}"
local SERVICE_BACKUP_ENCRYPTION_ROOT="${SERVICE_ROOT}/backup-encryption/"
rm -rf "$SERVICE_BACKUP_ENCRYPTION_ROOT"
}
service_container_rm() {
declare desc="stop a service and remove the running container"
declare SERVICE="$1"
@@ -457,7 +480,7 @@ service_container_rm() {
local ID
service_pause "$SERVICE"
ID=$("$DOCKER_BIN" container ps -aq --no-trunc --filter "name=^/$SERVICE_NAME$" --format '{{ .ID }}') || true
ID=$("$DOCKER_BIN" container ps -aq --no-trunc --filter "name=^/$SERVICE_NAME$") || true
# this may be 'true' in tests...
if [[ -z "$ID" ]] || [[ "$ID" == "true" ]]; then
return 0
@@ -483,7 +506,7 @@ service_enter() {
local SERVICE_ROOT="$PLUGIN_DATA_ROOT/$SERVICE"
local ID="$(cat "$SERVICE_ROOT/ID")"
"$DOCKER_BIN" container inspect "$ID" &>/dev/null || dokku_log_fail "Service container does not exist"
"$DOCKER_BIN" container inspect "$ID" >/dev/null 2>&1 || dokku_log_fail "Service container does not exist"
is_container_status "$ID" "Running" || dokku_log_fail "Service container is not running"
local EXEC_CMD=""
@@ -631,8 +654,9 @@ service_link() {
fi
[[ -n "$SERVICE_QUERYSTRING" ]] && SERVICE_URL="${SERVICE_URL}?${SERVICE_QUERYSTRING}"
plugn trigger service-action post-link "$PLUGIN_COMMAND_PREFIX" "$SERVICE" "$APP"
if [[ "$DOKKU_GLOBAL_FLAGS" == *"--no-restart"* ]]; then
if [[ "$DOKKU_GLOBAL_FLAGS" == *"--no-restart"* ]] || [[ "$SERVICE_RESTART_APPS" == "false" ]]; then
config_set --no-restart "$APP" "${ALIAS}_URL=$SERVICE_URL"
dokku_log_verbose "Skipping restart of linked app"
else
config_set "$APP" "${ALIAS}_URL=$SERVICE_URL"
fi
@@ -690,7 +714,7 @@ service_logs() {
DOKKU_LOGS_ARGS+=" --follow"
fi
"$DOCKER_BIN" container inspect "$ID" &>/dev/null || dokku_log_fail "Service container does not exist"
"$DOCKER_BIN" container inspect "$ID" >/dev/null 2>&1 || dokku_log_fail "Service container does not exist"
is_container_status "$ID" "Running" || dokku_log_warn "Service logs may not be output as service is not running"
# shellcheck disable=SC2086
@@ -714,6 +738,7 @@ service_parse_args() {
"--initial-network") set -- "$@" "-N" ;;
"--image") set -- "$@" "-i" ;;
"--memory") set -- "$@" "-m" ;;
"--no-restart") set -- "$@" "-n" ;;
"--password") set -- "$@" "-p" ;;
"--post-create-network") set -- "$@" "-P" ;;
"--post-start-network") set -- "$@" "-S" ;;
@@ -727,7 +752,7 @@ service_parse_args() {
done
OPTIND=1
while getopts "a:c:C:d:i:I:m:n:N:p:P:q:R:r:s:S:u:" opt; do
while getopts "na:c:C:d:i:I:m:n:N:p:P:q:R:r:s:S:u:" opt; do
case "$opt" in
a)
SERVICE_ALIAS="${OPTARG^^}"
@@ -751,6 +776,9 @@ service_parse_args() {
m)
export SERVICE_MEMORY=$OPTARG
;;
n)
export SERVICE_RESTART_APPS=false
;;
N)
export SERVICE_INITIAL_NETWORK=$OPTARG
;;
@@ -805,39 +833,36 @@ service_root_password() {
service_port_expose() {
declare desc="wrapper for exposing service ports"
declare SERVICE="$1"
service_start "$SERVICE" "true"
service_port_unpause "$SERVICE" "true" "${@:2}"
}
service_port_pause() {
declare desc="pause service exposure"
declare SERVICE="$1" LOG_FAIL="$2"
declare SERVICE="$1" PORTS=(${@:2})
local SERVICE_ROOT="$PLUGIN_DATA_ROOT/$SERVICE"
local EXPOSED_NAME="$(get_service_name "$SERVICE").ambassador"
local PORT_FILE="$SERVICE_ROOT/PORT"
local SERVICE_NAME="$(get_service_name "$SERVICE")"
local EXPOSED_NAME="$SERVICE_NAME.ambassador"
if [[ "$LOG_FAIL" == "true" ]]; then
[[ ! -f "$PORT_FILE" ]] && dokku_log_fail "Service not exposed"
else
[[ ! -f "$PORT_FILE" ]] && return 0
if [[ ${#PORTS[@]} -eq 0 ]]; then
# shellcheck disable=SC2206
PORTS=(${PORTS[@]:-$(get_random_ports ${#PLUGIN_DATASTORE_PORTS[@]})})
fi
local GREP_NAME="^/${EXPOSED_NAME}$"
local CONTAINER_NAME="$("$DOCKER_BIN" container ps -f name="$GREP_NAME" --format "{{.Names}}")"
if [[ -z "$CONTAINER_NAME" ]]; then
if [[ "$LOG_FAIL" == "true" ]]; then
dokku_log_info1 "Service $SERVICE unexposed"
fi
[[ "${#PORTS[@]}" != "${#PLUGIN_DATASTORE_PORTS[@]}" ]] && dokku_log_fail "${#PLUGIN_DATASTORE_PORTS[@]} ports to be exposed need to be provided in the following order: ${PLUGIN_DATASTORE_PORTS[*]}"
return
if [[ -s "$PORT_FILE" ]]; then
# shellcheck disable=SC2207
PORTS=($(cat "$PORT_FILE"))
dokku_log_fail "Service $SERVICE already exposed on port(s) ${PORTS[*]}"
fi
"$DOCKER_BIN" container stop "$EXPOSED_NAME" >/dev/null 2>&1 || true
"$DOCKER_BIN" container rm "$EXPOSED_NAME" >/dev/null 2>&1 || true
if [[ "$LOG_FAIL" == "true" ]]; then
dokku_log_info1 "Service $SERVICE unexposed"
if "$DOCKER_BIN" container inspect "$EXPOSED_NAME" >/dev/null 2>&1; then
dokku_log_warn "Service $SERVICE has an untracked expose container, removing"
"$DOCKER_BIN" container stop "$EXPOSED_NAME" >/dev/null 2>&1 || true
suppress_output "$DOCKER_BIN" container rm "$EXPOSED_NAME"
fi
echo "${PORTS[@]}" >"$PORT_FILE"
service_start "$SERVICE" "true"
service_port_reconcile_status "$SERVICE"
dokku_log_info1 "Service $SERVICE exposed on port(s) [container->host]: $(service_exposed_ports "$SERVICE")"
}
service_port_unexpose() {
@@ -845,39 +870,41 @@ service_port_unexpose() {
declare SERVICE="$1"
local SERVICE_ROOT="$PLUGIN_DATA_ROOT/$SERVICE"
local PORT_FILE="$SERVICE_ROOT/PORT"
service_port_pause "$SERVICE" "true"
rm -rf "$PORT_FILE"
service_port_reconcile_status "$SERVICE"
dokku_log_info1 "Service $SERVICE unexposed"
}
service_port_unpause() {
declare desc="start service exposure"
declare SERVICE="$1" LOG_FAIL="$2"
service_port_reconcile_status() {
declare SERVICE="$1"
local SERVICE_ROOT="$PLUGIN_DATA_ROOT/$SERVICE"
local SERVICE_NAME="$(get_service_name "$SERVICE")"
local EXPOSED_NAME="${SERVICE_NAME}.ambassador"
local PORT_FILE="$SERVICE_ROOT/PORT"
# shellcheck disable=SC2068
local PORTS=(${@:3})
# shellcheck disable=SC2068
PORTS=(${PORTS[@]:-$(get_random_ports ${#PLUGIN_DATASTORE_PORTS[@]})})
local ID=$(cat "$SERVICE_ROOT/ID")
local SERVICE_NAME="$(get_service_name "$SERVICE")"
local EXPOSED_NAME="$SERVICE_NAME.ambassador"
[[ "${#PORTS[@]}" != "${#PLUGIN_DATASTORE_PORTS[@]}" ]] && dokku_log_fail "${#PLUGIN_DATASTORE_PORTS[@]} ports to be exposed need to be provided in the following order: ${PLUGIN_DATASTORE_PORTS[*]}"
if [[ "$LOG_FAIL" == "true" ]]; then
[[ -f "$PORT_FILE" ]] && PORTS=($(cat "$PORT_FILE")) && dokku_log_fail "Service $SERVICE already exposed on port(s) ${PORTS[*]}"
else
[[ ! -f "$PORT_FILE" ]] && return 0
PORTS=($(cat "$PORT_FILE"))
if [[ ! -s "$PORT_FILE" ]]; then
if "$DOCKER_BIN" container inspect "$EXPOSED_NAME" >/dev/null 2>&1; then
"$DOCKER_BIN" container stop "$EXPOSED_NAME" >/dev/null 2>&1 || true
suppress_output "$DOCKER_BIN" container rm "$EXPOSED_NAME"
return $?
fi
return
fi
echo "${PORTS[@]}" >"$PORT_FILE"
if is_container_status "$EXPOSED_NAME" "Running"; then
return
fi
if "$DOCKER_BIN" container inspect "$EXPOSED_NAME" >/dev/null 2>&1; then
suppress_output "$DOCKER_BIN" container start "$EXPOSED_NAME"
return $?
fi
# shellcheck disable=SC2207
PORTS=($(cat "$PORT_FILE"))
# shellcheck disable=SC2046
"$DOCKER_BIN" container run -d --link "$SERVICE_NAME:$PLUGIN_COMMAND_PREFIX" --name "$EXPOSED_NAME" $(docker_ports_options "${PORTS[@]}") --restart always --label dokku=ambassador --label "dokku.ambassador=$PLUGIN_COMMAND_PREFIX" "$PLUGIN_AMBASSADOR_IMAGE" >/dev/null
if [[ "$LOG_FAIL" == "true" ]]; then
dokku_log_info1 "Service $SERVICE exposed on port(s) [container->host]: $(service_exposed_ports "$SERVICE")"
fi
}
service_promote() {
@@ -935,13 +962,15 @@ service_pause() {
declare SERVICE="$1"
local SERVICE_ROOT="$PLUGIN_DATA_ROOT/$SERVICE"
local SERVICE_NAME="$(get_service_name "$SERVICE")"
local ID=$("$DOCKER_BIN" container ps -aq --no-trunc --filter "name=^/$SERVICE_NAME$" --format '{{ .ID }}') || true
local ID=$("$DOCKER_BIN" container ps -aq --no-trunc --filter "name=^/$SERVICE_NAME$") || true
[[ -z $ID ]] && dokku_log_warn "Service is already paused" && return 0
if [[ -n $ID ]]; then
dokku_log_info2_quiet "Pausing container"
"$DOCKER_BIN" container stop "$SERVICE_NAME" >/dev/null
service_port_pause "$SERVICE"
if "$DOCKER_BIN" container inspect "$ID" >/dev/null 2>&1; then
"$DOCKER_BIN" container stop "$SERVICE_NAME.ambassador" >/dev/null 2>&1 || true
fi
dokku_log_verbose_quiet "Container paused"
else
dokku_log_verbose_quiet "No container exists for $SERVICE"
@@ -971,8 +1000,9 @@ service_unlink() {
[[ -z ${LINK[*]} ]] && dokku_log_fail "Not linked to app $APP"
plugn trigger service-action post-unlink "$PLUGIN_COMMAND_PREFIX" "$SERVICE" "$APP"
if [[ "$DOKKU_GLOBAL_FLAGS" == *"--no-restart"* ]]; then
if [[ "$DOKKU_GLOBAL_FLAGS" == *"--no-restart"* ]] || [[ "$SERVICE_RESTART_APPS" == "false" ]]; then
config_unset --no-restart "$APP" "${LINK[@]}"
dokku_log_verbose "Skipping restart of linked app"
else
config_unset "$APP" "${LINK[@]}"
fi

8
config
View File

@@ -28,9 +28,9 @@ if [[ -n $DOKKU_API_VERSION ]]; then
export PLUGIN_BASE_PATH="$PLUGIN_ENABLED_PATH"
fi
export PLUGIN_BUSYBOX_IMAGE="busybox:1.34.1-uclibc"
export PLUGIN_AMBASSADOR_IMAGE="dokku/ambassador:0.5.0"
export PLUGIN_S3BACKUP_IMAGE="dokku/s3backup:0.14.0"
export PLUGIN_WAIT_IMAGE="dokku/wait:0.6.0"
export PLUGIN_BUSYBOX_IMAGE=${PLUGIN_BUSYBOX_IMAGE:=busybox:1.37.0-uclibc}
export PLUGIN_AMBASSADOR_IMAGE=${PLUGIN_AMBASSADOR_IMAGE:=dokku/ambassador:0.8.2}
export PLUGIN_S3BACKUP_IMAGE=${PLUGIN_S3BACKUP_IMAGE:=dokku/s3backup:0.18.0}
export PLUGIN_WAIT_IMAGE=${PLUGIN_WAIT_IMAGE:=dokku/wait:0.9.3}
export REDIS_CONFIG_OPTIONS=${REDIS_CONFIG_OPTIONS:=""}

View File

@@ -47,10 +47,12 @@ service_create() {
mkdir -p "$SERVICE_ROOT/$PLUGIN_CONFIG_SUFFIX" || dokku_log_fail "Unable to create service config directory"
touch "$LINKS_FILE"
REDIS_SERVICE_CONFIG="$SERVICE_ROOT/$PLUGIN_CONFIG_SUFFIX/redis.conf"
if [[ -z $REDIS_CONFIG_PATH ]]; then
curl -sSL "https://raw.githubusercontent.com/antirez/redis/${PLUGIN_IMAGE_VERSION:0:3}/redis.conf" >"$SERVICE_ROOT/$PLUGIN_CONFIG_SUFFIX/redis.conf" || dokku_log_fail "Unable to download the default redis.conf to the config directory"
echo "# requirepass" > $REDIS_SERVICE_CONFIG
else
cp "$REDIS_CONFIG_PATH" "$SERVICE_ROOT/$PLUGIN_CONFIG_SUFFIX/redis.conf" || dokku_log_fail "Unable to copy the ${REDIS_CONFIG_PATH} to the config directory"
cp "$REDIS_CONFIG_PATH" "$REDIS_SERVICE_CONFIG" || dokku_log_fail "Unable to copy the ${REDIS_CONFIG_PATH} to the config directory"
fi
PASSWORD=$(openssl rand -hex 32)
if [[ -n "$SERVICE_PASSWORD" ]]; then
@@ -59,7 +61,7 @@ service_create() {
fi
echo "$PASSWORD" >"$SERVICE_ROOT/PASSWORD"
chmod 640 "$SERVICE_ROOT/PASSWORD"
sed -i.bak "s/# requirepass.*/requirepass ${PASSWORD}/" "$SERVICE_ROOT/$PLUGIN_CONFIG_SUFFIX/redis.conf" && rm "$SERVICE_ROOT/$PLUGIN_CONFIG_SUFFIX/redis.conf.bak"
sed -i.bak "s/# requirepass.*/requirepass ${PASSWORD}/" "$REDIS_SERVICE_CONFIG" && rm "$SERVICE_ROOT/$PLUGIN_CONFIG_SUFFIX/redis.conf.bak"
service_commit_config "$SERVICE"
write_database_name "$SERVICE"
@@ -130,6 +132,8 @@ service_create_container() {
done < <(fn-plugin-property-get "$PLUGIN_COMMAND_PREFIX" "$SERVICE" "post-create-network" | tr "," "\n")
fi
suppress_output "$DOCKER_BIN" container start "$(cat "$SERVICE_ROOT/ID")"
service_port_reconcile_status "$SERVICE"
if [[ -n "$(fn-plugin-property-get "$PLUGIN_COMMAND_PREFIX" "$SERVICE" "post-start-network")" ]]; then
dokku_log_verbose_quiet "Connecting to networks after container start"
while read -r line || [[ -n "$line" ]]; do
@@ -182,7 +186,7 @@ service_import() {
fi
suppress_output service_container_rm "$SERVICE"
"$DOCKER_BIN" container run --rm -v "$SERVICE_HOST_ROOT/data:/data" "$PLUGIN_IMAGE:$PLUGIN_IMAGE_VERSION" bash -c "rm -f /data/dump.rdb"
cat > "$SERVICE_HOST_ROOT/data/dump.rdb"
cat >"$SERVICE_HOST_ROOT/data/dump.rdb"
"$DOCKER_BIN" container run --rm -v "$SERVICE_HOST_ROOT/data:/data" "$PLUGIN_IMAGE:$PLUGIN_IMAGE_VERSION" bash -c "chown redis: /data/dump.rdb"
suppress_output service_start "$SERVICE"
}
@@ -192,7 +196,7 @@ service_start() {
local QUIET="$2"
local SERVICE_ROOT="$PLUGIN_DATA_ROOT/$SERVICE"
local SERVICE_NAME="$(get_service_name "$SERVICE")"
local ID=$("$DOCKER_BIN" container ps -aq --no-trunc --filter "status=running" --filter "name=^/$SERVICE_NAME$" --format '{{ .ID }}') || true
local ID=$("$DOCKER_BIN" container ps -aq --no-trunc --filter "status=running" --filter "name=^/$SERVICE_NAME$") || true
if [[ -n $ID ]]; then
[[ -z $QUIET ]] && dokku_log_warn "Service is already started"
if [[ ! -f "$SERVICE_ROOT/ID" ]] || [[ "$(cat "$SERVICE_ROOT/ID")" != "$ID" ]]; then
@@ -203,11 +207,11 @@ service_start() {
fi
dokku_log_info2_quiet "Starting container"
local PREVIOUS_ID=$("$DOCKER_BIN" container ps -aq --no-trunc --filter "status=exited" --filter "name=^/$SERVICE_NAME$" --format '{{ .ID }}') || true
local PREVIOUS_ID=$("$DOCKER_BIN" container ps -aq --no-trunc --filter "status=exited" --filter "name=^/$SERVICE_NAME$") || true
if [[ -n $PREVIOUS_ID ]]; then
"$DOCKER_BIN" container start "$PREVIOUS_ID" >/dev/null
service_port_unpause "$SERVICE"
service_port_reconcile_status "$SERVICE"
dokku_log_info2 "Container started"
elif service_image_exists "$SERVICE"; then
service_create_container "$SERVICE"

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku redis service plugin"
version = "1.29.0"
version = "1.40.1"
[plugin.config]

View File

@@ -0,0 +1,25 @@
#!/usr/bin/env bash
source "$(dirname "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)")/config"
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$(dirname "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)")/functions"
service-backup-set-public-key-encryption-cmd() {
#E set the GPG Public Key for encrypting backups
#E dokku $PLUGIN_COMMAND_PREFIX:backup-set-public-key-encryption lollipop
#A service, service to run command against
#A public-key-id, a GPG Public Key ID (or fingerprint) to use for encryption. Must be uploaded to the GPG keyserver beforehand.
declare desc="set GPG Public Key encryption for all future backups of $PLUGIN_SERVICE service"
local cmd="$PLUGIN_COMMAND_PREFIX:backup-set-public-key-encryption" argv=("$@")
[[ ${argv[0]} == "$cmd" ]] && shift 1
declare SERVICE="$1" PUBLIC_KEY_ID="$2"
is_implemented_command "$cmd" || dokku_log_fail "Not yet implemented"
[[ -z "$SERVICE" ]] && dokku_log_fail "Please specify a valid name for the service"
[[ -z "$PUBLIC_KEY_ID" ]] && dokku_log_fail "Please specify a valid GPG Public Key ID (or fingerprint)"
verify_service_name "$SERVICE"
service_backup_set_public_key_encryption "$SERVICE" "$PUBLIC_KEY_ID"
}
service-backup-set-public-key-encryption-cmd "$@"

View File

@@ -0,0 +1,23 @@
#!/usr/bin/env bash
source "$(dirname "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)")/config"
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$(dirname "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)")/functions"
service-backup-unset-public-key-encryption-cmd() {
#E unset the GPG Public Key encryption for backups
#E dokku $PLUGIN_COMMAND_PREFIX:backup-unset-public-key-encryption lollipop
#A service, service to run command against
declare desc="unset GPG Public Key encryption for future backups of the $PLUGIN_SERVICE service"
local cmd="$PLUGIN_COMMAND_PREFIX:backup-unset-public-key-encryption" argv=("$@")
[[ ${argv[0]} == "$cmd" ]] && shift 1
declare SERVICE="$1"
is_implemented_command "$cmd" || dokku_log_fail "Not yet implemented" # TODO: [22.03.2024 by Mykola]
[[ -z "$SERVICE" ]] && dokku_log_fail "Please specify a valid name for the service"
verify_service_name "$SERVICE"
service_backup_unset_public_key_encryption "$SERVICE" # TODO: [22.03.2024 by Mykola]
}
service-backup-unset-encryption-cmd "$@"

View File

@@ -17,9 +17,9 @@ service-clone-cmd() {
#F -m|--memory MEMORY, container memory limit in megabytes (default: unlimited)
#F -N|--initial-network INITIAL_NETWORK, the initial network to attach the service to
#F -p|--password PASSWORD, override the user-level service password
#F -P|--post-create-network NETWORKS, a comman-separated list of networks to attach the service container to after service creation
#F -P|--post-create-network NETWORKS, a comma-separated list of networks to attach the service container to after service creation
#F -r|--root-password PASSWORD, override the root-level service password
#F -S|--post-start-network NETWORKS, a comman-separated list of networks to attach the service container to after service start
#F -S|--post-start-network NETWORKS, a comma-separated list of networks to attach the service container to after service start
#F -s|--shm-size SHM_SIZE, override shared memory size for $PLUGIN_COMMAND_PREFIX docker container
declare desc="create container <new-name> then copy data from <name> into <new-name>"
local cmd="$PLUGIN_COMMAND_PREFIX:clone" argv=("$@")

View File

@@ -14,7 +14,7 @@ service-create-cmd() {
#E export ${PLUGIN_VARIABLE}_IMAGE_VERSION="${PLUGIN_IMAGE_VERSION}"
#E dokku $PLUGIN_COMMAND_PREFIX:create lollipop
#E you can also specify custom environment variables to start
#E the ${PLUGIN_COMMAND_PREFIX} service in semi-colon separated form.
#E the ${PLUGIN_COMMAND_PREFIX} service in semicolon-separated form.
#E export ${PLUGIN_VARIABLE}_CUSTOM_ENV="USER=alpha;HOST=beta"
#E dokku $PLUGIN_COMMAND_PREFIX:create lollipop
#A service, service to run command against
@@ -25,9 +25,9 @@ service-create-cmd() {
#F -m|--memory MEMORY, container memory limit in megabytes (default: unlimited)
#F -N|--initial-network INITIAL_NETWORK, the initial network to attach the service to
#F -p|--password PASSWORD, override the user-level service password
#F -P|--post-create-network NETWORKS, a comman-separated list of networks to attach the service container to after service creation
#F -P|--post-create-network NETWORKS, a comma-separated list of networks to attach the service container to after service creation
#F -r|--root-password PASSWORD, override the root-level service password
#F -S|--post-start-network NETWORKS, a comman-separated list of networks to attach the service container to after service start
#F -S|--post-start-network NETWORKS, a comma-separated list of networks to attach the service container to after service start
#F -s|--shm-size SHM_SIZE, override shared memory size for $PLUGIN_COMMAND_PREFIX docker container
declare desc="create a $PLUGIN_SERVICE service"
local cmd="$PLUGIN_COMMAND_PREFIX:create" argv=("$@")

View File

@@ -8,7 +8,7 @@ source "$(dirname "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)")/functions"
service-expose-cmd() {
#E expose the service on the service's normal ports, allowing access to it from the public interface (0.0.0.0)
#E dokku $PLUGIN_COMMAND_PREFIX:expose lollipop ${PLUGIN_DATASTORE_PORTS[@]}
#E expose the service on the service's normal ports, with the first on a specified ip adddress (127.0.0.1)
#E expose the service on the service's normal ports, with the first on a specified ip address (127.0.0.1)
#E dokku $PLUGIN_COMMAND_PREFIX:expose lollipop 127.0.0.1:${PLUGIN_DATASTORE_PORTS[@]}
#A service, service to run command against
#A ports, a list of ports to run against

View File

@@ -42,6 +42,7 @@ service-link-cmd() {
#A app, app to run command against
#F -a|--alias "BLUE_DATABASE", an alternative alias to use for linking to an app via environment variable
#F -q|--querystring "pool=5", ampersand delimited querystring arguments to append to the service link
#F -n|--no-restart "false", whether or not to restart the app on link (default: true)
declare desc="link the $PLUGIN_SERVICE service to the app"
local cmd="$PLUGIN_COMMAND_PREFIX:link" argv=("$@")
[[ ${argv[0]} == "$cmd" ]] && shift 1

View File

@@ -11,6 +11,7 @@ service-unlink-cmd() {
#E dokku $PLUGIN_COMMAND_PREFIX:unlink lollipop playground
#A service, service to run command against
#A app, app to run command against
#F -n|--no-restart "false", whether or not to restart the app on unlink (default: true)
declare desc="unlink the $PLUGIN_SERVICE service from the app"
local cmd="$PLUGIN_COMMAND_PREFIX:unlink" argv=("$@")
[[ ${argv[0]} == "$cmd" ]] && shift 1

View File

@@ -15,9 +15,9 @@ service-upgrade-cmd() {
#F -i|--image IMAGE, the image name to start the service with
#F -I|--image-version IMAGE_VERSION, the image version to start the service with
#F -N|--initial-network INITIAL_NETWORK, the initial network to attach the service to
#F -P|--post-create-network NETWORKS, a comman-separated list of networks to attach the service container to after service creation
#F -R|--restart-apps "true", whether to force an app restart
#F -S|--post-start-network NETWORKS, a comman-separated list of networks to attach the service container to after service start
#F -P|--post-create-network NETWORKS, a comma-separated list of networks to attach the service container to after service creation
#F -R|--restart-apps "true", whether or not to force an app restart (default: false)
#F -S|--post-start-network NETWORKS, a comma-separated list of networks to attach the service container to after service start
#F -s|--shm-size SHM_SIZE, override shared memory size for $PLUGIN_COMMAND_PREFIX docker container
declare desc="upgrade service <service> to the specified versions"
local cmd="$PLUGIN_COMMAND_PREFIX:upgrade" argv=("$@")

View File

@@ -48,7 +48,7 @@ teardown() {
assert_output_contains bridge 0
assert_output_contains custom-network
run docker inspect dokku.$PLUGIN_COMMAND_PREFIX.ls -f '{{range $net,$v := .NetworkSettings.Networks}}{{range $k,$alias := $v.Aliases}}{{printf "alias:%s\n" $alias}}{{end}}{{end}}'
run docker inspect dokku.$PLUGIN_COMMAND_PREFIX.ls -f '{{range $net,$v := .NetworkSettings.Networks}}{{range $k,$alias := $v.DNSNames}}{{printf "alias:%s\n" $alias}}{{end}}{{end}}'
echo "output: $output"
echo "status: $status"
assert_success
@@ -120,7 +120,7 @@ teardown() {
assert_output_contains custom-network
assert_output_contains bridge
run docker inspect dokku.$PLUGIN_COMMAND_PREFIX.ls -f '{{range $net,$v := .NetworkSettings.Networks}}{{range $k,$alias := $v.Aliases}}{{printf "alias:%s\n" $alias}}{{end}}{{end}}'
run docker inspect dokku.$PLUGIN_COMMAND_PREFIX.ls -f '{{range $net,$v := .NetworkSettings.Networks}}{{range $k,$alias := $v.DNSNames}}{{printf "alias:%s\n" $alias}}{{end}}{{end}}'
echo "output: $output"
echo "status: $status"
assert_success
@@ -192,7 +192,7 @@ teardown() {
assert_output_contains bridge
assert_output_contains custom-network
run docker inspect dokku.$PLUGIN_COMMAND_PREFIX.ls -f '{{range $net,$v := .NetworkSettings.Networks}}{{range $k,$alias := $v.Aliases}}{{printf "alias:%s\n" $alias}}{{end}}{{end}}'
run docker inspect dokku.$PLUGIN_COMMAND_PREFIX.ls -f '{{range $net,$v := .NetworkSettings.Networks}}{{range $k,$alias := $v.DNSNames}}{{printf "alias:%s\n" $alias}}{{end}}{{end}}'
echo "output: $output"
echo "status: $status"
assert_success
@@ -258,7 +258,7 @@ teardown() {
assert_output_contains bridge
assert_output_contains custom-network
run docker inspect dokku.$PLUGIN_COMMAND_PREFIX.lsa -f '{{range $net,$v := .NetworkSettings.Networks}}{{range $k,$alias := $v.Aliases}}{{printf "alias:%s\n" $alias}}{{end}}{{end}}'
run docker inspect dokku.$PLUGIN_COMMAND_PREFIX.lsa -f '{{range $net,$v := .NetworkSettings.Networks}}{{range $k,$alias := $v.DNSNames}}{{printf "alias:%s\n" $alias}}{{end}}{{end}}'
echo "output: $output"
echo "status: $status"
assert_success

View File

@@ -2,29 +2,65 @@
load test_helper
setup() {
dokku "$PLUGIN_COMMAND_PREFIX:create" l
dokku "$PLUGIN_COMMAND_PREFIX:create" ls
}
teardown() {
dokku --force "$PLUGIN_COMMAND_PREFIX:destroy" l
dokku --force "$PLUGIN_COMMAND_PREFIX:destroy" ls
}
@test "($PLUGIN_COMMAND_PREFIX:expose) error when there are no arguments" {
run dokku "$PLUGIN_COMMAND_PREFIX:expose"
echo "output: $output"
echo "status: $status"
assert_failure
assert_contains "${lines[*]}" "Please specify a valid name for the service"
}
@test "($PLUGIN_COMMAND_PREFIX:expose) error when service does not exist" {
run dokku "$PLUGIN_COMMAND_PREFIX:expose" not_existing_service
echo "output: $output"
echo "status: $status"
assert_failure
assert_contains "${lines[*]}" "service not_existing_service does not exist"
}
@test "($PLUGIN_COMMAND_PREFIX:expose) error when already exposed" {
run dokku "$PLUGIN_COMMAND_PREFIX:expose" ls
echo "output: $output"
echo "status: $status"
assert_success
run dokku "$PLUGIN_COMMAND_PREFIX:expose" ls
echo "output: $output"
echo "status: $status"
assert_failure
assert_contains "${lines[*]}" "Service ls already exposed on port(s)"
run sudo rm "$PLUGIN_DATA_ROOT/ls/PORT"
echo "output: $output"
echo "status: $status"
assert_success
run dokku "$PLUGIN_COMMAND_PREFIX:expose" ls
echo "output: $output"
echo "status: $status"
assert_success
assert_contains "${lines[*]}" "Service ls has an untracked expose container, removing"
}
@test "($PLUGIN_COMMAND_PREFIX:expose) success when not providing custom ports" {
run dokku "$PLUGIN_COMMAND_PREFIX:expose" l
run dokku "$PLUGIN_COMMAND_PREFIX:expose" ls
echo "output: $output"
echo "status: $status"
assert_success
[[ "${lines[*]}" =~ exposed\ on\ port\(s\)\ \[container\-\>host\]\:\ [[:digit:]]+ ]]
}
@test "($PLUGIN_COMMAND_PREFIX:expose) success when providing custom ports" {
run dokku "$PLUGIN_COMMAND_PREFIX:expose" l 4242
run dokku "$PLUGIN_COMMAND_PREFIX:expose" ls 4242
echo "output: $output"
echo "status: $status"
assert_success
assert_contains "${lines[*]}" "exposed on port(s) [container->host]: 6379->4242"
}

View File

@@ -2,14 +2,14 @@
load test_helper
setup() {
dokku "$PLUGIN_COMMAND_PREFIX:create" l
dokku "$PLUGIN_COMMAND_PREFIX:create" m
dokku "$PLUGIN_COMMAND_PREFIX:create" ls
dokku "$PLUGIN_COMMAND_PREFIX:create" ms
dokku apps:create my-app
}
teardown() {
dokku --force "$PLUGIN_COMMAND_PREFIX:destroy" m
dokku --force "$PLUGIN_COMMAND_PREFIX:destroy" l
dokku --force "$PLUGIN_COMMAND_PREFIX:destroy" ms
dokku --force "$PLUGIN_COMMAND_PREFIX:destroy" ls
dokku --force apps:destroy my-app
}
@@ -22,7 +22,7 @@ teardown() {
}
@test "($PLUGIN_COMMAND_PREFIX:link) error when the app argument is missing" {
run dokku "$PLUGIN_COMMAND_PREFIX:link" l
run dokku "$PLUGIN_COMMAND_PREFIX:link" ls
echo "output: $output"
echo "status: $status"
assert_contains "${lines[*]}" "Please specify an app to run the command on"
@@ -30,7 +30,7 @@ teardown() {
}
@test "($PLUGIN_COMMAND_PREFIX:link) error when the app does not exist" {
run dokku "$PLUGIN_COMMAND_PREFIX:link" l not_existing_app
run dokku "$PLUGIN_COMMAND_PREFIX:link" ls not_existing_app
echo "output: $output"
echo "status: $status"
assert_contains "${lines[*]}" "App not_existing_app does not exist"
@@ -46,73 +46,97 @@ teardown() {
}
@test "($PLUGIN_COMMAND_PREFIX:link) error when the service is already linked to app" {
dokku "$PLUGIN_COMMAND_PREFIX:link" l my-app
run dokku "$PLUGIN_COMMAND_PREFIX:link" l my-app
dokku "$PLUGIN_COMMAND_PREFIX:link" ls my-app
run dokku "$PLUGIN_COMMAND_PREFIX:link" ls my-app
echo "output: $output"
echo "status: $status"
assert_contains "${lines[*]}" "Already linked as REDIS_URL"
assert_failure
dokku "$PLUGIN_COMMAND_PREFIX:unlink" l my-app
dokku "$PLUGIN_COMMAND_PREFIX:unlink" ls my-app
}
@test "($PLUGIN_COMMAND_PREFIX:link) exports REDIS_URL to app" {
run dokku "$PLUGIN_COMMAND_PREFIX:link" l my-app
run dokku "$PLUGIN_COMMAND_PREFIX:link" ls my-app
echo "output: $output"
echo "status: $status"
url=$(dokku config:get my-app REDIS_URL)
password="$(sudo cat "$PLUGIN_DATA_ROOT/l/PASSWORD")"
assert_contains "$url" "redis://:$password@dokku-redis-l:6379"
password="$(sudo cat "$PLUGIN_DATA_ROOT/ls/PASSWORD")"
assert_contains "$url" "redis://:$password@dokku-redis-ls:6379"
assert_success
dokku "$PLUGIN_COMMAND_PREFIX:unlink" l my-app
dokku "$PLUGIN_COMMAND_PREFIX:unlink" ls my-app
}
@test "($PLUGIN_COMMAND_PREFIX:link) generates an alternate config url when REDIS_URL already in use" {
dokku config:set my-app REDIS_URL=redis://host:6379
dokku "$PLUGIN_COMMAND_PREFIX:link" l my-app
dokku "$PLUGIN_COMMAND_PREFIX:link" ls my-app
run dokku config my-app
assert_contains "${lines[*]}" "DOKKU_REDIS_AQUA_URL"
assert_success
dokku "$PLUGIN_COMMAND_PREFIX:link" m my-app
dokku "$PLUGIN_COMMAND_PREFIX:link" ms my-app
run dokku config my-app
assert_contains "${lines[*]}" "DOKKU_REDIS_BLACK_URL"
assert_success
dokku "$PLUGIN_COMMAND_PREFIX:unlink" m my-app
dokku "$PLUGIN_COMMAND_PREFIX:unlink" l my-app
dokku "$PLUGIN_COMMAND_PREFIX:unlink" ms my-app
dokku "$PLUGIN_COMMAND_PREFIX:unlink" ls my-app
}
@test "($PLUGIN_COMMAND_PREFIX:link) links to app with docker-options" {
dokku "$PLUGIN_COMMAND_PREFIX:link" l my-app
dokku "$PLUGIN_COMMAND_PREFIX:link" ls my-app
run dokku docker-options:report my-app
assert_contains "${lines[*]}" "--link dokku.redis.l:dokku-redis-l"
assert_contains "${lines[*]}" "--link dokku.redis.ls:dokku-redis-ls"
assert_success
dokku "$PLUGIN_COMMAND_PREFIX:unlink" l my-app
dokku "$PLUGIN_COMMAND_PREFIX:unlink" ls my-app
}
@test "($PLUGIN_COMMAND_PREFIX:link) uses apps REDIS_DATABASE_SCHEME variable" {
dokku config:set my-app REDIS_DATABASE_SCHEME=redis2
dokku "$PLUGIN_COMMAND_PREFIX:link" l my-app
dokku "$PLUGIN_COMMAND_PREFIX:link" ls my-app
url=$(dokku config:get my-app REDIS_URL)
password="$(sudo cat "$PLUGIN_DATA_ROOT/l/PASSWORD")"
assert_contains "$url" "redis2://:$password@dokku-redis-l:6379"
password="$(sudo cat "$PLUGIN_DATA_ROOT/ls/PASSWORD")"
assert_contains "$url" "redis2://:$password@dokku-redis-ls:6379"
assert_success
dokku "$PLUGIN_COMMAND_PREFIX:unlink" l my-app
dokku "$PLUGIN_COMMAND_PREFIX:unlink" ls my-app
}
@test "($PLUGIN_COMMAND_PREFIX:link) adds a querystring" {
dokku "$PLUGIN_COMMAND_PREFIX:link" l my-app --querystring "pool=5"
dokku "$PLUGIN_COMMAND_PREFIX:link" ls my-app --querystring "pool=5"
url=$(dokku config:get my-app REDIS_URL)
assert_contains "$url" "?pool=5"
assert_success
dokku "$PLUGIN_COMMAND_PREFIX:unlink" l my-app
dokku "$PLUGIN_COMMAND_PREFIX:unlink" ls my-app
}
@test "($PLUGIN_COMMAND_PREFIX:link) uses a specified config url when alias is specified" {
dokku "$PLUGIN_COMMAND_PREFIX:link" l my-app --alias "ALIAS"
dokku "$PLUGIN_COMMAND_PREFIX:link" ls my-app --alias "ALIAS"
url=$(dokku config:get my-app ALIAS_URL)
password="$(sudo cat "$PLUGIN_DATA_ROOT/l/PASSWORD")"
assert_contains "$url" "redis://:$password@dokku-redis-l:6379"
password="$(sudo cat "$PLUGIN_DATA_ROOT/ls/PASSWORD")"
assert_contains "$url" "redis://:$password@dokku-redis-ls:6379"
assert_success
dokku "$PLUGIN_COMMAND_PREFIX:unlink" ls my-app
}
@test "($PLUGIN_COMMAND_PREFIX:link) respects --no-restart" {
run dokku "$PLUGIN_COMMAND_PREFIX:link" ls my-app
echo "output: $output"
echo "status: $status"
assert_output_contains "Skipping restart of linked app" 0
assert_success
run dokku "$PLUGIN_COMMAND_PREFIX:unlink" ls my-app
echo "output: $output"
echo "status: $status"
assert_success
run dokku "$PLUGIN_COMMAND_PREFIX:link" ls my-app --no-restart
echo "output: $output"
echo "status: $status"
assert_output_contains "Skipping restart of linked app"
assert_success
run dokku "$PLUGIN_COMMAND_PREFIX:unlink" ls my-app
echo "output: $output"
echo "status: $status"
assert_success
dokku "$PLUGIN_COMMAND_PREFIX:unlink" l my-app
}

View File

@@ -3,11 +3,11 @@ load test_helper
setup() {
dokku apps:create my-app
dokku "$PLUGIN_COMMAND_PREFIX:create" l
dokku "$PLUGIN_COMMAND_PREFIX:create" ls
}
teardown() {
dokku --force "$PLUGIN_COMMAND_PREFIX:destroy" l
dokku --force "$PLUGIN_COMMAND_PREFIX:destroy" ls
dokku --force apps:destroy my-app
}
@@ -17,12 +17,12 @@ teardown() {
}
@test "($PLUGIN_COMMAND_PREFIX:unlink) error when the app argument is missing" {
run dokku "$PLUGIN_COMMAND_PREFIX:unlink" l
run dokku "$PLUGIN_COMMAND_PREFIX:unlink" ls
assert_contains "${lines[*]}" "Please specify an app to run the command on"
}
@test "($PLUGIN_COMMAND_PREFIX:unlink) error when the app does not exist" {
run dokku "$PLUGIN_COMMAND_PREFIX:unlink" l not_existing_app
run dokku "$PLUGIN_COMMAND_PREFIX:unlink" ls not_existing_app
assert_contains "${lines[*]}" "App not_existing_app does not exist"
}
@@ -32,13 +32,13 @@ teardown() {
}
@test "($PLUGIN_COMMAND_PREFIX:unlink) error when service not linked to app" {
run dokku "$PLUGIN_COMMAND_PREFIX:unlink" l my-app
run dokku "$PLUGIN_COMMAND_PREFIX:unlink" ls my-app
assert_contains "${lines[*]}" "Not linked to app my-app"
}
@test "($PLUGIN_COMMAND_PREFIX:unlink) removes link from docker-options" {
dokku "$PLUGIN_COMMAND_PREFIX:link" l my-app >&2
dokku "$PLUGIN_COMMAND_PREFIX:unlink" l my-app
dokku "$PLUGIN_COMMAND_PREFIX:link" ls my-app >&2
dokku "$PLUGIN_COMMAND_PREFIX:unlink" ls my-app
check_value="Docker options build: Docker options deploy: --restart=on-failure:10 Docker options run:"
options=$(dokku --quiet docker-options:report my-app | xargs)
@@ -46,8 +46,32 @@ teardown() {
}
@test "($PLUGIN_COMMAND_PREFIX:unlink) unsets config url from app" {
dokku "$PLUGIN_COMMAND_PREFIX:link" l my-app >&2
dokku "$PLUGIN_COMMAND_PREFIX:unlink" l my-app
dokku "$PLUGIN_COMMAND_PREFIX:link" ls my-app >&2
dokku "$PLUGIN_COMMAND_PREFIX:unlink" ls my-app
config=$(dokku config:get my-app REDIS_URL || true)
assert_equal "$config" ""
}
@test "($PLUGIN_COMMAND_PREFIX:unlink) respects --no-restart" {
run dokku "$PLUGIN_COMMAND_PREFIX:link" ls my-app
echo "output: $output"
echo "status: $status"
assert_success
run dokku "$PLUGIN_COMMAND_PREFIX:unlink" ls my-app
echo "output: $output"
echo "status: $status"
assert_output_contains "Skipping restart of linked app" 0
assert_success
run dokku "$PLUGIN_COMMAND_PREFIX:link" ls my-app
echo "output: $output"
echo "status: $status"
assert_success
run dokku "$PLUGIN_COMMAND_PREFIX:unlink" ls my-app --no-restart
echo "output: $output"
echo "status: $status"
assert_output_contains "Skipping restart of linked app"
assert_success
}

View File

@@ -1,4 +1,5 @@
# SC1090 - Can't follow non-constant source. Use a directive to specify location - https://github.com/koalaman/shellcheck/wiki/SC1090
# SC1091 - Not following - <https://github.com/koalaman/shellcheck/wiki/SC1091>
# SC2034 - Variable appears unused. Verify it or export it - https://github.com/koalaman/shellcheck/wiki/SC2034
# SC2155 - Declare and assign separately to avoid masking return values - https://github.com/koalaman/shellcheck/wiki/SC2155
# SC2206 - Quote to prevent word splitting/globbing, or split robustly with mapfile or read -a - https://github.com/koalaman/shellcheck/wiki/SC2206