Donal McBreen
18f1bbbeac
Merge pull request #1614 from basecamp/dependabot/bundler/bundler-f02c9c4a61
...
Bump the bundler group across 1 directory with 2 updates
2025-08-11 16:05:05 +01:00
Donal McBreen
5dd8eba182
Merge pull request #1611 from flavorjones/flavorjones/remote-builder-check
...
`Builder::Remote.inspect_builder` requires both checks to pass
2025-08-11 11:20:23 +01:00
dependabot[bot]
75754e4b7b
Bump the bundler group across 1 directory with 2 updates
...
Bumps the bundler group with 2 updates in the / directory: [thor](https://github.com/rails/thor ) and [nokogiri](https://github.com/sparklemotion/nokogiri ).
Updates `thor` from 1.3.2 to 1.4.0
- [Release notes](https://github.com/rails/thor/releases )
- [Commits](https://github.com/rails/thor/compare/v1.3.2...v1.4.0 )
Updates `nokogiri` from 1.18.8 to 1.18.9
- [Release notes](https://github.com/sparklemotion/nokogiri/releases )
- [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md )
- [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.18.8...v1.18.9 )
---
updated-dependencies:
- dependency-name: thor
dependency-version: 1.4.0
dependency-type: direct:production
dependency-group: bundler
- dependency-name: nokogiri
dependency-version: 1.18.9
dependency-type: indirect
dependency-group: bundler
...
Signed-off-by: dependabot[bot] <support@github.com >
2025-07-22 04:31:00 +00:00
Mike Dalessio
8e470ed051
Builder::Remote.inspect_builder requires both checks to pass
...
Previously, if either of the builder or the remote context were in a
bad state, the build would proceed anyway and fail.
2025-07-17 15:41:38 -04:00
Donal McBreen
4b88852aea
Merge pull request #1589 from airblade/patch-1
...
Remove obsolete conditional
2025-06-20 15:49:07 +01:00
Andy Stewart
cfaa4fb0db
Remove obsolete conditional
...
This postfix conditional is left over from the refactor in #1584 and is no longer needed.
2025-06-20 10:53:17 +01:00
Donal McBreen
2bcb313590
Fix typo: host -> more
2025-06-19 14:17:16 +01:00
Donal McBreen
3cf510bc8f
Merge pull request #1585 from basecamp/cert-docs
...
Update custom cert docs
2025-06-18 11:57:40 +01:00
Donal McBreen
e61d96d154
Update custom cert docs
...
Remove ssl: ..., reword some of the docs and ensure the formatting is
correct.
2025-06-18 11:13:07 +01:00
Donal McBreen
aa2ceaa92a
Bump version for 2.7.0
2025-06-18 10:27:00 +01:00
Donal McBreen
c3e7721da5
Bump version for
2025-06-18 10:24:55 +01:00
Donal McBreen
0656e02375
Doc update from @acidtib in https://github.com/basecamp/kamal-site/pull/174
2025-06-17 15:42:15 +01:00
Donal McBreen
aed77a78fb
Formatting fixes for docs
2025-06-17 15:34:27 +01:00
Donal McBreen
9244247389
Merge pull request #1584 from basecamp/all-fields-one-password-refactor
...
OnePassword adapter refactor
2025-06-17 11:52:20 +01:00
Donal McBreen
6e517665e8
OnePassword adapter refactor
...
- fix rubocop offenses
- extract fields_map
- no early return
- include fields in error message
2025-06-17 11:37:30 +01:00
Donal McBreen
4b0afdf42b
Merge pull request #1567 from capripot/add_all_fields_one_password_retrieval
...
feat: Add allowing retrieving all fields for an item
2025-06-17 11:22:10 +01:00
Donal McBreen
5aa3f7bd4c
Merge pull request #1583 from basecamp/custom-ssl-per-role
...
Custom certs per role
2025-06-17 11:12:21 +01:00
Donal McBreen
ccbcbbc8c5
Custom certs per role
...
- Upload the cert with `sshkit.upload!`
- Use the role name to create a directory for each role's certs
- Add an integration test for the custom certs
2025-06-17 10:26:57 +01:00
Donal McBreen
8a7260d1e9
Merge pull request #1531 from acidtib/feat/custom-ssl
...
feat: Add support for custom certificates
2025-06-17 09:25:15 +01:00
Donal McBreen
89c56910c9
Merge pull request #1551 from ACPK/kamal-proxy-path-prefix
...
Add support for kamal-proxy's path-prefix
2025-06-16 11:07:23 +01:00
Donal McBreen
52e06c1351
Merge pull request #1570 from nickcoyne/bws-secrets
...
Request Bitwarden Secrets Manager secrets as JSON
2025-06-16 10:59:53 +01:00
Donal McBreen
9bcc953cd6
Stub bws project list correctly
2025-06-16 10:58:57 +01:00
Donal McBreen
e2015b47f9
Merge pull request #1422 from acidtib/feat/secrets-add-passbolt-adapter
...
feat(secrets): add Passbolt adapter
2025-06-16 09:14:07 +01:00
Donal McBreen
23f2bf71f9
Fix rubocop whitespace issues
2025-06-16 09:00:04 +01:00
Donal McBreen
054a85d3c0
Merge pull request #916 from nickhammond/buildpacks
...
Add pack option to the builder options for cloud native buildpacks
2025-06-16 08:57:27 +01:00
Donal McBreen
5a0da160b4
Merge pull request #1440 from ursm/bws
...
Fix Bitwarden Secrets Manager authentication checks
2025-06-16 08:56:24 +01:00
Donal McBreen
72d9fcbaaa
Merge pull request #1579 from basecamp/dependabot/bundler/bundler-b051ec43b1
...
Bump rack from 3.1.14 to 3.1.16 in the bundler group across 1 directory
2025-06-16 07:52:26 +01:00
Donal McBreen
a201a6ca68
Merge pull request #1544 from prullmann/kamal-exec-piping
...
Allow piping into kamal exec #1485
2025-06-16 07:52:03 +01:00
dependabot[bot]
1d81d9ec15
Bump rack from 3.1.14 to 3.1.16 in the bundler group across 1 directory
...
Bumps the bundler group with 1 update in the / directory: [rack](https://github.com/rack/rack ).
Updates `rack` from 3.1.14 to 3.1.16
- [Release notes](https://github.com/rack/rack/releases )
- [Changelog](https://github.com/rack/rack/blob/main/CHANGELOG.md )
- [Commits](https://github.com/rack/rack/compare/v3.1.14...v3.1.16 )
---
updated-dependencies:
- dependency-name: rack
dependency-version: 3.1.16
dependency-type: indirect
dependency-group: bundler
...
Signed-off-by: dependabot[bot] <support@github.com >
2025-06-12 08:05:12 +00:00
Donal McBreen
aa67564dc5
Merge pull request #1543 from basecamp/dependabot/bundler/bundler-457f06d3c7
...
Bump rack-session from 2.0.0 to 2.1.1 in the bundler group across 1 directory
2025-06-12 09:04:24 +01:00
Donal McBreen
fd6ac4f84b
Merge pull request #1539 from miguno/issue-1538
...
Fix: correctly parse git remote origin urls for calling Octokit
2025-06-12 09:04:07 +01:00
Donal McBreen
c8f232b64f
Merge pull request #1541 from polarctos/install-docker-cli-only
...
Install only docker-cli for 30% smaller kamal docker image
2025-06-12 09:03:18 +01:00
Donal McBreen
7f3dd59a73
Merge pull request #1576 from nickhammond/validate-labels
...
Validate destination, role, and service are not set as labels on roles and accessories
2025-06-11 08:13:47 +01:00
Nick Hammond
6672e3e77d
Remove blank line
2025-06-09 19:47:26 -07:00
Nick Hammond
b164d50ff1
Check for label presence in the validation, don't validate labels on simple role setup
2025-06-09 19:36:27 -07:00
Nick Hammond
1d88281fee
Validate that destination, role, and service are not set as labels on roles and accessories
2025-06-09 19:08:20 -07:00
Nick Coyne
a004232ffc
Request secrets as json
2025-06-02 09:06:05 +12:00
Nick Hammond
487aa306c9
Merge branch 'basecamp:main' into buildpacks
2025-05-23 10:59:05 -07:00
capripot
cbf94fa7f5
feat: Add allowing retrieving all fields for an item
...
With 1Password, there is a way to retrieve all fields
of a given item directly without having to enumerate them.
Allowing this when passing no arguments for secrets fetch
command.
2025-05-22 22:21:51 -07:00
Donal McBreen
344e2d7995
Merge pull request #1564 from basecamp/add-kamal-host-var-mop-up
...
KAMAL_HOST env var mop-up
2025-05-20 14:32:57 +01:00
Donal McBreen
b387df0e4f
KAMAL_HOST env var mop-up
...
- Ensure tests pass
- Switch from -e to --env everywhere
- Check KAMAL_HOST env var in integration tests
2025-05-20 14:10:50 +01:00
Donal McBreen
9c8a44eec4
Merge pull request #1471 from jakeprem/jakeprem/add-kamal-host-var
...
feat: Add KAMAL_HOST to app and accessory containers
2025-05-20 13:48:35 +01:00
Dainel Vera
99f763d742
Merge branch 'main' into feat/custom-ssl
2025-05-19 15:38:33 -06:00
Nick Hammond
4bd1f0536c
Merge branch 'basecamp:main' into buildpacks
2025-05-16 15:21:49 -07:00
Donal McBreen
e217332cde
Merge pull request #1561 from basecamp/drop-ruby-3.1
...
Drop Ruby 3.1 from the test matrix
2025-05-15 16:20:32 +01:00
Donal McBreen
30d630ce4d
Drop Ruby 3.1 from the test matrix
...
It is EOL since 2025-03-26.
2025-05-15 15:21:13 +01:00
Donal McBreen
22e7243b10
Bump version for 2.6.1
2025-05-15 15:15:29 +01:00
Donal McBreen
259a018d5a
Merge pull request #1558 from basecamp/per-role-proxy-docs
...
Per role proxy docs
2025-05-15 15:00:11 +01:00
Donal McBreen
a82e88d5c9
Merge pull request #1560 from basecamp/dont-redeploy-on-proxy-reboot
...
Don't deploy on proxy reboot
2025-05-15 14:57:58 +01:00
Donal McBreen
d6459e869a
Merge pull request #1559 from basecamp/default-proxy-config-if-nil
...
Default the proxy config if it is nil
2025-05-15 14:47:46 +01:00
Donal McBreen
ad21c7e984
Don't deploy on proxy reboot
...
It shouldn't be necessary to deploy the app on proxy reboot. When there
are multiple apps using the same proxy we'll only deploy the one we
run the reboot command from, so we don't always reboot anyway.
2025-05-15 14:45:19 +01:00
Donal McBreen
87965281a3
Default the proxy config is it is nil
...
Instead of checking for the proxy key, we'll set the config to {} if it
is nil in the Kamal::Configuration::Proxy initializer.
This is a bit cleaner, and maybe it will help with
https://github.com/basecamp/kamal/issues/1555 if somehow
@raw_config.key?(:proxy) is false but @raw_config.proxy is not nil.
2025-05-15 14:33:05 +01:00
Donal McBreen
dca96eafaa
Merge pull request #1557 from basecamp/sort-primary-role-app-hosts-first
...
Ensure primary_role app hosts are sorted first
2025-05-15 10:16:21 +01:00
Donal McBreen
7b1439c3c6
Update per-role proxy docs
...
Clarify that proxy: true/proxy: false only belong in the role config,
not at the root level.
2025-05-15 10:14:52 +01:00
Donal McBreen
b9e5ce7ca7
Ensure primary_role app hosts are sorted first
...
When booting non-primary role hosts we will always wait for a primary
role host to boor first.
So when booting in groups, if there are no primary role hosts in the
first batch, then booting will stall.
Sort primary role app_hosts first to avoid this.
Fixes: https://github.com/basecamp/kamal/issues/1553
2025-05-15 09:51:40 +01:00
Donal McBreen
f62c1a50c4
Merge pull request #1554 from basecamp/pre-connect-hook-before-remote-builds
...
Run pre-connect hooks before building
2025-05-14 16:05:53 +01:00
Donal McBreen
2c1d6ed891
Run pre-connect hooks before building
...
They might be needed for remote builds or the pre-build hook.
2025-05-14 15:55:54 +01:00
Andrew Kelley
1331e7b9c7
Added path_prefix and strip_path_prefix
2025-05-13 19:31:54 -04:00
Nick Hammond
c5e5f5d7cc
Merge branch 'basecamp:main' into buildpacks
2025-05-13 09:34:13 -07:00
Keita Urashima
6a573c19a6
Fix Bitwarden Secrets Manager authentication checks
2025-05-13 20:33:46 +09:00
Donal McBreen
031f55ecf7
Bump version for 2.6.0
2025-05-13 09:50:52 +01:00
Donal McBreen
d98d6a3475
Merge pull request #1550 from krzysztoff1/add-singular-role
...
Add a singular role
2025-05-12 15:20:55 +01:00
Krzysztof Duda
78c9d610cf
Add a singular role
2025-05-12 11:07:10 +02:00
Donal McBreen
4187ee2397
Merge pull request #1547 from basecamp/pin-accessories-to-tags
...
Pin accessories to tags
2025-05-12 08:48:52 +01:00
Nick Hammond
0ab0649d07
Merge branch 'basecamp:main' into buildpacks
2025-05-10 12:54:29 -07:00
David Heinemeier Hansson
7bfb2ed9f2
Actually test the fixture for singular
2025-05-09 21:50:07 +02:00
David Heinemeier Hansson
299c741c1b
More natural api when you are just applying accessory to a single tag
2025-05-09 21:47:26 +02:00
David Heinemeier Hansson
fb82d04aaf
Use #filter_map instead of #collect + #compact
2025-05-09 21:30:33 +02:00
David Heinemeier Hansson
9d5a534ef8
Refactored for clarity and style
2025-05-09 21:26:41 +02:00
David Heinemeier Hansson
5ad000a08e
Unnecessary parenthesis
2025-05-09 21:16:31 +02:00
David Heinemeier Hansson
1ca2b4d394
Test with multiple host matches across roles
2025-05-09 21:15:44 +02:00
David Heinemeier Hansson
9aac51bbd0
Extract hosts for accessories by tags
2025-05-09 21:11:28 +02:00
David Heinemeier Hansson
83a5636e27
Pin accessories to tags
2025-05-09 18:14:47 +02:00
Donal McBreen
2d43f788c4
Merge pull request #1546 from basecamp/min-proxy-version-0.9.0
...
Set minimum proxy version to 0.9.0
2025-05-09 09:13:23 +01:00
Donal McBreen
c351c2d2de
Set minimum proxy version to 0.9.0
2025-05-09 08:40:41 +01:00
Donal McBreen
0d36fc4bd0
Merge pull request #1536 from lukef/bump-ed25519
...
Bumping ed25519 dependency to fix compile errors
2025-05-09 08:17:44 +01:00
Peter Rullmann
d62c35e63e
Add UT for new interactive behaviour
...
also adding helpers to simulate STDIN being tty or file
2025-05-08 20:24:50 +02:00
dependabot[bot]
9a14fbb048
Bump rack-session in the bundler group across 1 directory
...
Bumps the bundler group with 1 update in the / directory: [rack-session](https://github.com/rack/rack-session ).
Updates `rack-session` from 2.0.0 to 2.1.1
- [Release notes](https://github.com/rack/rack-session/releases )
- [Changelog](https://github.com/rack/rack-session/blob/v2.1.1/releases.md )
- [Commits](https://github.com/rack/rack-session/compare/v2.0.0...v2.1.1 )
---
updated-dependencies:
- dependency-name: rack-session
dependency-version: 2.1.1
dependency-type: indirect
dependency-group: bundler
...
Signed-off-by: dependabot[bot] <support@github.com >
2025-05-08 14:47:52 +00:00
Peter Rullmann
092ca425d7
Allow piping into kamal exec #1485
2025-05-08 12:41:44 +02:00
Nick Hammond
68404e2673
Merge branch 'basecamp:main' into buildpacks
2025-05-08 02:34:40 -07:00
polarctos
681439f122
Install docker-cli only for leaner image
...
As only the docker client is executed in the image and not the docker daemon, only the docker-cli package is needed
2025-05-07 13:43:27 +02:00
Donal McBreen
317f00281a
Merge pull request #1504 from basecamp/proxy-metrics-port
...
Allow kamal-proxy run command options to be set
2025-05-06 13:15:47 +01:00
Donal McBreen
226e7091db
Add run_command_file to proxy boot
2025-05-06 12:14:58 +01:00
Donal McBreen
e32ea2e276
Expose the metrics port
2025-05-06 12:12:37 +01:00
Donal McBreen
1ea5d0bd86
Allow kamal-proxy run command options to be set
...
Allow --metrics_port and --debug options to be set via the boot config.
--metrics_port support will come in kamal-proxy v0.8.8, so this option
doesn't work right now.
This will be updated before the next Kamal release though and we can add
integration tests for the metrics at that point.
2025-05-06 12:11:48 +01:00
Michael G. Noll
a1c6ac41d0
Fix: correctly parse git remote origin urls for calling Octokit
2025-05-06 09:24:09 +02:00
Luke Freeman
f5f1bab8bf
bumping ed25519 dependency to fix compile errors
2025-05-05 08:29:50 -07:00
acidtib
9219b87630
remove chown for TLS certificates in proxy container
2025-04-29 19:57:41 -06:00
acidtib
1f847299c0
improve custom SSL certificate documentation
2025-04-28 13:33:03 -06:00
Donal McBreen
419a1171fa
Merge pull request #1528 from rahearn/update-hooks-documentation
...
Update name of KAMAL_ROLES in sample hooks files
2025-04-28 08:12:25 +01:00
acidtib
a525d45b4d
allow defining certificates directly within ssl hash instead of at the proxy root level
2025-04-28 00:34:24 -06:00
Ryan Ahearn
2f7feaf59d
Update name of KAMAL_ROLES in sample hooks files
2025-04-26 12:17:59 -04:00
acidtib
045410368d
add support for custom certificates
2025-04-26 01:03:15 -06:00
Donal McBreen
52c6191803
Merge pull request #1526 from basecamp/proxy-boot-config
...
Extract Kamal::Configuration::Proxy::Boot
2025-04-24 08:44:55 +01:00
Donal McBreen
b1c5c5092f
Fix polynomial regexp issue
2025-04-24 08:17:02 +01:00
Donal McBreen
128294672d
Extract Kamal::Configuration::Proxy::Boot
...
This is for boot time configuration for the kamal proxy. Config in here
doesn't not belong in Kamal::Configuration::Proxy which is for deploy
time configuration for the app itself.
Kamal apps don't contain boot time config, because multiple apps can
share a proxy and the config could conflict.
2025-04-23 16:16:12 +01:00
Donal McBreen
eb915f830e
Merge pull request #1522 from basecamp/create-directories-before-mapping
...
Create the .kamal/proxy/apps-config directory
2025-04-22 15:29:36 +01:00
Donal McBreen
d26b3f1768
Create the .kamal/proxy/apps-config directory
...
Manually create it to avoid ownership issues when docker creates it
for you.
2025-04-22 15:18:54 +01:00
Donal McBreen
8789a1b10c
Merge pull request #1346 from i7an/handle-parentheses
...
Handle parentheses in variables in commands
2025-04-22 12:02:32 +01:00
Donal McBreen
54b2c79f08
Merge pull request #1520 from basecamp/inherit-lock
...
Inherit locks
2025-04-22 09:31:35 +01:00
Donal McBreen
d464707c32
Merge pull request #1518 from basecamp/dependabot/bundler/bundler-8bcbabbe88
...
Bump nokogiri from 1.18.4 to 1.18.8 in the bundler group across 1 directory
2025-04-22 09:01:50 +01:00
Donal McBreen
f5ff612846
Merge pull request #1519 from basecamp/escape-audit-line
...
Escape the audit line
2025-04-22 09:00:49 +01:00
Donal McBreen
04568dea2f
Inherit locks
...
We'll set the KAMAL_LOCK environment when calling run hooks. If set to
true we have the lock and the hook will not need to acquire it again if
it runs kamal commands.
Fixes: https://github.com/basecamp/kamal/issues/1517
2025-04-22 09:00:22 +01:00
Donal McBreen
63f65d60c6
Escape the audit line
...
Makes it compatible with zsh.
2025-04-22 08:26:51 +01:00
dependabot[bot]
5145289625
Bump nokogiri in the bundler group across 1 directory
...
Bumps the bundler group with 1 update in the / directory: [nokogiri](https://github.com/sparklemotion/nokogiri ).
Updates `nokogiri` from 1.18.4 to 1.18.8
- [Release notes](https://github.com/sparklemotion/nokogiri/releases )
- [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md )
- [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.18.4...v1.18.8 )
---
updated-dependencies:
- dependency-name: nokogiri
dependency-version: 1.18.8
dependency-type: indirect
dependency-group: bundler
...
Signed-off-by: dependabot[bot] <support@github.com >
2025-04-22 04:53:20 +00:00
Nick Hammond
045da87219
Merge branch 'basecamp:main' into buildpacks
2025-04-21 09:33:40 -07:00
Donal McBreen
aa57462c1b
Merge pull request #1470 from pdl/chore/initialise-gh-status-checks-inside-begin
...
chore: put github status checks inside block
2025-04-21 16:27:08 +01:00
Donal McBreen
d0c9af20d8
Merge pull request #1405 from mike-weiner/fix-1399-fail-exec-without-cmd
...
Raise an error to the user if the exec command parsed is blank
2025-04-21 16:16:06 +01:00
Donal McBreen
f898fb8cb7
Merge pull request #1515 from basecamp/build-green-output
...
Redirect buildx build output to stdout
2025-04-21 10:48:22 +01:00
Donal McBreen
400fbcea1f
Merge pull request #1514 from basecamp/hook-kamal-roles
...
Add KAMAL_ROLES to hook env variables
2025-04-21 10:22:57 +01:00
Donal McBreen
93d1bd1369
Redirect buildx build output to stdout
...
Docker buildx build outputs the build logs to stderr by default.
SSHKit displays stderr logs in red, which can suggest that an error has
occurred.
Redirect the output to stdout, so it shows in green. If there is an
error, the output will be repeated in red anyway.
Fixes: https://github.com/basecamp/kamal/issues/1356
2025-04-21 10:19:36 +01:00
Donal McBreen
f768fab481
Add KAMAL_ROLES to hook env variables
...
And add an integration test to check the env vars are set.
2025-04-21 09:45:23 +01:00
Nick Hammond
fc67cdea33
Merge branch 'basecamp:main' into buildpacks
2025-04-18 07:47:38 -07:00
Donal McBreen
02c3b947c3
Merge pull request #1511 from basecamp/docker-login-before-exec
...
Docker login if exec might pull image
2025-04-18 15:44:22 +01:00
Donal McBreen
7a63cacb09
Docker login if exec might pull image
...
The `app exec` and `accessory exec` commands will run `docker run` if
they are not set to reuse existing containers. This might need to pull
an image so let's make sure we are logged in before running the command.
Fixes: https://github.com/basecamp/kamal/issues/1163
2025-04-18 14:47:59 +01:00
Donal McBreen
cd9d01b016
Merge pull request #1510 from basecamp/pre-connect-exec-commands
...
Run pre-connect hooks before ssh commands
2025-04-18 14:46:56 +01:00
Donal McBreen
48f5eeff09
Merge pull request #1509 from basecamp/disallow-proxy-boolean-at-root
...
Don't allow booleans for root proxy config
2025-04-18 14:46:44 +01:00
Donal McBreen
bf64d9a0f5
Run pre-connect hooks before ssh commands
...
We hook into the SSHKit `on` method to run the pre-connect hook before
the first SSH command. This doesn't work for interactive exec commands
where ssh is called directly.
Fixes: https://github.com/basecamp/kamal/issues/1157
2025-04-18 14:30:52 +01:00
Donal McBreen
8d5ed62d30
Don't allow booleans for root proxy config
...
Setting it to a false or true doesn't affect the config so shouldn't be
allowed. true/false are for role level configurations.
Fixes: https://github.com/basecamp/kamal/issues/1120
2025-04-18 14:25:29 +01:00
Donal McBreen
58d5c7fb15
Merge pull request #1508 from basecamp/app-hosts
...
Add KAMAL.app_hosts
2025-04-18 13:26:10 +01:00
Donal McBreen
e4e39c31e3
Add KAMAL.app_hosts
...
KAMAL.hosts includes accessory and apps hosts. Add KAMAL.app_hosts which
does not include accessory only hosts and use it for app specific
commands.
Fixes:
- https://github.com/basecamp/kamal/issues/1059
- https://github.com/basecamp/kamal/issues/1148
2025-04-18 13:15:50 +01:00
Donal McBreen
5c71f2ba5a
Merge pull request #1507 from basecamp/fix-accessory-setup
...
Fix accessory setup
2025-04-18 11:16:52 +01:00
Donal McBreen
05f04f4c10
Merge pull request #1506 from basecamp/registry-login-on-push-and-pull
...
Move docker login into build command
2025-04-18 10:56:14 +01:00
Donal McBreen
03cac7ae3d
Skip existing containers on accessory boot
...
When booting an accessory, check for the container first and skip boot
if it exists. This allows us to rerun `kamal setup` on hosts with
accessories without raising an error.
Fixes: https://github.com/basecamp/kamal/issues/488
2025-04-18 10:53:26 +01:00
Donal McBreen
399f1526af
Handle role filter when booting accessories
...
Filter the accessory hosts via KAMAL.accessory_hosts, which correctly
handles role and host filters.
Fixes: https://github.com/basecamp/kamal/issues/935
2025-04-18 10:20:54 +01:00
Donal McBreen
84fa30e376
Merge pull request #1501 from basecamp/accessory-only
...
Allow accessory only configurations
2025-04-18 09:58:38 +01:00
Donal McBreen
098c937bab
Move docker login into build command
...
We only need to run the docker login commands for pushing and pulling
images.
So let's move the logins into those commands. This ensures we are logged
in when calling `kamal build` commands directly.
Fixes: https://github.com/basecamp/kamal/issues/919
2025-04-18 09:57:02 +01:00
Donal McBreen
95e3edc32b
Merge pull request #1503 from basecamp/disallow-options-restart
...
Ensure that the restart policy is unless-stopped
2025-04-17 15:16:54 +01:00
Donal McBreen
ac719dc271
Merge pull request #1502 from basecamp/remove-next-container-special-case
...
Rely on semver for version checks
2025-04-17 15:16:00 +01:00
Donal McBreen
91f01ece1b
Ensure that the restart policy is unless-stopped
...
No other restart policy makes sense to don't let it be changed.
Fixes: https://github.com/basecamp/kamal/issues/749
2025-04-17 13:36:26 +01:00
Donal McBreen
521425c386
Rely on semver for version checks
2025-04-17 13:18:46 +01:00
Donal McBreen
55ec6ca0a6
Allow accessory only configurations
...
If there are accessories defined in the configuration, we'll not require
servers to be defined as well.
This allows for accessory-only configurations which allows you to run
external images with kamal-proxy for zero-downtime deployments.
We don't manage image cleanup for accessories though so the user will
need to deal with that themselves.
2025-04-17 11:40:03 +01:00
Donal McBreen
2a8d561094
Merge pull request #1497 from basecamp/maintenance-mode
...
Maintenance mode
2025-04-17 09:25:58 +01:00
Donal McBreen
354530f3b8
Maintenance mode
...
Adds support for maintenance mode to Kamal.
There are two new commands:
- `kamal app maintenance` - puts the app in maintenance mode
- `kamal app live` - puts the app back in live mode
In maintenance mode, the kamal proxy will respond to requests with a
503 status code. It will use an error page built into kamal proxy.
You can use your own error page by setting `error_pages_path` in the
configuration. This will copy any 4xx.html or 5xx.html files from that
page to a volume mounted into the proxy container.
2025-04-17 09:11:21 +01:00
Donal McBreen
26b6c072f3
Add a writable proxy volume
...
Maps in and external /home/kamal-proxy/.app-config volume that we can
use to map files to the proxy.
Can be used to store custom maintenance pages or SSL certificates.
2025-04-17 09:08:36 +01:00
Donal McBreen
3c1fbb41cb
Merge pull request #1499 from basecamp/custom-proxy-image
...
Custom proxy image
2025-04-17 09:05:27 +01:00
Donal McBreen
8ceeda6ac9
Extract proxy_default_boot_options
2025-04-17 08:47:01 +01:00
Donal McBreen
dd9048e09c
Allow version 'next'
2025-04-17 08:20:25 +01:00
Donal McBreen
bd81632439
Set DEBUG for integration test output
2025-04-16 16:54:46 +01:00
Donal McBreen
85320dbc51
Custom proxy image registry, repo and version
...
Use the --registry, --repository and --image_version options of
`kamal proxy boot_config set` to change the kamal-proxy image used.
We'll still insist that the image version is at least as high as the
minimum.
2025-04-16 16:54:46 +01:00
Donal McBreen
c9a755bde6
Extract echo_boot_config/docker_run methods
2025-04-16 14:33:15 +01:00
Donal McBreen
c3a9a3c1eb
Merge pull request #1494 from basecamp/integration-test-registry-3
...
Use registry:3 image for the integration tests
2025-04-15 11:36:01 +01:00
Donal McBreen
215fd2faed
Use registry:3 image for the integration tests
...
v3 was recently released which broke the integration tests. Update them
to use the correct config file.
Set the major version to prevent this from happening when v4 is
released.
2025-04-15 10:55:36 +01:00
Donal McBreen
ec28caa83f
Merge pull request #1476 from aliismayilov/aws-secrets-json
...
Enforce JSON output format for aws secrets manager command
2025-04-15 10:05:31 +01:00
Donal McBreen
a71ea08fb6
Merge pull request #1464 from basecamp/dependabot/bundler/bundler-bee64d1bf2
...
Bump nokogiri from 1.18.3 to 1.18.4 in the bundler group across 1 directory
2025-04-15 09:46:50 +01:00
Ali Ismayilov
0b28a54518
Enforce JSON output format for aws command
2025-04-02 18:18:03 +02:00
Nick Hammond
38cfc4488b
Merge branch 'basecamp:main' into buildpacks
2025-03-28 11:47:43 -07:00
Jake Prem
0e453a02de
Add KAMAL_HOST to app and accessory containers
...
Adds the host the container is being deployed to as KAMAL_HOST.
My use case is to more easily tag the host for metrics tagging,
but there might be other uses as well.
2025-03-25 22:49:00 -04:00
Daniel Perrett
d7dbef1c9e
chore: guard GithubStatusChecks.new, which makes calls on initialize
2025-03-25 14:03:22 +00:00
Donal McBreen
8fe2f92164
Merge pull request #1466 from basecamp/env-secrets-tidy
...
Tidy up the env secrets handling
2025-03-24 09:38:22 +00:00
Donal McBreen
fb95b38e73
Tidy up the env secrets handling
...
The secrets accessor was only used in the tests so remove it.
Skip the memoization, it makes things slightly harder to follow and
it's not needed.
2025-03-24 09:21:27 +00:00
Donal McBreen
3aef9303c3
Merge pull request #1465 from visini/feature/aliased-secrets-within-tags
...
Add ability to alias secrets for tags
2025-03-24 09:15:27 +00:00
Camillo Visini
c1d8ce7f70
Add ability to alias secrets for tags
...
Aliasing for secrets was introduced in #1439 , but only supported
"top-level" secrets. This adds support for aliasing/mapping secrets
for tags.
2025-03-22 12:11:48 +01:00
dependabot[bot]
eeb5c01fc5
Bump nokogiri in the bundler group across 1 directory
...
Bumps the bundler group with 1 update in the / directory: [nokogiri](https://github.com/sparklemotion/nokogiri ).
Updates `nokogiri` from 1.18.3 to 1.18.4
- [Release notes](https://github.com/sparklemotion/nokogiri/releases )
- [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md )
- [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.18.3...v1.18.4 )
---
updated-dependencies:
- dependency-name: nokogiri
dependency-type: indirect
dependency-group: bundler
...
Signed-off-by: dependabot[bot] <support@github.com >
2025-03-21 23:59:58 +00:00
Donal McBreen
58e23f9167
Merge pull request #1459 from basecamp/xargs-proxy-options
...
Use xargs to handle spaces in proxy options
2025-03-19 09:19:12 +00:00
Donal McBreen
7fa27faaca
Use xargs to handle spaces in proxy options
...
We cat the options file, append the proxy image and then pass it
to xargs to ensure it handles spaces correctly.
Works better than using eval which can handle spaces but tries
to evaluate things like backticks.
Fixes: https://github.com/basecamp/kamal/issues/1448
2025-03-18 08:46:31 +00:00
Donal McBreen
a02826284d
Merge pull request #1454 from basecamp/proxy-disable-redirect
...
Add `ssl_redirect` option
2025-03-18 08:46:00 +00:00
Donal McBreen
4d78afaf1b
Merge pull request #1452 from basecamp/dependabot/bundler/bundler-9e375bb185
...
Bump the bundler group across 1 directory with 2 updates
2025-03-17 14:44:59 +00:00
Kevin McConnell
d4ab010b01
Add ssl_redirect proxy option
2025-03-12 11:11:14 +00:00
Kevin McConnell
3c9a3f2264
Require proxy version v0.8.7
2025-03-12 10:50:45 +00:00
dependabot[bot]
8098ed1fd1
Bump the bundler group across 1 directory with 2 updates
...
Bumps the bundler group with 2 updates in the / directory: [rack](https://github.com/rack/rack ) and [uri](https://github.com/ruby/uri ).
Updates `rack` from 3.1.10 to 3.1.12
- [Release notes](https://github.com/rack/rack/releases )
- [Changelog](https://github.com/rack/rack/blob/main/CHANGELOG.md )
- [Commits](https://github.com/rack/rack/compare/v3.1.10...v3.1.12 )
Updates `uri` from 1.0.2 to 1.0.3
- [Release notes](https://github.com/ruby/uri/releases )
- [Commits](https://github.com/ruby/uri/compare/v1.0.2...v1.0.3 )
---
updated-dependencies:
- dependency-name: rack
dependency-type: indirect
dependency-group: bundler
- dependency-name: uri
dependency-type: indirect
dependency-group: bundler
...
Signed-off-by: dependabot[bot] <support@github.com >
2025-03-10 22:29:34 +00:00
Donal McBreen
0d034ec5dc
Merge pull request #1439 from matthewbjones/feature/aliased-secrets
...
Adds the ability to alias/map secrets
2025-03-10 10:06:45 +00:00
Donal McBreen
598bd65b78
Merge pull request #1449 from basecamp/kamal-proxy-drain-timeout-fix
...
Update to kamal-proxy 0.8.6
2025-03-10 10:06:14 +00:00
Donal McBreen
36f4e90a76
Update to kamal-proxy 0.8.6
...
Includes a fix for locking the proxy while draining
2025-03-07 11:33:17 +00:00
Matthew Jones
973fa1a7ff
Adds the ability to alias/map secrets
2025-03-04 07:23:26 -07:00
Michael Weiner
5e87b6d58e
Use double-quotes on UT
2025-03-04 06:32:08 -06:00
Donal McBreen
f87bcf5bc6
Merge pull request #1413 from basecamp/dependabot/bundler/bundler-fd41ac4d62
...
Bump rack from 3.1.8 to 3.1.10 in the bundler group across 1 directory
2025-03-03 14:49:37 +00:00
Donal McBreen
62dfa45ee6
Bump version for 2.5.3
2025-02-27 10:27:27 +00:00
Donal McBreen
c13ee578df
Merge pull request #1420 from smartygus/docker-build-fix
...
Fix Docker Build under Ruby 3.4
2025-02-27 09:42:57 +00:00
acidtib
aa12dc1d12
remove unnecessary blank lines
2025-02-21 17:52:17 -07:00
acidtib
8acd35c4b7
test: add fetch functionality for nested folders and secrets
2025-02-21 17:04:46 -07:00
acidtib
104914bf14
refactor: improve retrieval logic for nested folders
2025-02-21 17:04:04 -07:00
Michael Smart
f01238112e
Update nokogiri to 1.18.3
...
See: https://github.com/sparklemotion/nokogiri/releases/tag/v1.18.0
- required for ruby 3.4 compatibility
- add more platforms to lockfile to support
docker build process, due to changes
in the nokogiri native gem setup where
-musl and -gnu linux platforms are no longer
interchangeable
- bundler >= 2.5.6 required according to Nokogiri release
notes, so updated to current latest version (2.6.5)
2025-02-21 13:23:08 +01:00
acidtib
913f07bbf2
add PassboltAdapter tests
2025-02-21 00:34:10 -07:00
acidtib
9b63ad5cb8
feat: add Passbolt adapter
2025-02-20 22:38:07 -07:00
dependabot[bot]
32ab72089a
Bump rack from 3.1.8 to 3.1.10 in the bundler group across 1 directory
...
Bumps the bundler group with 1 update in the / directory: [rack](https://github.com/rack/rack ).
Updates `rack` from 3.1.8 to 3.1.10
- [Release notes](https://github.com/rack/rack/releases )
- [Changelog](https://github.com/rack/rack/blob/main/CHANGELOG.md )
- [Commits](https://github.com/rack/rack/compare/v3.1.8...v3.1.10 )
---
updated-dependencies:
- dependency-name: rack
dependency-type: indirect
dependency-group: bundler
...
Signed-off-by: dependabot[bot] <support@github.com >
2025-02-12 19:26:36 +00:00
Michael Weiner
5377871278
Add UT for missing command
2025-02-08 13:09:57 -06:00
Michael Weiner
91259720b2
Fail kamal app exec without a CMD
2025-02-07 20:13:18 -06:00
Nick Hammond
8c17b1ebc6
Add export_action support for pack
2025-02-07 13:07:33 -07:00
Donal McBreen
6f29d4e78b
Bump version for 2.5.2
2025-02-07 15:27:30 +00:00
Donal McBreen
9d2dda0d77
Merge pull request #1402 from basecamp/fix-docker-build
...
Fix the docker build
2025-02-06 14:59:14 +00:00
Donal McBreen
b130bc0321
Fix the docker build
...
Somewhere along the way the docker build broke, it now needs yaml-dev
to be installed. Maybe the underlying image changed?
Update to 3.4-alpine while we are here.
2025-02-06 14:45:37 +00:00
Nick Hammond
f8f7c6ec57
Catch up with 2.5.1
2025-02-06 07:12:05 -07:00
Donal McBreen
28be0300b9
Bump version for 2.5.1
2025-02-06 13:54:46 +00:00
Donal McBreen
3c2163ab78
Merge pull request #1401 from basecamp/avoid-docker-check-with-skipping-local
...
Only check for docker when logging in locally
2025-02-06 11:35:49 +00:00
Donal McBreen
fdf7e6927a
Only check for docker when logging in locally
...
If we are skipping a local registry login, we don't need docker
installed locally.
Fixes: https://github.com/basecamp/kamal/issues/1400
2025-02-06 11:12:56 +00:00
Donal McBreen
45197e46f6
Bump version for 2.5.0
2025-02-04 11:19:44 +00:00
Donal McBreen
6b40a64b9a
Merge pull request #1398 from basecamp/kamal-2.5-doc-changes
...
Doc changes for 2.5
2025-02-04 11:18:40 +00:00
Donal McBreen
9af2425fbd
Doc changes for 2.5
...
Sync up the accessory.yml file with the latest changes in the
kamal-site repo.
2025-02-04 11:05:25 +00:00
Donal McBreen
854dd925ba
Merge pull request #1397 from basecamp/prep-for-2.5
...
Prep for 2.5
2025-02-04 09:18:30 +00:00
Donal McBreen
8775d202bd
Prep for 2.5
...
- Reset KAMAL on alias command, rather than relying on checking
"invoked_via_subcommand"
- Validate the accessories roles when loading the configuration
not later on when trying to access them
2025-02-04 09:08:57 +00:00
Donal McBreen
bae7c56e74
Merge pull request #1392 from neiljohari/feature/allow-omitting-aws-account
...
Allow omitting AWS account parameter while fetching secrets
2025-02-04 08:45:06 +00:00
Neil Johari
07d05ad58a
Run rubocop auto correct
2025-02-03 09:44:39 -08:00
Neil Johari
e69611efb6
Add final newline
2025-02-03 08:56:06 -08:00
Donal McBreen
ba6dd6ff14
Merge pull request #1396 from basecamp/allow-accessory-roles-with-no-hosts
...
Allow accessory roles with no hosts
2025-02-03 16:54:28 +00:00
Donal McBreen
04a96aa5be
Allow accessory roles with no hosts
...
Only raise an exception if the role is not found, not it it has no
hosts.
2025-02-03 16:44:01 +00:00
Donal McBreen
dba3a115bd
Merge pull request #1395 from basecamp/app-boot-hooks
...
Add pre and post app boot hooks
2025-02-03 16:04:14 +00:00
Donal McBreen
cd73cea850
Add pre and post app boot hooks
...
Add two new hooks pre-app-boot and post-app-boot. They are analagous
to the pre/post proxy reboot hooks.
If the boot strategy deploys in groups, then the hooks are called once
per group of hosts and `KAMAL_HOSTS` contains a comma delimited list of
the hosts in that group.
If all hosts are deployed to at once, then they are called once with
`KAMAL_HOSTS` containing all the hosts.
It is possible to have pauses between groups of hosts in the boot config,
where this is the case the pause happens after the post-app-boot hook is
called.
2025-02-03 15:54:45 +00:00
Donal McBreen
09d020e9bb
Merge pull request #1357 from flavorjones/flavorjones-kamal-build-local
...
Introduce a "build dev" command
2025-02-03 09:07:00 +00:00
Neil Johari
ff3538f81d
Undo accidental line deletion
2025-02-02 23:54:53 -08:00
Neil Johari
c7d1711e30
Remove unnecessary var
2025-02-02 23:46:09 -08:00
Neil Johari
d710b5a22b
Allow ommitting AWS account while fetching secrets
2025-02-02 23:43:51 -08:00
Mike Dalessio
214d4fd321
The build dev command warns about untracked and uncommitted files
...
so there's a complete picture of what is being packaged that's not in git.
2025-02-01 22:19:05 -05:00
Donal McBreen
5ddaa3810d
Merge pull request #1370 from flavorjones/flavorjones-ci-matrix
...
ci: use `fail-fast: false` instead of `continue-on-error: true`
2025-01-22 09:28:42 +00:00
Mike Dalessio
3c01dc75fd
ci: use fail-fast: false instead of continue-on-error: true
...
This will give us proper red/green signal on the test suite while
still running the entire matrix.
2025-01-20 18:59:11 -05:00
Mike Dalessio
2127f1708a
feat: Introduce a build dev command
...
which will build a "dirty" image using the working directory.
This command is different from `build push` in two important ways:
- the image tags will have a suffix of `-dirty`
- the export action is "docker", pushing to the local docker image store
The command also supports the `--output` option just added to `build
push` to override that default.
This command is intended to allow developers to quickly iterate on a
docker image built from their local working directory while avoiding
any confusion with a pristine image built from a git clone, and
keeping those images on the local dev system by default.
2025-01-20 18:52:21 -05:00
Mike Dalessio
24e4347c45
feat: Introduce a build push --output option
...
which controls where the build result is exported.
The default value is "registry" to reflect the current behavior of
`build push`.
Any value provided to this option will be passed to the `buildx build`
command as a `--output=type=<VALUE>` flag.
For example, the following command will push to the local docker image
store:
kamal build push --output=docker
squash
2025-01-20 18:37:15 -05:00
Nick Hammond
da26457d52
Merge branch 'buildpacks' of github.com:nickhammond/kamal into buildpacks
2025-01-20 09:53:40 -07:00
Nick Hammond
95b606a427
Catch up with main
2025-01-20 09:53:16 -07:00
Donal McBreen
5f04e4266b
Merge pull request #1369 from basecamp/dont-cleanup-traefik-on-reboot
...
Don't cleanup traefik on reboot
2025-01-20 15:23:49 +00:00
Donal McBreen
35a29cc538
Merge pull request #1331 from guillaumebriday/patch-1
...
Fixing log command on role in example
2025-01-20 15:23:31 +00:00
Donal McBreen
f187080db5
Don't cleanup traefik on reboot
...
This was designed to help with upgrading from Kamal 1 to Kamal 2
but it causes issues if you have a traefik container you don't want
to be shut down.
2025-01-20 15:06:06 +00:00
Donal McBreen
080fa49fdf
Merge pull request #1368 from basecamp/error-free-ruby-version-comment
...
Don't read a file in sample deploy.yml
2025-01-20 14:38:34 +00:00
Donal McBreen
34050f1036
Don't read a file in sample deploy.yml
...
The ERB runs first so it does matter if it in a comment. If the file
doesn't exist (e.g. if not using Ruby, you'll get an error).
We'll change the example to match the Rails deploy.yml template won't
have than problem.
2025-01-20 14:26:43 +00:00
Donal McBreen
459c7366ec
Merge pull request #1367 from brettabamonte/fix_lastpass_err_msg_typo
...
Fix LastPass error message typo
2025-01-20 11:43:33 +00:00
Donal McBreen
f8db5de5eb
Merge pull request #1354 from matthewbjones/feature/docker-build-cloud
...
Adds support for Docker Build Cloud
2025-01-20 08:24:27 +00:00
brettabamonte
4d67a1671a
Change LassPass to LastPass
2025-01-18 19:11:34 -05:00
Donal McBreen
2c9bba3f88
Merge branch 'main' into feature/docker-build-cloud
2025-01-17 15:49:28 +00:00
Donal McBreen
a388937de8
Merge pull request #1363 from basecamp/check-for-docker-locally
...
Check for docker locally before registry login
2025-01-17 15:45:18 +00:00
Donal McBreen
9ef6c2f893
Merge pull request #1361 from basecamp/ruby-3.4
...
Update to Ruby 3.4 from the preview version
2025-01-17 15:27:34 +00:00
Donal McBreen
eee9d67691
Merge pull request #1319 from ShPakvel/fix_bug_in_role_validate_servers
...
Fix bugs for role validate servers
2025-01-17 15:19:25 +00:00
Donal McBreen
5bd9bc8576
Merge pull request #1320 from ShPakvel/add_optional_accessory_registry
...
[Feature] Registry for accessory
2025-01-17 15:18:50 +00:00
Donal McBreen
a5b9c69838
Update to Ruby 3.4 from the preview version
2025-01-17 15:17:37 +00:00
Donal McBreen
dc9a95db2c
Check for docker locally before registry login
...
We were checking before `kamal build push`, but not `kamal registry login`.
Since `kamal registry login` is called first by a deploy we don't
get the nice error message.
2025-01-17 15:17:22 +00:00
Donal McBreen
0174b872bf
Merge pull request #1362 from basecamp/boot-accessories-after-pre-deploy-hook
...
Boot accessories after pre-deploy hook
2025-01-17 15:13:04 +00:00
Donal McBreen
1db44c402c
Boot accessories after pre-deploy hook
...
That allows you to set proxy config in the hook before booting
the proxy.
2025-01-17 15:04:16 +00:00
Matthew Jones
b420b2613d
Adds support for Docker Build Cloud
2025-01-17 07:14:31 -07:00
Donal McBreen
4ffa772201
Don't boot proxy twice when setting up
2025-01-17 13:04:37 +00:00
Donal McBreen
e081414849
Merge pull request #1308 from pokonski/proxy-accessory-fix
...
Boot proxy on server setup
2025-01-17 13:04:07 +00:00
Donal McBreen
85c1c47c2f
Merge pull request #1360 from basecamp/secret-adapter-tidy
...
Secret adapter tidy
2025-01-17 13:01:21 +00:00
Donal McBreen
9f1688da7a
Fix test
2025-01-17 12:52:23 +00:00
Donal McBreen
2bd716ece4
Drop the TestOptionalAccount adapter
...
It's included in the gem lib which is best to avoid and we can infer
that it works account optional adapters.
2025-01-17 12:37:12 +00:00
Donal McBreen
f9a78f4fcb
gcloud login tidy
...
Use unless instead of if !, don't suggest running gcloud auth login,
we've just tried that.
2025-01-17 12:34:38 +00:00
Donal McBreen
10dafc058a
Extract secrets_get_flags
2025-01-17 12:31:24 +00:00
Donal McBreen
5e2678dece
Ensure external input is shell escaped
2025-01-17 12:28:59 +00:00
Donal McBreen
a1708f687f
Prefix secrets in fetch_secrets
...
This allows us to remove the custom fetch method for enpass.
2025-01-17 12:24:46 +00:00
Donal McBreen
db7556ed99
Fix enpass adapter
...
There were changes in main that meant the tests failed after merging.
Adding the new `requires_account?` method to the enpass adapter fixed it.
2025-01-17 12:07:56 +00:00
Donal McBreen
93133cd7a9
Merge pull request #1236 from andrelaszlo/gcp_secret_manager_adapter
...
Add GCP Secret Manager adapter
2025-01-17 12:07:33 +00:00
Donal McBreen
a7b2ef56c7
Merge pull request #1189 from egze/enpass
...
Add support for Enpass - a password manager for secrets
2025-01-17 12:01:24 +00:00
Donal McBreen
06f2cb223e
Merge branch 'main' into gcp_secret_manager_adapter
2025-01-17 11:57:52 +00:00
Donal McBreen
ea7e72d75f
Merge pull request #1186 from oandalib/bitwarden-secrets-manager
...
feat: add Bitwarden Secrets Manager adapter
2025-01-17 11:43:19 +00:00
Donal McBreen
9035bd0d88
Merge pull request #1359 from basecamp/add-env-precedence-tests
...
Add tests for env/secret file precedence
2025-01-17 11:19:32 +00:00
Donal McBreen
dd8cadf743
Add tests for env/secret file precedence
2025-01-17 11:06:29 +00:00
Donal McBreen
f1a9a09929
Merge pull request #1265 from phoozle/proxy-bind-ip
...
Add proxy boot_config --publish-ip argument
2025-01-17 08:49:17 +00:00
Donal McBreen
620b132138
Merge pull request #1313 from emmceemoore/patch-1
...
Configure the CLI to exit non-zero on failures.
2025-01-17 08:31:58 +00:00
Donal McBreen
2e7d0ddc44
Merge pull request #1358 from basecamp/dont-run-assets-container
...
Create but don't run the assets container
2025-01-17 08:09:01 +00:00
Donal McBreen
ab8396fbb2
Merge pull request #1032 from basecamp/set-config-file-and-deploy-in-aliases
...
Allow destination and config-file in aliases
2025-01-17 08:07:06 +00:00
Donal McBreen
2cdca4596c
Create but don't run the assets container
...
We don't need to run the assets container to copy the assets out,
instead we can just create, copy and remove.
2025-01-16 16:28:02 +00:00
Donal McBreen
78fcc3d88f
Allow destination and config-file in aliases
...
We only loaded the configuration once, which meant that aliases always
used the initial configuration file and destination.
We don't want to load the configuration in subcommands as it is not
passed all the options we need. But just checking if we are in a
subcommand is enough - the alias reloads and the subcommand does not.
One thing to note is that anything passed on the command line overrides
what is in the alias, so if an alias says
`other_config: config -c config/deploy2.yml` and you run
`kamal other_config -c config/deploy.yml`, it won't switch.
2025-01-16 15:51:18 +00:00
Ivan Yurchanka
7627f74e45
Handle parentheses in variables in commands
2025-01-08 17:13:10 +01:00
Nick Hammond
d249b9a431
Merge branch 'basecamp:main' into buildpacks
2025-01-05 15:31:24 -07:00
Guillaume Briday
2b9d5c2b19
Fixing log command on role
2025-01-02 22:51:01 +01:00
Pavel Shpak
d59c274208
Fix typo in configuration initializer method.
2024-12-22 04:37:15 +02:00
Pavel Shpak
bd8689c185
Fix bug in role validate_servers.
...
There were typo-bug during `validate_servers!` invocation for role.
It wasn't discovered, because it never met condition. Because role_config wasn't correctly extracted for validation.
Also remove not used anymore `accessories_on`. Leftover from previous changes.
2024-12-22 03:28:12 +02:00
Pavel Shpak
b5aee11a40
[Feature] Add optional accessory registry.
...
Add test cases to cover new option.
2024-12-22 02:50:53 +02:00
Mike Moore
2943c4a301
Use the newer option name.
2024-12-20 08:45:47 -07:00
Mike Moore
32e1b6504d
Re-trigger GitHub actions.
2024-12-20 08:26:14 -07:00
Mike Moore
39e2c4f848
Trying the new method for setting proxy boot config.
2024-12-19 12:14:00 -07:00
Mike Moore
89db5025a0
Configure Thor to "exit on failure".
2024-12-19 09:28:37 -07:00
Piotrek O
c56edba4a9
Boot proxy on server setup
2024-12-18 11:35:57 +01:00
Donal McBreen
1547089da0
Bump version for 2.4.0
2024-12-13 12:38:26 +00:00
Donal McBreen
ae7a4f3411
Update yml files to match doc site changes
2024-12-13 12:27:22 +00:00
Donal McBreen
77c202ebaf
Highlight ssl/forward_headers behaviour
...
Pulled in from: https://github.com/basecamp/kamal-site/pull/141
2024-12-13 12:20:05 +00:00
Donal McBreen
063dfd9edd
Merge pull request #1296 from basecamp/fix-for-dotenv-1.3.5
...
Fix for Dotenv 3.1.5
2024-12-13 10:54:16 +00:00
Donal McBreen
3e4a190173
Fix for Dotenv 3.1.5
...
In Dotenv 3.1.5, `Dotenv.parse` no longer returns values that are
already in the environment.
See https://github.com/bkeepers/dotenv/issues/518
We can get the values though by setting overwrite: true, which works
with both 3.1.4 and 3.1.5.
2024-12-13 10:42:02 +00:00
Donal McBreen
d9c25533e4
Merge pull request #1292 from nickhammond/aws-secrets-manager-simple
...
Aws secrets manager simple strings and error checking
2024-12-13 09:45:52 +00:00
Donal McBreen
d5ec0e6ad2
Merge pull request #1291 from nickhammond/remove-grep-options-alias
...
Remove the alias for grep_options, issues processing with thor
2024-12-13 09:44:06 +00:00
Nick Hammond
725da6aa68
Rubocop, Rubocop
2024-12-12 05:29:15 -07:00
Nick Hammond
84a874e63b
Update secrets manager spec to render multiple errors
2024-12-12 05:15:52 -07:00
Nick Hammond
ba567e0474
Just map the secrets returned from AWS
2024-12-12 05:09:12 -07:00
Nick Hammond
e464177349
Check for errors from AWS secrets manager
2024-12-12 04:58:53 -07:00
Nick Hammond
68e6f82b30
Grab from secret2 for assertion
2024-12-12 04:17:03 -07:00
Nick Hammond
55983c6431
AWS secrets manager value can be a string
2024-12-12 04:10:48 -07:00
Nick Hammond
b2cf3f33a7
Remove the alias for grep_options, issues processing with thor
2024-12-12 03:47:25 -07:00
Jeremy Daer
16fb3adacb
No need for IO.read for basic file paths
...
References 3cad095 , e1d5182
2024-12-10 16:08:58 -08:00
Jeremy Daer
407c8b834e
Simplify hostname trimming. References #762 .
2024-12-10 15:57:30 -08:00
dependabot[bot]
3468b45014
Bump actionpack in the bundler group across 1 directory ( #1283 )
...
Bumps the bundler group with 1 update in the / directory: [actionpack](https://github.com/rails/rails ).
Updates `actionpack` from 7.1.4.1 to 7.1.5.1
- [Release notes](https://github.com/rails/rails/releases )
- [Changelog](https://github.com/rails/rails/blob/v8.0.0.1/actionpack/CHANGELOG.md )
- [Commits](https://github.com/rails/rails/compare/v7.1.4.1...v7.1.5.1 )
---
updated-dependencies:
- dependency-name: actionpack
dependency-type: indirect
dependency-group: bundler
...
Signed-off-by: dependabot[bot] <support@github.com >
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-10 15:46:48 -08:00
André Laszlo
8103d68688
Shellescape all interpolated strings in commands
2024-12-06 17:43:47 +01:00
André Laszlo
eb82b4a753
Keep the 'default' prefix for secret items
2024-12-06 17:40:08 +01:00
André Laszlo
19b4359b17
Use a nil session
2024-12-06 17:32:31 +01:00
André Laszlo
dc64aaa0de
Add gcloud auth login invocation to test
2024-12-06 17:32:01 +01:00
André Laszlo
ea170fbe5e
Run gcloud auth login if user is not authenticated
2024-12-06 17:22:03 +01:00
André Laszlo
18f2aae936
Simplify parsing by changing account separators
2024-12-06 17:15:22 +01:00
André Laszlo
e314f38bdc
Merge remote-tracking branch 'origin/main' into gcp_secret_manager_adapter
2024-12-06 17:08:26 +01:00
Matthew Croall
1c8a56b8cf
Change invalid publish ip exception class
2024-12-04 10:44:16 +10:30
Matthew Croall
e597ae6155
Add support for multiple publish ip addresses
2024-12-04 10:42:50 +10:30
Donal McBreen
495b3cd95f
Merge pull request #1270 from basecamp/kamal-proxy-0.8.4
...
Update to proxy version 0.8.4
2024-12-03 12:15:00 +00:00
Donal McBreen
b04e8cd8d7
Merge pull request #1272 from basecamp/dependabot/bundler/bundler-7ec3bf8405
...
Bump rails-html-sanitizer from 1.6.0 to 1.6.1 in the bundler group across 1 directory
2024-12-03 12:14:47 +00:00
Omid Andalib
aa9fe4c525
feat: add Bitwarden Secrets Manager adapter
2024-12-03 00:41:16 -08:00
dependabot[bot]
f5391d7fe4
Bump rails-html-sanitizer in the bundler group across 1 directory
...
Bumps the bundler group with 1 update in the / directory: [rails-html-sanitizer](https://github.com/rails/rails-html-sanitizer ).
Updates `rails-html-sanitizer` from 1.6.0 to 1.6.1
- [Release notes](https://github.com/rails/rails-html-sanitizer/releases )
- [Changelog](https://github.com/rails/rails-html-sanitizer/blob/main/CHANGELOG.md )
- [Commits](https://github.com/rails/rails-html-sanitizer/compare/v1.6.0...v1.6.1 )
---
updated-dependencies:
- dependency-name: rails-html-sanitizer
dependency-type: indirect
dependency-group: bundler
...
Signed-off-by: dependabot[bot] <support@github.com >
2024-12-02 22:06:59 +00:00
Matthew Croall
0bafa02e7d
Rename proxy bind cli argument to publish_host_ip
2024-12-03 08:13:20 +10:30
Matthew Croall
ffe1ac3483
Refactor proxy_publish_args argument concatenation
2024-12-03 08:11:19 +10:30
Donal McBreen
2386c903ca
Update to proxy version 0.8.4
...
Release: https://github.com/basecamp/kamal-proxy/releases/tag/v0.8.4
- Silence late healthcheck requests
2024-12-02 10:37:07 +00:00
Donal McBreen
fbc4515888
Merge pull request #906 from aliismayilov/detached-run
...
Allow running detached app commands and follow logs by container ID
2024-12-02 10:22:45 +00:00
Donal McBreen
99829092b3
Merge pull request #1229 from matjack1/use-ssh-keys-when-executing-commands
...
[FIX] - Make kamal use ssh keys from config when performing commands
2024-12-02 09:59:03 +00:00
Donal McBreen
084d1d4a1d
Merge pull request #1253 from AxelTheGerman/proxy-0.8.3
...
Bump proxy minimum version to 0.8.3
2024-12-02 09:54:33 +00:00
Matthew Croall
11e4f37409
Add proxy boot_config --publish-ip argument
2024-11-30 11:10:49 +10:30
André Laszlo
b87bcae6a3
Merge remote-tracking branch 'origin/main' into gcp_secret_manager_adapter
2024-11-27 13:42:21 +01:00
André Laszlo
0c9a367efc
Remove overly generic 'secret_manager' alias
2024-11-27 13:33:04 +01:00
Nick Hammond
9f6660dfbf
Catch up with main
2024-11-26 07:36:54 -07:00
Axel Gustav
a1596af815
Bump proxy minimum version to 0.8.3
2024-11-26 09:55:21 -04:00
Donal McBreen
69867e2650
Merge pull request #981 from igor-alexandrov/proxy-accessories
...
Proxy for accessories
2024-11-26 09:51:22 +00:00
Igor Alexandrov
eee47d10ee
Added an integration test for proxied accessory using Busybox and netcat
2024-11-26 13:34:51 +04:00
Ali Ismayilov
8a7843cb35
Allow running the CI manually
2024-11-23 21:45:51 +01:00
Ali Ismayilov
1cc5406b00
Pipe app container id
2024-11-23 21:37:58 +01:00
Matteo Giaccone
e31b98539c
Avoid string mutation
...
For Ruby 3.4
2024-11-22 09:57:45 +01:00
Igor Alexandrov
f367ca8ea5
Replaced Kamal::Commands::Proxy::Exec with Kamal::Commands::App::Proxy and Kamal::Commands::Accessory::Proxy
2024-11-21 23:08:03 +04:00
Igor Alexandrov
14068b32b1
Added alias to accessories proxy configuration example
2024-11-21 22:38:06 +04:00
Igor Alexandrov
f52826b2d6
Updated accessory proxy to support hosts option
2024-11-21 22:23:56 +04:00
Igor Alexandrov
9204624752
Removed duplicated method
2024-11-21 22:23:56 +04:00
Igor Alexandrov
006fa0de17
Extracted proxy commands to a module
2024-11-21 22:23:56 +04:00
Igor Alexandrov
4d8241ebab
Fixed kamal-proxy remove command
2024-11-21 22:23:56 +04:00
Igor Alexandrov
86657b0172
Fixed kamal-proxy remove command
2024-11-21 22:23:56 +04:00
Igor Alexandrov
aa2906086a
Added host to the expected accessory deploy command result
2024-11-21 22:23:56 +04:00
Igor Alexandrov
f4b7c886fb
Added tests for accessory deploy and remove commands
2024-11-21 22:23:56 +04:00
Igor Alexandrov
4c778de2d9
Added tests for accessory configuration with proxy
2024-11-21 22:23:56 +04:00
Igor Alexandrov
70d2c71734
Added commands to deploy accessory to kamal-proxy
2024-11-21 22:23:56 +04:00
Ali Ismayilov
ac90ee068f
Prefer dasherized notation
2024-11-21 18:54:34 +01:00
Ali Ismayilov
75b44cd328
Capture logs for specific container_id
2024-11-21 18:54:34 +01:00
Ali Ismayilov
183fe9e06e
Follow logs of a specific container
2024-11-21 18:05:56 +01:00
Ali Ismayilov
1da882bb01
Enable logging on app exec new containers
2024-11-21 18:05:55 +01:00
Ali Ismayilov
c662b8d578
Make --detach incompatible with reuse or interactive
2024-11-21 18:05:55 +01:00
Ali Ismayilov
dbe0c3a7f8
Allow running detached app commands
...
this is useful for long running rake tasks or scripts
that can be run without having to keep open connection to the server.
Example:
```
kamal app exec 'bin/rails db:backfill_task' --detach
```
2024-11-21 18:05:55 +01:00
Donal McBreen
b9804a07aa
Merge pull request #1239 from matjack1/output-accessory
...
Add support for exec output in accessories
2024-11-21 16:57:17 +00:00
Donal McBreen
f4d98bb67a
Merge pull request #1225 from matthewbjones/feature/sbom-attestations
...
Adds support for SBOM attestations
2024-11-21 16:21:41 +00:00
Donal McBreen
42c3425411
Merge pull request #1235 from basecamp/support-line-filtering
...
Support line filtering when running tests
2024-11-21 15:26:25 +00:00
Donal McBreen
57e48a33bb
Merge pull request #1141 from justindell/feat-add-aws-secrets-manager-adapter
...
feat: add secrets adapter for aws secrets manager
2024-11-21 15:03:54 +00:00
Donal McBreen
4acb78fff6
Merge pull request #1099 from mrbongiolo/feat-secrets-add-doppler-adapter
...
feat(secrets): add Doppler adapter
2024-11-21 15:03:36 +00:00
Donal McBreen
1a86b3ae6e
Merge pull request #1196 from tiramizoo/role-accessories-msg
...
Improve error on unknown role in accessories config.
2024-11-21 15:02:48 +00:00
Donal McBreen
a4ab34d8d9
Merge pull request #1170 from davidstosik/sto/spaces
...
Remove trailing spaces from deploy.yml template
2024-11-21 14:52:35 +00:00
Donal McBreen
24d03fd60e
Merge pull request #1105 from igor-alexandrov/ruby-version-example
...
Updated deploy.yml template to fetch the Ruby version automatically
2024-11-21 14:50:11 +00:00
Matteo Giaccone
83fd2a051d
Add support for exec output in accessories
...
When running accessory exec now you get the output from the hosts.
Also you can pass commands with arguments and it will work
e.g.: cat yourfilename
2024-11-21 11:06:36 +01:00
André Laszlo
a07ef64fad
Fix --account documentation
2024-11-20 15:27:51 +01:00
André Laszlo
3793bdc2c3
Add GCP Secret Manager adapter
2024-11-20 14:10:20 +01:00
Lewis Buckley
72f30774ba
Support line filtering when running tests
2024-11-20 11:56:58 +00:00
Federico
3fa9cd5a41
Make kamal use ssh keys from config when performing commands
2024-11-19 11:38:42 +01:00
Matthew Jones
c970ceebe3
Adds support for SBOM attestations
2024-11-18 13:01:53 -07:00
Aleksandr Lossenko
79bc7584ca
make --account optional and pass Enpass vault in --from
2024-11-14 09:16:23 +01:00
Aleksandr Lossenko
c9dec8c79a
no need for open3 anymore
2024-11-14 09:16:23 +01:00
Aleksandr Lossenko
8d7a6403b5
enpass-cli now has JSON support
2024-11-14 09:16:23 +01:00
Aleksandr Lossenko
b356b08069
improve password parsing
2024-11-14 09:16:23 +01:00
Aleksandr Lossenko
4d09f3c242
add more docs
2024-11-14 09:16:23 +01:00
Aleksandr Lossenko
d6c4411e97
add support to enpass
2024-11-14 09:16:23 +01:00
Ralf Schmitz Bongiolo
8dd864af89
refactor(secrets): adapter/test_optional_account inherit from adapter/test
2024-11-05 14:14:18 -04:00
Wojciech Wnętrzak
e4ab2a0d24
Improve error on unknown role in accessories config.
...
Previously when unknown role (or with typo) was placed in accessories.roles,
this error was thrown: `ERROR (NoMethodError): undefined method `hosts' for nil`.
2024-11-05 14:42:17 +01:00
Ralf Schmitz Bongiolo
3069552315
feat(secrets): update doppler adapter to use --from option and DOPPLER_TOKEN env
2024-11-04 19:00:38 -04:00
Ralf Schmitz Bongiolo
77cd29f5ad
feat(cli): update secrets --account flag as optional depending on adapter
2024-11-04 18:59:37 -04:00
Ralf Schmitz Bongiolo
d0d9dfcba9
Merge branch 'basecamp:main' into main
2024-11-04 16:26:12 -04:00
Justin Dell
b4d395cec9
shell escape account name in cli command
2024-11-04 09:46:45 -06:00
Justin Dell
e266945413
implement check_dependencies!
2024-11-04 09:18:56 -06:00
Justin Dell
c9fff3cb40
rename secretsmanager to secrets manager
2024-11-04 09:14:47 -06:00
Justin Dell
cef1e53f84
Merge branch 'basecamp:main' into feat-add-aws-secrets-manager-adapter
2024-11-04 09:06:04 -06:00
Donal McBreen
9cf8da64c4
Merge pull request #1193 from basecamp/filter-by-no-destination
...
Filter correctly for empty destinations
2024-11-04 11:14:42 +00:00
Donal McBreen
e9ba92386c
Filter correctly for empty destinations
...
An empty destination should only filter container with empty
destination, not pick up all containers.
Fixes: https://github.com/basecamp/kamal/issues/1184
2024-11-04 11:05:24 +00:00
Donal McBreen
685312c9f8
Bump version for 2.3.0
2024-10-31 09:14:29 +00:00
Donal McBreen
ca5e53404b
Merge pull request #1175 from basecamp/proxy-0.8.2
...
Bump proxy minimum version to 0.8.2
2024-10-31 08:13:18 +00:00
Nick Hammond
9ac3d57b29
Add default creation time to now for image
2024-10-30 06:25:12 -07:00
Donal McBreen
2c14f48300
Bump proxy minimum version to 0.8.2
...
Detect event-stream content type properly
See: https://github.com/basecamp/kamal-proxy/releases/tag/v0.8.2
2024-10-30 08:06:52 +00:00
dependabot[bot]
cd4e183213
Bump rexml from 3.3.6 to 3.3.9 in the bundler group across 1 directory ( #1173 )
...
Bumps the bundler group with 1 update in the / directory: [rexml](https://github.com/ruby/rexml ).
Updates `rexml` from 3.3.6 to 3.3.9
- [Release notes](https://github.com/ruby/rexml/releases )
- [Changelog](https://github.com/ruby/rexml/blob/master/NEWS.md )
- [Commits](https://github.com/ruby/rexml/compare/v3.3.6...v3.3.9 )
---
updated-dependencies:
- dependency-name: rexml
dependency-type: indirect
dependency-group: bundler
...
Signed-off-by: dependabot[bot] <support@github.com >
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-29 01:39:47 -07:00
Nick Hammond
8354fbee06
Merge branch 'buildpacks' of github.com:nickhammond/kamal into buildpacks
2024-10-28 08:26:55 -07:00
Nick Hammond
cde5c7abbf
Catch up with main
2024-10-28 08:26:40 -07:00
David Stosik
7e8a8eb6e5
Remove trailing spaces from deploy.yml template
...
Just a minor cleanup, nothing important.
`git` highlighted these spaces in red in my commit so I thought I'd
remove them.
2024-10-27 23:38:45 +09:00
Donal McBreen
2465681408
Merge pull request #1151 from basecamp/net-ssh-7.3.0
...
Ensure using at least net-ssh 7.3.0
2024-10-25 16:16:18 +01:00
Donal McBreen
b917d7cd40
Merge pull request #1152 from basecamp/skip-log-max-size
...
Allow log max size to not be set
2024-10-25 08:55:18 +01:00
Donal McBreen
1980a79e73
Update lib/kamal/cli/proxy.rb
...
Co-authored-by: Sijawusz Pur Rahnama <sija@sija.pl >
2024-10-25 08:10:25 +01:00
Donal McBreen
347eb69350
Merge pull request #994 from honzasterba/bw_fetch_all_fields
...
[bitwarden] ability to fetch all fields from an item
2024-10-23 16:32:39 +01:00
Donal McBreen
9a8a45015b
Allow log max size to not be set
...
The max-size log opt is not valid for all logging drivers, such as
syslog. Allow the option to be removed from the boot config with:
```
kamal proxy boot_config set --log-max-size=
or
kamal proxy boot_config set --log-max-size=""
```
2024-10-23 15:21:06 +01:00
Donal McBreen
8d0f4903ae
Ensure using at least net-ssh 7.3.0
...
This has support for aes(128|256)gcm ciphers and some fixes for
Ruby 3.3.
2024-10-23 14:58:36 +01:00
Donal McBreen
57d582e3bc
Merge pull request #972 from kohkimakimoto/dev-provenance-flag
...
Add provenance option
2024-10-23 14:07:19 +01:00
Donal McBreen
bf8779cef4
Merge pull request #950 from admtnnr/fix-registry-cache-options
...
builder/cache/options: fix order of build args when using registry
2024-10-23 13:59:59 +01:00
Jan Sterba
7142534e77
[bitwarden] ability to fetch all fields from an item
...
Sometimes a projects has a lot of secrets (more than 10). And its
cumbersome to write $(kama secrets fetch ...) with a lot of field
names.
I want to be able to just fetch all the fields from a given item
and then just use these with $(kamal extract NAME)
2024-10-23 13:28:37 +01:00
Donal McBreen
0f97e0b056
Merge pull request #1114 from alanoliveira/main
...
prevent escape '#' when generating env_file string
2024-10-23 12:35:07 +01:00
Donal McBreen
bd8c35b194
Merge pull request #1020 from igor-alexandrov/network-args
...
Allow to override network
2024-10-23 12:22:36 +01:00
Donal McBreen
35075e2e4d
Merge pull request #1136 from aidanharan/secrets-files-not-found-message
...
Updated secrets error message if secrets files do not exist
2024-10-23 11:14:41 +01:00
Donal McBreen
53dad5f54f
Merge pull request #1121 from kylerippey/adapter-cli-installation-checks
...
Raise meaningful error messages when secret adapter CLIs are not installed
2024-10-23 11:12:50 +01:00
Donal McBreen
66f6e8b576
Merge pull request #1045 from junket/allow-false-env-var-value
...
Allow false env var value
2024-10-23 11:11:43 +01:00
Alan Oliveira
a3f5830728
improve test legibility
2024-10-23 08:06:27 +09:00
Donal McBreen
a3e5505bb2
Merge pull request #1117 from pardeyke/add_proxy_reboot_info
...
Added `kamal proxy reboot` to raised error message
2024-10-22 17:26:36 +01:00
Donal McBreen
fdf8ef1343
Merge pull request #1144 from basecamp/zeitwerk-2.7
...
Require zeitwerk 2.6.18
2024-10-22 15:03:45 +01:00
Donal McBreen
3ee45d7b30
Require zeitwerk 2.6.12
...
We were requiring Zeitwerk 2.5+, but calling eager_load_namespace
which was added in 2.6.2.
Fixes: https://github.com/basecamp/kamal/issues/1109
2024-10-22 13:01:36 +01:00
Justin Dell
6856742eca
add secrets adapter for aws secrets manager
2024-10-21 09:19:06 -05:00
Aidan Haran
c320343bb2
Updated secrets error message if secrets files do not exist
2024-10-19 20:01:00 +01:00
Nick Hammond
1ebc8b8daa
Merge branch 'basecamp:main' into buildpacks
2024-10-17 07:58:35 -07:00
Nick Hammond
145b73c4f0
Add a no-op remove method for pack
2024-10-17 07:54:17 -07:00
Nick Hammond
d538447973
Add validator for buildpack arch
2024-10-17 07:46:45 -07:00
dependabot[bot]
74a06b0ccd
Bump actionpack in the bundler group across 1 directory ( #1127 )
...
Bumps the bundler group with 1 update in the / directory: [actionpack](https://github.com/rails/rails ).
Updates `actionpack` from 7.1.3.4 to 7.1.4.1
- [Release notes](https://github.com/rails/rails/releases )
- [Changelog](https://github.com/rails/rails/blob/v7.2.1.1/actionpack/CHANGELOG.md )
- [Commits](https://github.com/rails/rails/compare/v7.1.3.4...v7.1.4.1 )
---
updated-dependencies:
- dependency-name: actionpack
dependency-type: indirect
dependency-group: bundler
...
Signed-off-by: dependabot[bot] <support@github.com >
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-16 11:30:14 -07:00
dependabot[bot]
c0ca5e6dbb
Bump rexml from 3.3.4 to 3.3.6 in the bundler group across 1 directory ( #1126 )
...
Bumps the bundler group with 1 update in the / directory: [rexml](https://github.com/ruby/rexml ).
Updates `rexml` from 3.3.4 to 3.3.6
- [Release notes](https://github.com/ruby/rexml/releases )
- [Changelog](https://github.com/ruby/rexml/blob/master/NEWS.md )
- [Commits](https://github.com/ruby/rexml/compare/v3.3.4...v3.3.6 )
---
updated-dependencies:
- dependency-name: rexml
dependency-type: indirect
dependency-group: bundler
...
Signed-off-by: dependabot[bot] <support@github.com >
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-16 11:29:59 -07:00
dependabot[bot]
6f08750c3e
Bump webrick from 1.8.1 to 1.8.2 in the bundler group across 1 directory ( #1125 )
...
Bumps the bundler group with 1 update in the / directory: [webrick](https://github.com/ruby/webrick ).
Updates `webrick` from 1.8.1 to 1.8.2
- [Release notes](https://github.com/ruby/webrick/releases )
- [Commits](https://github.com/ruby/webrick/compare/v1.8.1...v1.8.2 )
---
updated-dependencies:
- dependency-name: webrick
dependency-type: indirect
dependency-group: bundler
...
Signed-off-by: dependabot[bot] <support@github.com >
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-16 11:29:41 -07:00
Jonas Pardeyke
e362b0106a
changed text
2024-10-16 09:08:30 +02:00
Kyle Rippey
8cec17dd05
Made secret adapters raise a meaningful error if the required CLI is not installed
2024-10-15 23:20:18 -07:00
Jonas Pardeyke
0f3786781b
added kamal proxy reboot to raised error
2024-10-15 22:47:08 +02:00
Alan Oliveira
844e3acf50
prevent escape '#' when generating env_file string
2024-10-15 14:57:53 +09:00
Nick Hammond
4822a9d950
Merge branch 'basecamp:main' into buildpacks
2024-10-14 16:58:16 -07:00
Nick Hammond
1d55c5941b
Add in pack builder inspect for configured builder
2024-10-14 16:57:51 -07:00
David Heinemeier Hansson
607368121e
Merge pull request #1079 from jjatinggoyal/valkey
...
Switch Redis to Valkey in deploy template and tests
2024-10-13 19:31:12 +02:00
Puru
0f16ba1995
Upgrade Ruby base image from 3.2.0 to 3.3.x ( #1107 )
...
* Upgrade ruby base image to fix HIGH and CRITICAL CVEs
* Float on latest 3.3.x
---------
Co-authored-by: Jeremy Daer <jeremydaer@gmail.com >
2024-10-13 10:07:09 -07:00
Jatin Goyal
f3b8a59133
Use valkey for redis image in deploy template
2024-10-13 22:04:03 +05:30
Igor Alexandrov
b4df51b8b4
Added example how to read the Ruby version from the .ruby-version file.
2024-10-12 21:27:56 +04:00
David Heinemeier Hansson
bf79c7192f
Clearer still
2024-10-11 10:40:37 -07:00
David Heinemeier Hansson
cb82767d0f
Clarify proxy settings
2024-10-11 10:39:58 -07:00
Ralf Schmitz Bongiolo
3c91a83942
feat(secrets): add Doppler adapter
2024-10-10 21:41:09 -04:00
Donal McBreen
5cb9fb787b
Bump version for 2.2.2
2024-10-10 13:29:38 -04:00
Donal McBreen
493c5690f1
Merge pull request #1066 from davidstosik/v2.1.1/path-space-fix
...
Support spaces in git repository path
2024-10-10 10:17:00 -04:00
Donal McBreen
5de55a22ff
Merge pull request #1088 from emmceemoore/patch-1
...
Typo fix.
2024-10-10 10:16:01 -04:00
Nick Pezza
a1e40f9fec
Update to be able to run on 3.4 with frozen strings ( #1080 )
...
* Update to be able to run on 3.4 with frozen strings
---------
Co-authored-by: Jeremy Daer <jeremydaer@gmail.com >
Co-authored-by: Sijawusz Pur Rahnama <sija@sija.pl >
2024-10-09 21:11:06 -04:00
Mike Moore
7ddf3bcb02
Typo fix.
2024-10-09 17:34:42 -06:00
Donal McBreen
3654a7e1be
Bump version for 2.2.1
2024-10-09 14:46:44 -04:00
Donal McBreen
6a7783c979
Merge pull request #1086 from basecamp/proxy-1.8.1
...
Bump proxy to version 0.8.1
2024-10-09 14:46:09 -04:00
Donal McBreen
7dc2609b77
Merge pull request #1082 from graysonchen/patch-1
...
ERROR (ArgumentError): Unknown boot_config subcommand clear
2024-10-09 14:03:07 -04:00
Donal McBreen
74960499c0
Bump proxy to version 0.8.1
...
Fixes issue where incorrect status code may be returned when buffering
responses.
https://github.com/basecamp/kamal-proxy/releases/tag/v0.8.1
2024-10-09 14:00:38 -04:00
Igor Alexandrov
69b13ebc6a
Renamed NETWORK to DEFAULT_NETWORK
2024-10-09 10:00:57 +04:00
Igor Alexandrov
da2a543cbc
Reverted network arguments everywhere except to accessory config
2024-10-09 10:00:49 +04:00
Igor Alexandrov
08dacd2745
Added command tests
2024-10-09 09:53:25 +04:00
Igor Alexandrov
b6a10df56a
Added tests for network configuration option
2024-10-09 09:53:25 +04:00
Igor Alexandrov
c917dd82cf
Added network_args to proxy configuration
2024-10-09 09:53:25 +04:00
Igor Alexandrov
f04cae529a
Added network configuration option to application, proxy and accessory sections
2024-10-09 09:53:17 +04:00
Grayson Chen
50c96e36c0
typo clear change to reset
...
kamal proxy boot_config clear
ERROR (ArgumentError): Unknown boot_config subcommand clear
2024-10-09 00:11:54 +08:00
Donal McBreen
7b48648bf2
Bump version for 2.2.0
2024-10-08 08:59:23 -04:00
Donal McBreen
91df935d05
Merge pull request #1076 from basecamp/active-support-require-for-to-sentence
...
Add Active Support require for to_sentence
2024-10-08 07:46:53 -04:00
Donal McBreen
bbfcbfa94b
Merge pull request #1064 from basecamp/kamal-proxy-0.8.0
...
Update to kamal-proxy 0.8.0
2024-10-08 07:42:48 -04:00
Donal McBreen
440044b900
Merge pull request #1072 from basecamp/proxy-default-10m-logs
...
Default to keeping 10m of proxy logs
2024-10-08 07:35:38 -04:00
Donal McBreen
06419f8749
Add Active Support require for to_sentence
...
Fixes: https://github.com/basecamp/kamal/issues/1061
2024-10-08 07:33:03 -04:00
David Stosik
8d6d7ffed0
s/refute_match/assert_no_match/
2024-10-08 07:10:08 +09:00
Donal McBreen
67ce1912f7
Default to keeping 10m of proxy logs
...
Match the defaults for the application containers of 10m of logs.
Allow them to be altered with the proxy boot_config set command.
2024-10-07 16:20:40 -04:00
David Stosik
f45c754e53
Remove unnecessary method
2024-10-07 15:46:04 +09:00
David Stosik
d40057286d
Escape more paths and write a test
2024-10-07 15:46:04 +09:00
David Stosik
0840fdf0dd
Support spaces in git repository path
...
See https://github.com/basecamp/kamal/issues/1036
2024-10-07 15:46:04 +09:00
Donal McBreen
a434b10bfd
Update to kamal-proxy 0.8.0
...
Proxy changes:
- Add option to use custom TLS certificates (#17 )
- Don't buffer SSE responses (#36 )
- Allow routing to wildcard subdomains (#45 )
Custom TLS certificates not supported in Kamal itself yet. Buffering
SSE responses and wildcard subdomains will work without any Kamal
changes.
2024-10-06 13:48:00 -04:00
Donal McBreen
e34031f70c
Bump version for 2.1.2
2024-10-06 13:40:53 -04:00
Donal McBreen
23898a5197
Merge pull request #1062 from basecamp/skip-proxy-flag-ssl-false
...
Skip setting the proxy flag when ssl is false
2024-10-06 18:32:45 +01:00
Donal McBreen
1e9c9e9103
Skip setting the proxy flag when ssl is false
...
Fixes: https://github.com/basecamp/kamal/issues/1037
2024-10-06 13:22:43 -04:00
David Heinemeier Hansson
4b2c9cdc72
Merge pull request #1026 from ehutzelman/patch-1
...
Update init description for kamal secrets
2024-10-05 01:54:08 +02:00
David Heinemeier Hansson
80191588c2
Merge pull request #1050 from tiramizoo/template-docker-setup
...
Update sample template for docker setup hook.
2024-10-05 01:46:09 +02:00
David Heinemeier Hansson
5ca806f4d3
Merge pull request #1054 from tuladhar/cloudflare-ssl
...
Clarify SSL comment when using Cloudflare
2024-10-04 21:03:23 +02:00
Puru
1d04a6644f
Clarify SSL comment when using Cloudflare
2024-10-05 00:45:04 +05:45
Wojciech Wnętrzak
950624d667
Update sample template for docker setup hook.
...
"kamal" network is already created (in v2.0) so the sample code is
no longer accurate.
2024-10-04 09:27:17 +02:00
David Heinemeier Hansson
81f3508507
Bump version for 2.1.1
2024-10-03 11:39:56 -07:00
David Heinemeier Hansson
9a16873f21
Merge pull request #1035 from basecamp/fix-kamal-setup-on-accessory-hosts
...
Restore kamal setup to accessory hosts
2024-10-03 19:25:33 +02:00
junket
6d1d7a4c82
Updates argumentize test for false values
2024-10-03 10:05:54 -04:00
junket
ccf32c2c1f
Pass false values in env vars to docker
2024-10-03 09:31:30 -04:00
David Heinemeier Hansson
e5ca53db6e
Use new deploy config so as not to update all other tests
2024-10-02 17:34:13 -07:00
David Heinemeier Hansson
82a436fa02
Rubocop
2024-10-02 17:07:51 -07:00
David Heinemeier Hansson
7be2e7e0ba
Test accessory_hosts with roles and without filtering
2024-10-02 17:03:30 -07:00
David Heinemeier Hansson
4f7ebd73a3
Specifics#accessory_hosts was being filtered out by role host check
2024-10-02 16:30:32 -07:00
Nick Hammond
89b44153bb
Ensure build args and secrets are used with pack
2024-10-02 09:55:57 -07:00
Nick Hammond
5482052e19
Merge branch 'basecamp:main' into buildpacks
2024-10-02 08:59:41 -07:00
Donal McBreen
279bda2770
Bump version for 2.1.0
2024-10-02 11:35:45 +01:00
Donal McBreen
aa15fa532a
Merge pull request #1024 from jeromedalbert/follow-primary-role
...
Follow logs on primary role by default
2024-10-02 09:29:16 +01:00
Donal McBreen
276b469c2b
Merge pull request #1019 from nickhammond/ENV/destination
...
Set KAMAL_DESTINATION when loading config
2024-10-02 09:28:01 +01:00
Donal McBreen
c10b3fb07a
Merge pull request #908 from basecamp/ignorable-ssh-config
...
SSH: allow setting `config: false` to ignore local user `~/.ssh/config`
2024-10-02 08:28:57 +01:00
Eric Hutzelman
0ff1450a74
Update init description for kamal secrets
...
No longer uses .env stub, replace with secrets stub in .kamal directory.
2024-10-01 18:49:08 -05:00
Nick Hammond
dda8efe39a
Point to project.toml in docs
2024-10-01 14:08:26 -07:00
Nick Hammond
c60124188f
Merge branch 'basecamp:main' into buildpacks
2024-10-01 13:59:22 -07:00
Jerome Dalbert
f47fd13e5b
Follow logs on primary role by default
...
Do not default `kamal app logs -f` to use the hardcoded “web” role;
instead use the primary role, which can be different from “web”.
2024-10-01 13:51:09 -07:00
Adam Tanner
256933f6f3
builder/cache/options: fix order of build args when using registry
2024-10-01 12:27:45 -04:00
Nick Hammond
1d8c40f5d2
Run RC
2024-10-01 08:20:21 -07:00
Nick Hammond
73c78079bc
Set KAMAL_DESTINATION when loading config
2024-10-01 08:16:52 -07:00
Donal McBreen
cd12f95a97
Merge pull request #1018 from basecamp/kamal-proxy-deploy-equals-in-args
...
Use `=` in kamal-proxy deploy command args
2024-10-01 15:51:43 +01:00
Donal McBreen
641e9056b3
Use = in kamal-proxy deploy command args
...
`=` is required for boolean values and works for all values.
2024-10-01 15:42:12 +01:00
Donal McBreen
b4bcf35f78
Merge pull request #1000 from kpumuk/hosts
...
Allow specifying multiple hosts for kamal-proxy via an array
2024-09-30 10:26:15 -04:00
Donal McBreen
7f6095c9eb
Merge pull request #1009 from basecamp/secrets-print
...
Add `kamal secrets print` for secret debugging
2024-09-30 09:55:53 -04:00
Donal McBreen
ef1271df47
Merge pull request #1010 from basecamp/kamal-proxy-0-7-0
...
Added support for ACME `http-01` challenges
2024-09-30 09:55:34 -04:00
Donal McBreen
df1232d90f
Added support for ACME http-01 challenges
...
Update to kamal-proxy 0.7.0 for ACME `http-01` challenge support.
2024-09-30 14:44:28 +01:00
Dmytro Shteflyuk
e75365c8c6
Simplified deploy options for kamal-proxy as it supports multiple --host arguments
2024-09-30 08:09:05 -04:00
Donal McBreen
e441399255
Add kamal secrets print for secret debugging
...
Dotenv's variable substitution doesn't work the same way as commands run
in the shell. It needs values to be escaped.
```sh
$ cat /tmp/env
SECRETS=$(cat /tmp/json)
SECRETS2=$(echo $SECRETS | jq)
$ cat /tmp/json
\{\ \"foo\"\ :\ \"bar\" \}
$ SECRETS=$(cat /tmp/json)
$ SECRETS2=$(echo $SECRETS | jq)
jq: parse error: Invalid numeric literal at line 1, column 2
$ ruby -e 'require "dotenv"; puts Dotenv.parse("/tmp/env")["SECRETS2"]'
{
"foo": "bar"
}
```
Since you then can't use the shell to debug, `kamal secrets print` will
allow you to see what the secrets will be set to.
2024-09-30 12:28:29 +01:00
Donal McBreen
af992ce755
Merge pull request #996 from iximiuz/patch-1
...
Fix git --add safe.directory command in Dockerfile
2024-09-30 04:36:00 -04:00
Donal McBreen
32caf4b148
Merge pull request #995 from honzasterba/bw_nicer_error_message_on_non_field_fetch
...
[bitwarden] default fetch raises NoMethodError
2024-09-30 04:35:48 -04:00
Donal McBreen
28a02262df
Merge pull request #988 from igor-alexandrov/kamal-proxy-remove-no-target
...
Fixed kamal-proxy remove command
2024-09-30 04:18:12 -04:00
Donal McBreen
b11fb93a6c
Merge pull request #971 from igor-alexandrov/add-app-port-example
...
Added app_port example to the proxy section
2024-09-30 04:16:34 -04:00
Dmytro Shteflyuk
67ad7662ab
Simplified proxy hosts validation and documentation, similar to accessory config
2024-09-29 20:56:23 -04:00
Dmytro Shteflyuk
c63ec39f07
Added a test for colliding hosts passed via hosts array
2024-09-29 20:56:23 -04:00
Dmytro Shteflyuk
8df7d7d92d
Do not allow both host and hosts for proxy configuration
2024-09-29 20:43:44 -04:00
Dmytro Shteflyuk
1d48a0fb0a
Allow specifying multiple hosts for kamal proxy via an array
2024-09-29 20:43:44 -04:00
David Heinemeier Hansson
f331605efa
Merge pull request #1004 from kpumuk/grammar
...
Backporting changes to the documentation committed directly to kamal-site
2024-09-30 02:22:39 +02:00
Dmytro Shteflyuk
7ea995db91
Added a comment to the front matter of the configuration docs about the generator
2024-09-29 15:33:06 -04:00
Dmytro Shteflyuk
994a8faf6b
Re-applied corrections to configuration YAML files that were merged directly into kamal-site
2024-09-29 15:33:06 -04:00
Dmytro Shteflyuk
6c75fe40df
Removed second newline characters after the section title
2024-09-29 15:33:06 -04:00
Dmytro Shteflyuk
7567cae964
Added empty lines around YAML code fences
2024-09-29 15:33:06 -04:00
Dmytro Shteflyuk
ecd842ab9b
'Configuration overview' section was moved to overview.md file
2024-09-29 15:33:06 -04:00
Dmytro Shteflyuk
91ae1dd7b9
Removed unused variable from bin/doc
2024-09-29 15:33:06 -04:00
Ivan Velichko
0f815e17e4
Relax the safe.directory requirement
...
Co-authored-by: Jeremy Daer <jeremydaer@gmail.com >
2024-09-28 18:00:10 +02:00
Ivan Velichko
a310aa8fef
Fix git --add safe.directory command in Dockerfile
...
Upgrading kamal from `v1.8.3` to `v1.9.0` broke my [kamal playground](https://labs.iximiuz.com/playgrounds/kamal ):
```
laborant@dev-machine:~/svc-a$ kamal setup
INFO [34d0def6] Running /usr/bin/env mkdir -p .kamal on 172.16.0.3
INFO [c34cf833] Running /usr/bin/env mkdir -p .kamal on 172.16.0.4
INFO [34d0def6] Finished in 0.147 seconds with exit status 0 (successful).
INFO [c34cf833] Finished in 0.204 seconds with exit status 0 (successful).
Acquiring the deploy lock...
Ensure Docker is installed...
INFO [413ee426] Running docker -v on 172.16.0.4
INFO [f1acacba] Running docker -v on 172.16.0.3
INFO [413ee426] Finished in 0.036 seconds with exit status 0 (successful).
INFO [f1acacba] Finished in 0.076 seconds with exit status 0 (successful).
Log into image registry...
INFO [94cff492] Running docker login registry.iximiuz.com -u [REDACTED] -p [REDACTED] on localhost
INFO [94cff492] Finished in 0.077 seconds with exit status 0 (successful).
INFO [605c535f] Running docker login registry.iximiuz.com -u [REDACTED] -p [REDACTED] on 172.16.0.4
INFO [6002b598] Running docker login registry.iximiuz.com -u [REDACTED] -p [REDACTED] on 172.16.0.3
INFO [605c535f] Finished in 0.083 seconds with exit status 0 (successful).
INFO [6002b598] Finished in 0.083 seconds with exit status 0 (successful).
Build and push app image...
INFO [9d172b1e] Running docker --version && docker buildx version on localhost
INFO [9d172b1e] Finished in 0.059 seconds with exit status 0 (successful).
INFO Cloning repo into build directory `/tmp/kamal-clones/svc-a-2f65914456263/workdir/`...
INFO [26fb1bd3] Running /usr/bin/env git -C /tmp/kamal-clones/svc-a-2f65914456263 clone /workdir --recurse-submodules on localhost
ERROR Error preparing clone: Failed to clone repo: git exit status: 32768
git stdout: Nothing written
git stderr: Cloning into 'workdir'...
fatal: detected dubious ownership in repository at '/workdir/.git'
To add an exception for this directory, call:
git config --global --add safe.directory /workdir/.git
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
, deleting and retrying...
INFO Cloning repo into build directory `/tmp/kamal-clones/svc-a-2f65914456263/workdir/`...
INFO [fd4aac0c] Running /usr/bin/env git -C /tmp/kamal-clones/svc-a-2f65914456263 clone /workdir --recurse-submodules on localhost
Finished all in 0.3 seconds
Releasing the deploy lock...
Finished all in 0.6 seconds
ERROR (SSHKit::Command::Failed): git exit status: 32768
git stdout: Nothing written
git stderr: Cloning into 'workdir'...
fatal: detected dubious ownership in repository at '/workdir/.git'
To add an exception for this directory, call:
git config --global --add safe.directory /workdir/.git
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
laborant@dev-machine:~/svc-a$ kamal version
2.0.0
```
I checked the [v1.8.3...v1.9.0](https://github.com/basecamp/kamal/compare/v1.8.3...v1.9.0 ) diff, and couldn't find anything even remotely related to the above error.
Then I checked the `git` versions in kamal `v1.8.3` and `v1.9.0` images:
```
docker run -it --rm --entrypoint sh ghcr.io/basecamp/kamal:v1.8.3
/workdir # git --version
git version 2.38.5
```
vs.
```
docker run -it --rm --entrypoint sh ghcr.io/basecamp/kamal:v2.0.0
/workdir # git --version
git version 2.39.5
```
Apparently, something changed in between `2.38.5` and `2.39.5` git releases (likely yet another CVE fix), and the `git config --global --add safe.directory /workdir` stopped working.
Here is the mitigation I currently use, but it's a bit awkward to do it:
```
docker build -t ghcr.io/basecamp/kamal:v2.0.0 - <<EOF
FROM ghcr.io/basecamp/kamal:v2.0.0
RUN git config --global --add safe.directory /workdir/.git
EOF
```
Hence, this PR.
To repro, you can start a [kamal playground](https://labs.iximiuz.com/playgrounds/kamal ), then `docker pull ghcr.io/basecamp/kamal:v2.0.0` to override my patched image, and `cd svc-a && kamal setup`.
2024-09-28 14:23:30 +02:00
Jan Sterba
29b02f5c30
[bitwarden] default fetch raises NoMethodError
...
When fetched item is not a login, Bitwarden adapter raises NoMethodError
because the returned JSON does not have the login.password value.
Add a nicer error message for that case.
2024-09-28 13:24:14 +02:00
Nick Hammond
f7147e07d4
Merge branch 'basecamp:main' into buildpacks
2024-09-27 18:46:49 -04:00
Igor Alexandrov
6d63c4e9c6
Fixed example with the proxy status after the application has been removed
2024-09-27 21:11:51 +04:00
Igor Alexandrov
472d163cc7
Assert 404 after app is stopped
2024-09-27 19:15:42 +04:00
Igor Alexandrov
dadac999d7
Fixed kamal-proxy remove call
2024-09-27 17:45:35 +04:00
Donal McBreen
5036f8843f
Merge pull request #986 from basecamp/rails-8-requires-ruby-3.2
...
Rails 8 doesn't support Ruby 3.1
2024-09-27 08:23:32 -04:00
Donal McBreen
14d0396581
Rails 8 doesn't support Ruby 3.1
...
Remove it from the build matrix as its no longer a supported combination.
2024-09-27 08:13:24 -04:00
Nick Hammond
71741742ff
Merge branch 'basecamp:main' into buildpacks
2024-09-27 00:19:45 -04:00
Donal McBreen
8c32e6af07
Bump version for 2.0.0
2024-09-26 15:34:24 -04:00
Donal McBreen
a765c501a3
Bump version for 2.0.0.rc4
2024-09-26 07:06:51 -04:00
Donal McBreen
ae990efd02
Merge pull request #978 from basecamp/ignore-ssl-false
...
Handle ssl: false in proxy config
2024-09-26 11:56:00 +01:00
Donal McBreen
b3a6921118
Handle ssl: false in proxy config
...
Fixes: https://github.com/basecamp/kamal/issues/956
2024-09-26 06:17:45 -04:00
Donal McBreen
325bf9a797
Merge pull request #975 from basecamp/kamal-proxy-0.6.0
...
Bump to latest version of kamal-proxy
2024-09-25 23:03:25 +01:00
Donal McBreen
7bdf6cd2e8
Bump to latest version of kamal-proxy
2024-09-25 17:54:38 -04:00
Kohki Makimoto
92d82dd1a7
test: If the provenance is false, output "--provenance false".
2024-09-26 05:50:51 +09:00
Donal McBreen
7633fe0293
Merge pull request #974 from basecamp/proxy-boot-config
...
Proxy boot config
2024-09-25 20:28:24 +01:00
Donal McBreen
f6851048a6
Proxy boot config
...
Add commands for managing proxy boot config. Since the proxy can be
shared by multiple applications, the configuration doesn't belong in
`config/deploy.yml`.
Instead you can set the config with:
```
Usage:
kamal proxy boot_config <set|get|clear>
Options:
[--publish], [--no-publish], [--skip-publish] # Publish the proxy ports on the host
# Default: true
[--http-port=N] # HTTP port to publish on the host
# Default: 80
[--https-port=N] # HTTPS port to publish on the host
# Default: 443
[--docker-options=option=value option2=value2] # Docker options to pass to the proxy container
```
By default we boot the proxy with `--publish 80:80 --publish 443:443`.
You can stop it from publishing ports, specify different ports and pass
other docker options.
The config is stored in `.kamal/proxy/options` as arguments to be passed
verbatim to docker run.
Where someone wants to set the options in their application they can do
that by calling `kamal proxy boot_config set` in a pre-deploy hook.
There's an example in the integration tests showing how to use this to
front kamal-proxy with Traefik, using an accessory.
2024-09-25 15:15:26 -04:00
Donal McBreen
f0d7f786fa
Traefik should be kamal-proxy in reboot hooks
2024-09-25 14:51:22 -04:00
Donal McBreen
4d8387b1c9
Merge pull request #973 from eroluysal/main
...
Fix adapter names
2024-09-25 19:48:40 +01:00
eroluysal
0258ac4297
Fix adapter names.
2024-09-25 21:22:59 +03:00
Kohki Makimoto
c17bdba61c
add tests
2024-09-25 23:50:05 +09:00
Kohki Makimoto
13328687d1
support the "provenance" option in the "builder" config
2024-09-25 23:24:52 +09:00
Igor Aleksandrov
2b0810d063
Update lib/kamal/cli/templates/deploy.yml
...
Co-authored-by: Nick Hammond <nick@nickhammond.com >
2024-09-25 17:19:20 +04:00
Igor Alexandrov
098f1855e2
Added back accidentially removed new line
2024-09-25 12:11:45 +04:00
Igor Alexandrov
88351312bf
Added app_port example to the proxy section
2024-09-25 11:25:42 +04:00
Nick Hammond
e252004eef
Use argumentize for secrets with pack
2024-09-23 20:16:06 -07:00
David Heinemeier Hansson
4a13803119
Bump version for 2.0.0.rc3
2024-09-23 16:48:07 -07:00
David Heinemeier Hansson
bda252835b
Merge pull request #966 from basecamp/cleanup-default-templates
...
Bring default templates up to par with what Rails generates
2024-09-24 01:46:09 +02:00
David Heinemeier Hansson
0f5dfa204f
Rearrange one last time
2024-09-23 16:44:54 -07:00
David Heinemeier Hansson
9dde204480
Rearange
2024-09-23 16:30:16 -07:00
David Heinemeier Hansson
b6cd4f8070
Bring default templates up to par with what Rails generates
2024-09-23 14:41:31 -07:00
Nick Hammond
85a5a09aac
Merge branch 'basecamp:main' into buildpacks
2024-09-22 08:47:08 -07:00
David Heinemeier Hansson
e71bfcbadd
Bump version for 2.0.0.rc2
2024-09-20 15:41:26 -07:00
David Heinemeier Hansson
567309596a
Make the skip of timestamps a boolean
2024-09-20 12:50:46 -07:00
David Heinemeier Hansson
b89ec2bf63
Bump version for 2.0.0.rc1
2024-09-20 11:08:45 -07:00
David Heinemeier Hansson
3172adca30
Merge pull request #958 from basecamp/optional-timestamps
...
Add option to skip timestamps on logging output
2024-09-20 18:01:14 +02:00
David Heinemeier Hansson
04d21f45bb
Fix test
2024-09-20 08:45:40 -07:00
David Heinemeier Hansson
eabd57350c
Fix tests
2024-09-20 08:33:14 -07:00
David Heinemeier Hansson
487f6f5f53
Fix excess spacing
2024-09-20 08:31:56 -07:00
David Heinemeier Hansson
d98500982d
Update tests
2024-09-20 08:19:38 -07:00
David Heinemeier Hansson
8693e968c1
Timestamps now default on for app logs too
2024-09-20 08:17:19 -07:00
David Heinemeier Hansson
6ab5fc9459
Allow timestamps on/off for app logging too
2024-09-20 08:04:28 -07:00
David Heinemeier Hansson
6fc2915884
Merge branch 'main' into optional-timestamps
2024-09-20 07:58:49 -07:00
David Heinemeier Hansson
afa6898a82
Fix pipe
2024-09-20 07:58:38 -07:00
David Heinemeier Hansson
384b36d158
Add option to skip timestamps on logging output
...
So it is easier to follow live when you are doing debugging, especially
early days app setup when you are the only user.
2024-09-20 07:42:31 -07:00
Donal McBreen
6df169a4fb
Doc updates
2024-09-20 15:27:10 +01:00
Donal McBreen
ab109afc52
Merge pull request #957 from basecamp/numeric-timeouts
...
Response timeout should be a number
2024-09-20 09:50:05 +01:00
Donal McBreen
a6a48c456c
Response timeout should be a number
...
Kamal will append the `s` for the duration when talking to kamal-proxy
so no need to have it in the config.
2024-09-20 09:26:06 +01:00
David Heinemeier Hansson
a4e5dbe5d4
Bump version for 2.0.0.beta2
2024-09-19 11:37:22 -07:00
Donal McBreen
56e90906b1
Merge pull request #954 from basecamp/two-app-integration-test
...
Integration test two apps
2024-09-19 16:36:45 +01:00
Donal McBreen
6e65968bdc
Integration test two apps
...
Use localhost for app_with_roles and 127.0.0.1 for app. Confirm we can
deploy both and the respond to requests. Ensure the proxy is removed
once both have been removed.
2024-09-19 16:25:09 +01:00
Donal McBreen
85f1e14b97
Merge pull request #953 from basecamp/inherit-env-for-secrets
...
Avoid setting env via SSHKit
2024-09-19 15:18:31 +01:00
Donal McBreen
2c829a4824
Avoid setting env via SSHKit
...
SSHKit puts the env in the command, so leaks them in process listings.
2024-09-19 15:09:17 +01:00
Donal McBreen
45a58f7e15
Merge pull request #952 from basecamp/app-exec-in-kamal-network
...
Run app exec in the kamal network
2024-09-19 14:46:58 +01:00
Donal McBreen
834b343ded
Run app exec in the kamal network
...
All other containers run in the kamal network, so let's add app exec-ed
containers as well.
2024-09-19 14:29:33 +01:00
Donal McBreen
9fe1821cae
Merge pull request #951 from basecamp/proxy-config-ownership
...
Fix /home/kamal-proxy/.config/kamal-proxy ownership
2024-09-19 12:57:10 +01:00
Donal McBreen
1d7c9fec1d
Fix /home/kamal-proxy/.config/kamal-proxy ownership
...
1. Update to kamal-proxy 0.4.0 which creates and chowns
/home/kamal-proxy/.config/kamal-proxy to kamal-proxy
2. Use a docker volume rather than mapping in a directory, so docker
keeps it owned by the correct user
2024-09-19 12:25:57 +01:00
David Heinemeier Hansson
a6b983de06
Bump version for 2.0.0.beta1
2024-09-18 15:33:21 -07:00
Donal McBreen
3ec4ad2ea5
Merge pull request #949 from basecamp/role-proxy-config
...
Allow role specific proxy config
2024-09-18 18:27:36 +01:00
Donal McBreen
63f854ea18
Add validations for host/ssl roles
...
Roles with SSL can only have one server.
Two roles with SSL can't use the same host.
2024-09-18 17:42:45 +01:00
Donal McBreen
fd0cdc1ca1
All role specific proxy configuration
...
By default only the primary role runs the proxy. To disable the proxy
for that role, you can set `proxy: false` under it.
For other roles they default to not running the proxy, but you can
enable it by setting `proxy: true` for the role, or alternatively
setting a proxy configuration.
The proxy configuration will be merged into the root proxy configuration.
2024-09-18 17:25:35 +01:00
Donal McBreen
d218264b69
Doc output fixes
2024-09-18 15:28:26 +01:00
Donal McBreen
684f7ac148
Merge pull request #948 from basecamp/deploy-drain-timeouts
...
Simplified deploy/drain timeouts
2024-09-18 15:18:00 +01:00
Donal McBreen
8bcd896242
Simplified deploy/drain timeouts
...
Remove `stop_wait_time` and `readiness_timeout` from the root config
and remove `deploy_timeout` and `drain_timeout` from the proxy config.
Instead we'll just have `deploy_timeout` and `drain_timeout` in the
root config.
For roles that run the proxy, they are passed to the kamal-proxy deploy
command. Once that returns we can assume the container is ready to
shut down.
For other roles, we'll use the `deploy_timeout` when polling the
container to see if it is ready and the `drain_timeout` when stopping
the container.
2024-09-18 15:08:08 +01:00
Donal McBreen
600bbd77ef
Merge pull request #947 from basecamp/doc-updates
...
Update proxy and docs for Kamal 2.0/kamal-proxy 0.3.0
2024-09-18 14:45:32 +01:00
Donal McBreen
34effef70a
Update proxy and docs for Kamal 2.0/kamal-proxy 0.3.0
...
Update to kamal-proxy 0.3.0 and improve docs making sure they are in
sync with that version.
2024-09-18 14:00:43 +01:00
Donal McBreen
e07ac070aa
Merge pull request #945 from basecamp/kamal-2-upgrade
...
Upgrade on accessory hosts only with correct messages
2024-09-18 10:27:28 +01:00
Donal McBreen
46c0836cd4
Upgrade on accessory hosts only with correct messages
2024-09-18 10:07:07 +01:00
Donal McBreen
bd54c74682
Merge pull request #944 from basecamp/single-secrets-instance
...
Ensure we don't load the secrets more than once
2024-09-17 14:33:38 +01:00
Donal McBreen
f183419f7a
Ensure we don't load the secrets more than once
...
Secrets were being created twice, which might require logging in twice.
2024-09-17 14:21:43 +01:00
Donal McBreen
190dbd1ea3
Merge pull request #943 from basecamp/response-timeout-string
...
Need a duration string for the response timeout
2024-09-17 14:14:49 +01:00
Donal McBreen
d6eda3d741
Merge pull request #942 from basecamp/kamal-2-upgrade
...
Upgrade commands for Kamal 1.x -> 2.0
2024-09-17 13:34:00 +01:00
Donal McBreen
0fe6a17a91
Need a duration string for the response timeout
...
Add `s` as the timeout is a duration.
2024-09-17 13:23:15 +01:00
Donal McBreen
7f15fd143f
Upgrade commands for Kamal 1.x -> 2.0
...
Adds:
- `kamal upgrade` to upgrade all app hosts and accessory hosts
- `kamal proxy upgrade` to upgrade the proxy on all hosts
- `kamal accessory upgrade [name]` to upgrade accessories on all hosts
Upgrade takes rolling and confirmed options and calls `proxy upgrade`
and `accessory upgrade` in turn.
To just upgrade a single host add -h [host] to the command. But the
upgrade should run on all hosts, not just those running the proxy.
Calling upgrade on a host that has already been upgraded should work ok.
Upgrading hosts causes downtime but you can avoid if you run multiple
hosts by:
1. Implementing the pre-proxy-reboot and post-proxy-reboot hooks to
remove the host from external load balancers
2. Running the upgrade with the --rolling option
**kamal proxy upgrade**
1. Creates a `kamal` network if required
2. Stops and removes the old proxy (whether Traefik or kamal-proxy)
3. Starts a kamal-proxy container in the `kamal` network
4. Reboots the app containers in the `kamal` network
**kamal accessory upgrade [name]**
1. Creates a `kamal` network if required
2. Reboots the accessory containers in the `kamal` network
A matching `downgrade` command will be added to Kamal 1.9.
2024-09-17 13:02:02 +01:00
Donal McBreen
434490bd0c
Merge pull request #940 from basecamp/proxy
...
Replace Traefik with kamal-proxy
2024-09-17 09:47:16 +01:00
Nick Hammond
548452aa12
Merge branch 'basecamp:main' into buildpacks
2024-09-16 18:11:33 -07:00
Donal McBreen
267b526438
Switch proxy/hosts to proxy/host
...
The proxy only supports a single host per app for nowm so make the
config match that.
2024-09-16 20:45:09 +01:00
Donal McBreen
1f721739d6
Use version 0.1.0 of kamal-proxy and add minimum version check
2024-09-16 16:44:58 +01:00
Donal McBreen
6c51e596ae
Put locks directories in .kamal so they leave no trace when deleted
2024-09-16 16:44:58 +01:00
Donal McBreen
7f31510aec
Set hosts via config rather than options
2024-09-16 16:44:58 +01:00
Donal McBreen
e8ff233e81
Fix default log header tests
2024-09-16 16:44:58 +01:00
Donal McBreen
a316e51eda
Add user agent to default headers
2024-09-16 16:44:58 +01:00
Donal McBreen
bf91d6c1ca
Fix command description
2024-09-16 16:44:58 +01:00
Donal McBreen
a84ee6315f
Rename service -> app directory
2024-09-16 16:44:58 +01:00
Donal McBreen
3c39086613
Not experimental
2024-09-16 16:44:58 +01:00
Donal McBreen
8b965b0a31
Handle polling without the healthcheck config
2024-09-16 16:44:58 +01:00
Donal McBreen
d2672c771e
Remove redundant call to env remove
2024-09-16 16:44:58 +01:00
Donal McBreen
24031fefb0
Remove proxy only if no apps are installed
2024-09-16 16:44:58 +01:00
Donal McBreen
35fe9c154d
Move audits back to run dir so they survive kamal remove
2024-09-16 16:44:58 +01:00
Donal McBreen
b8972a6833
Remove service directory on kamal remove
2024-09-16 16:44:58 +01:00
Donal McBreen
d7d6fa34b0
Use Volume for kamal proxy config volume
2024-09-16 16:44:58 +01:00
Donal McBreen
c21757f747
Move all files on the host under a common directory
...
This will make running kamal remove simpler, we can just clean up that
directory.
2024-09-16 16:44:58 +01:00
Donal McBreen
cb73c730f9
No need for run_id
2024-09-16 16:44:58 +01:00
Donal McBreen
109339189a
Fix up integration app_test.rb
2024-09-16 16:44:58 +01:00
Donal McBreen
33834a266a
Drop sleep after container healthy
2024-09-16 16:44:58 +01:00
Donal McBreen
e1016b2469
No need to wait_for_healthy
2024-09-16 16:44:58 +01:00
Donal McBreen
a40b644145
Check that there's no traefik hooks left behind
2024-09-16 16:44:58 +01:00
Donal McBreen
ccb7424197
Remove stray exit!
2024-09-16 16:44:58 +01:00
Donal McBreen
2125327d54
proxy/host -> proxy/hosts
2024-09-16 16:44:58 +01:00
Donal McBreen
f4d309c5cc
Rip out Traefik
2024-09-16 16:44:55 +01:00
Donal McBreen
5bca8015bc
Map kamal proxy config into .kamal/proxy/config
...
This will allow us to share files with the proxy via the host.
2024-09-16 16:44:41 +01:00
Donal McBreen
27a7b339a6
Drop run_directory configuration option
...
We need to drop to be fixed so multiple applications put the config in
the same place.
2024-09-16 16:44:41 +01:00
Donal McBreen
dcd4778dd9
Port -> app_port
2024-09-16 16:44:41 +01:00
Donal McBreen
6f2eaed398
Work out the host and port for the container
...
Avoid docker inspect:
1. Use the container ID as the host
2. Configure the port, default to 3000
2024-09-16 16:44:41 +01:00
Donal McBreen
e9d480b514
Add the proxy/ssl config and pass on to kamal-proxy
2024-09-16 16:44:41 +01:00
Donal McBreen
2fdc59a3aa
Fix tests
2024-09-16 16:44:41 +01:00
Donal McBreen
b33c999125
Remove envify, make proxy booting work with env files
2024-09-16 16:44:41 +01:00
Donal McBreen
2056351c38
Use kamal network for accessories
2024-09-16 16:44:41 +01:00
Donal McBreen
9c2d5f83f7
Boot latest version when upgrading proxy
2024-09-16 16:44:41 +01:00
Donal McBreen
f347ef7e44
Add proxy upgrade command
2024-09-16 16:44:41 +01:00
Donal McBreen
63ebeda489
Create proxy and app containers in a kamal network
2024-09-16 16:44:41 +01:00
Donal McBreen
13bdf50ceb
Fix tests for proxy defaults and required builder arch
2024-09-16 16:44:41 +01:00
Donal McBreen
bd6558630f
Fix merge error
2024-09-16 16:44:39 +01:00
Donal McBreen
53903ddcd2
Read buffer not buffering
2024-09-16 16:44:21 +01:00
Donal McBreen
55756fa6f3
Set request and response headers
2024-09-16 16:44:21 +01:00
Donal McBreen
fe0c656de5
Split buffer requests/responses
2024-09-16 16:44:21 +01:00
Donal McBreen
418d8045d8
Add forward headers support
2024-09-16 16:44:21 +01:00
Donal McBreen
d63ff8f251
Set extra fields
2024-09-16 16:44:21 +01:00
Donal McBreen
eab717e0cf
Add kamal-proxy in experimental mode
...
The proxy can be enabled via the config:
```
proxy:
enabled: true
hosts:
- 10.0.0.1
- 10.0.0.2
```
This will enable the proxy and cause it to be run on the hosts listed
under `hosts`, after running `kamal proxy reboot`.
Enabling the proxy disables `kamal traefik` commands and replaces them
with `kamal proxy` ones. However only the marked hosts will run the
kamal-proxy container, the rest will run Traefik as before.
2024-09-16 16:44:19 +01:00
Donal McBreen
66d5e25834
Merge pull request #939 from basecamp/secrets-mutex
...
Add a mutex around loading secrets
2024-09-16 16:26:58 +01:00
Donal McBreen
6bbbd81da1
Add a mutex around loading secrets
...
Loading secrets may ask for use input, so we need to ensure only one
thread does it at a time.
2024-09-16 14:44:39 +01:00
Donal McBreen
876eebc7c5
Merge pull request #936 from basecamp/asset-extraction-entrypoint
...
Override the entrypoint when extracting assets
2024-09-13 17:46:43 +01:00
Donal McBreen
dc1bbac3c8
Override the entrypoint when extracting assets
...
When overriding the command, docker will still run the entrypoint. We
want to avoid that here - we just want to get the assets out as quickly
as possible. Otherwise maybe something important is going on when we
stop the container.
2024-09-12 19:31:18 +01:00
Donal McBreen
045aa7d167
Merge pull request #934 from basecamp/secrets-dont-exit
...
Don't exit from failed secrets commands
2024-09-11 16:27:33 +01:00
Donal McBreen
0660895e75
Don't exit from failed secrets commands
...
We can let the exception bubble up. We'll still get an error message and
it ensures that any cleanup we need is done (i.e. releasing deploy locks).
2024-09-11 16:10:52 +01:00
Donal McBreen
debdf00cca
Merge pull request #933 from basecamp/common-secrets
...
Add secrets-common for shared secrets
2024-09-11 14:20:01 +01:00
Donal McBreen
9089c41f30
Add secrets-common for shared secrets
...
Add a shared secrets file used across all destinations. Useful for
things Github tokens or registry passwords.
The secrets are added to a new file called `secrets-common` to highlight
they are shared, and to avoid acciedentally inheriting a secret from the
`secrets` file to `secrets.destination`.
2024-09-11 13:41:36 +01:00
Donal McBreen
c9946808b1
Merge pull request #931 from basecamp/dont-git-ignore-dot-kamal-secrets
...
Don't git ignore .kamal/secrets
2024-09-11 13:26:07 +01:00
Donal McBreen
deb2a6d298
Merge pull request #930 from basecamp/hide-1password-login-error
...
Hide the 1password login error
2024-09-11 12:18:09 +01:00
Donal McBreen
0cb69a84f5
Don't git ignore .kamal/secrets
...
Secrets should be interpolated at runtime so we do want the file in git.
But add a warning at the top to avoid adding secrets or git ignore the
file if you do.
Also provide examples of the three options for interpolating secrets.
2024-09-11 12:16:18 +01:00
Donal McBreen
aa630f156a
Hide the 1password login error
...
Avoid outputting this login error message, it wasn't an error and you
don't need to follow those instructions.
```
[ERROR] 2024/09/11 11:57:08 You are not currently signed in. Please run `op signin --help` for instructions
```
2024-09-11 12:02:53 +01:00
Donal McBreen
63d0b5ddfa
Merge pull request #928 from basecamp/kamal-secrets-inline-aware
...
Make the secrets commands inline aware
2024-09-10 11:08:10 +01:00
Donal McBreen
06f4caa866
Make the secrets commands inline aware
...
Rather than redirecting the global $stdout, which is not never clever in
a threaded program, we'll make the secrets commands aware they are
being inlined, so they return the value instead of printing it.
Additionally we no longer need to interrupt the parent process on error
as we've inlined the command - exit 1 is enough.
2024-09-10 10:39:44 +01:00
Donal McBreen
5aa3d1aeb0
Merge pull request #927 from basecamp/revert-903-integration-test-insecure-registry
...
Revert "Integration test insecure registry"
2024-09-10 10:12:57 +01:00
Donal McBreen
a4d668cd39
Revert "Integration test insecure registry"
2024-09-10 10:02:10 +01:00
Donal McBreen
7156c80f34
Merge pull request #924 from basecamp/secrets
...
Secrets
2024-09-09 15:13:35 +01:00
Donal McBreen
aed2ef99d0
Use env files for secrets
...
Add env files back in for secrets - hides them from process lists and
allows you to pick up the latest env file when running
`kamal app exec` without reusing.
2024-09-09 14:43:12 +01:00
Donal McBreen
57cbf7cdb5
Inline dotenv kamal secrets calls
2024-09-06 16:56:54 +01:00
Donal McBreen
b99c044327
Update lib/kamal/cli/templates/secrets
...
Co-authored-by: Sijawusz Pur Rahnama <sija@sija.pl >
2024-09-06 13:25:39 +01:00
Donal McBreen
8ad6a0ed16
Add .kamal/secrets on kamal init
2024-09-06 11:54:12 +01:00
Nick Hammond
2c5f2a7ce0
Don't need to inspect the builder if pack
2024-09-05 22:25:50 -07:00
Nick Hammond
ae68193f99
pack arch no longer needed, update builder name in tests
2024-09-05 22:17:28 -07:00
Nick Hammond
24f4308372
Catch up with main
2024-09-05 21:55:11 -07:00
Donal McBreen
8b62e2694a
Test non-ascii secret interpolation
2024-09-05 10:01:56 +01:00
Donal McBreen
be1df4356a
fetch_from_vault -> fetch_secrets
2024-09-05 09:53:33 +01:00
Donal McBreen
8210e8e768
Drop redundant rescue
2024-09-05 09:53:18 +01:00
Donal McBreen
9b96ef2412
Shellescape command input
2024-09-05 08:37:50 +01:00
Nick Hammond
d0ffb850da
Utilize repository name for pack name
2024-09-04 09:42:40 -07:00
Donal McBreen
1522d94ac9
Pass secrets to pre/post deploy hooks
2024-09-04 16:24:10 +01:00
Donal McBreen
a68294c384
Remote test adapter from test_helper.rb
2024-09-04 12:57:25 +01:00
Donal McBreen
31a347c285
Move int parent comment
2024-09-04 12:52:30 +01:00
Donal McBreen
3d502ab12d
Add test adapter and interpolate secrets in integration tests
2024-09-04 12:40:27 +01:00
Donal McBreen
5226d52f8a
Interrupting parent on error
2024-09-04 12:14:47 +01:00
Donal McBreen
9deb8af4a0
Don't hide command
2024-09-04 09:32:45 +01:00
Donal McBreen
068aaa0bd0
Fix options
2024-09-04 09:32:45 +01:00
Donal McBreen
a726a86a17
Add lastpass, bitwarden adapters
2024-09-04 09:32:45 +01:00
Donal McBreen
b2e1a4d4c1
Secrets test
2024-09-04 09:32:45 +01:00
Donal McBreen
9ade79fc84
OnePassword, LastPass + Bitwarden adapters
2024-09-04 09:32:45 +01:00
Donal McBreen
79731da619
Single fetch command
2024-09-04 09:32:45 +01:00
Donal McBreen
0ae8046905
Add secret tests
2024-09-04 09:32:45 +01:00
Donal McBreen
d5ecca0fd4
Add tests
2024-09-04 09:32:45 +01:00
Donal McBreen
0c6a593554
Remove redundant test
2024-09-04 09:32:45 +01:00
Donal McBreen
3f37fea7c3
Configuration::Secrets -> Secrets
2024-09-04 09:32:45 +01:00
Donal McBreen
7daaabd4d4
One file, no destination env
2024-09-04 09:32:45 +01:00
Donal McBreen
fcdef5fa06
Set KAMAL_DESTINATION for dotenv parsing
2024-09-04 09:32:45 +01:00
Donal McBreen
5480b40ba3
Correct secret files order
2024-09-04 09:32:45 +01:00
Donal McBreen
1d0e81b00a
Eager load only CLI for faster commands
2024-09-04 09:32:45 +01:00
Donal McBreen
5910249d02
Add secrets command + 1password integration
2024-09-04 09:32:45 +01:00
Donal McBreen
b464c4fd4a
Include dotenv upgrade
2024-09-04 09:32:45 +01:00
Donal McBreen
56754fe40c
Lazily load secrets whenever needed
2024-09-04 09:32:45 +01:00
Donal McBreen
6a06efc9d9
Strip out env loading, envify, env push
2024-09-04 09:32:45 +01:00
Donal McBreen
5c4c33e0a8
Replace .env* with .kamal/env*
...
By default look for the env file in .kamal/env to avoid clashes with
other tools using .env.
For now we'll still load .env and issue a deprecation warning, but in
future we'll stop reading those.
2024-09-04 09:32:45 +01:00
Donal McBreen
0b5506f6f2
Merge pull request #923 from basecamp/disable-local-builder
...
Allow disabling of local builds
2024-09-03 14:53:23 +01:00
Donal McBreen
a2549b1f60
Allow disabling of local builds
...
To disable local builds set:
```
builder:
local: false
remote: ssh://docker@docker-builder
```
2024-09-03 14:33:25 +01:00
Donal McBreen
9b9e60ec7f
Merge pull request #921 from basecamp/remote-hybrid-builders-cleanup
...
Build and clean remote builders correctly
2024-09-02 15:24:28 +01:00
Donal McBreen
e557eea79c
Build and clean remote builders correctly
...
Check that the builder and context match what we expect, and if not
remove and re-create them.
2024-09-02 15:12:19 +01:00
David Heinemeier Hansson
d7e785cd36
Merge pull request #920 from mblayman/env-docs-typos
...
Fix typos in "Environment variables" docs.
2024-09-01 14:22:15 -07:00
Matt Layman
5cda3086c4
Found a typo in the healthcheck docs.
2024-08-31 23:38:28 -04:00
Matt Layman
362f5d00f6
Fix typos in "Environment variables" docs.
2024-08-31 23:29:30 -04:00
Donal McBreen
6adf3c117f
Merge pull request #905 from basecamp/simplify-builders-config
...
Simplify builders config
2024-08-29 09:28:51 +01:00
Donal McBreen
9f0b10425c
Fix aliases tests
2024-08-29 09:16:07 +01:00
Donal McBreen
5f2384f123
Use docker info to get arch
2024-08-29 08:46:18 +01:00
Donal McBreen
eab7d3adc5
Keep buildx build, in case of old docker versions which don't default to buildkit
2024-08-29 08:45:51 +01:00
Donal McBreen
d2d0223c37
Require an arch to be set, and default to amd64 in the template
2024-08-29 08:45:51 +01:00
Donal McBreen
56268d724d
Simplify the builders configuration
...
1. Add driver as an option, defaulting to `docker-container`. For a
"native" build you can set it to `docker`
2. Set arch as a array of architectures to build for, defaulting to
`[ "amd64", "arm64" ]` unless you are using the docker driver in
which case we default to not setting a platform
3. Remote is now just a connection string for the remote builder
4. If remote is set, we only use it for non-local arches, if we are
only building for the local arch, we'll ignore it.
Examples:
On arm64, build for arm64 locally, amd64 remotely or
On amd64, build for amd64 locally, arm64 remotely:
```yaml
builder:
remote: ssh://docker@docker-builder
```
On arm64, build amd64 on remote,
On amd64 build locally:
```yaml
builder:
arch:
- amd64
remote:
host: ssh://docker@docker-builder
```
Build amd64 on local:
```yaml
builder:
arch:
- amd64
```
Use docker driver, building for local arch:
```yaml
builder:
driver: docker
```
2024-08-29 08:45:48 +01:00
Donal McBreen
cffb6c3d7e
Allow the driver to be set
2024-08-29 08:44:11 +01:00
Donal McBreen
bd1726f305
docker buildx build -> docker build
2024-08-29 08:44:11 +01:00
Donal McBreen
7ddb122a22
Get tests passing
2024-08-29 08:44:11 +01:00
Donal McBreen
98c951bbdb
Simplfy choosing a builder
2024-08-29 08:44:11 +01:00
Donal McBreen
374c117b79
Validate multiarch configuration
...
Remote and local are only allowed when multiarch is enabled.
Remote requires a host and arch, local only requires an arch.
2024-08-29 08:44:11 +01:00
Donal McBreen
d6a5cf3c78
Rip out context_hosts checks
...
The remote host is now encoded in the builder name so we don't need
to check it. We'll just do an inspect to confirm the builder exists.
2024-08-29 08:44:11 +01:00
Donal McBreen
2aeabda455
Move multiarch remote builder to hybrid builder
...
Include the host name in the builder name, so we can have one builder
per host/arch across all kamal projects.
Inherit from the remote builder. The difference in the hybrid builder
is that we create a local buildx instance and append the remote context
to it.
2024-08-29 08:44:11 +01:00
Donal McBreen
c048c097ed
Create a context for local builds
...
This ensures we use the docker-container driver and not whatever the
local default is.
2024-08-29 08:44:11 +01:00
Donal McBreen
ed148628fb
Local build doesn't need a builder
2024-08-29 08:44:11 +01:00
Donal McBreen
d48080c772
Dump native builder
...
We already ensure that buildx is installed, so let's always use it.
2024-08-29 08:44:11 +01:00
Donal McBreen
3f64338929
Move native remote to just remote
...
It's just a remote builder, that will build whichever platform is asked
for, so let's remove the "native" part.
We'll also remove the service name from the builder name, so multiple
services can share the same builder.
2024-08-29 08:44:11 +01:00
Donal McBreen
0ab838bc25
Combine multiarch and native/cache builders
...
Combine the two builders, as they are almost identical. The only
difference was whether the platforms were set.
The native cached builder wasn't using the context it created, so now
we do.
We'll set the driver to `docker-container` - it seems to be the default
but the Docker docs claim it is `docker`.
2024-08-29 08:44:11 +01:00
Donal McBreen
b7382ceeaf
Merge pull request #912 from basecamp/alias
...
Add aliases to Kamal
2024-08-29 08:43:35 +01:00
Donal McBreen
69367fbc6b
Merge pull request #917 from basecamp/v2.0-alpha
...
Switch the version on main to 2.0.0.alpha
2024-08-29 08:43:19 +01:00
Donal McBreen
2515bd705c
Switch the version on main to 2.0.0.alpha
...
All development is now for the 2.0.0 release.
2024-08-29 08:33:21 +01:00
Donal McBreen
579e169be2
Allow multiple arguments for exec commands
...
If you can have an alias like:
```
aliases:
rails: app exec -p rails
```
Then `kamal rails db:migrate:status` will execute
`kamal app exec -p rails db:migrate:status`.
So this works, we'll allow multiple arguments `app exec` and
`server exec` to accept multiple arguments.
The arguments are combined by simply joining them with a space. This
means that these are equivalent:
```
kamal app exec -p rails db:migrate:status
kamal app exec -p "rails db:migrate:status"
```
If you want to pass an argument with spaces, you'll need to quote it:
```
kamal app exec -p "git commit -am \"My comment\""
kamal app exec -p git commit -am "\"My comment\""
```
2024-08-28 10:58:25 +01:00
Donal McBreen
d6f5da92be
Bump version for 1.8.2
2024-08-28 09:43:06 +01:00
Nick Hammond
826308aabd
Clean things up via Rubocop
2024-08-27 22:52:06 -07:00
Nick Hammond
897b3b4e46
Add a pack option to the builder options
2024-08-27 22:25:56 -07:00
Donal McBreen
9ccfe20b10
Fix up tests
2024-08-26 11:20:26 +01:00
Donal McBreen
e871d347d5
Merge pull request #889 from xiaohui-zhangxh/git-clone-update-submodules
...
git clone with --recurse-submodules
2024-08-26 11:20:05 +01:00
Donal McBreen
b8af719bb7
Add aliases to Kamal
...
Aliases are defined in the configuration file under the `aliases` key.
The configuration is a map of alias name to command. When we run the
command the we just do a literal replacement of the alias with the
string.
So if we have:
```yaml
aliases:
console: app exec -r console -i --reuse "rails console"
```
Then running `kamal console -r workers` will run the command
```sh
$ kamal app exec -r console -i --reuse "rails console" -r workers
```
Because of the order Thor parses the arguments, this allows us to
override the role from the alias command.
There might be cases where we need to munge the command a bit more but
that would involve getting into Thor command parsing internals,
which are complicated and possibly subject to change.
There's a chance that your aliases could conflict with future built-in
commands, but there's not likely to be many of those and if it happens
you'll get a validation error when you upgrade.
Thanks to @dhnaranjo for the idea!
2024-08-26 10:47:43 +01:00
Jeremy Daer
190f4fba28
SSH: allow setting config: false to ignore local user ~/.ssh/config
2024-08-13 12:46:50 -07:00
Donal McBreen
f48987aa03
Merge pull request #903 from basecamp/integration-test-insecure-registry
...
Integration test insecure registry
2024-08-01 09:57:17 +01:00
Donal McBreen
ef051eca1b
Merge pull request #904 from galori/main
...
Fixed typo in `env.yml`: "valies" --> "values"
2024-08-01 09:57:03 +01:00
Gall Steinitz
173d44ee0a
fixed typo in env.yml: valies --> values
2024-07-31 22:12:21 -07:00
Donal McBreen
4e811372f8
Integration test insecure registry
...
The integrations tests use their own registry so avoid hitting docker
hub rate limits.
This was using a self signed certificate but instead use
`--insecure-registry` to let the docker daemon use HTTP.
2024-07-31 16:54:00 +01:00
Donal McBreen
ec4aa45852
Bump version for 1.8.1
2024-07-29 09:09:57 +01:00
Donal McBreen
5e11a64181
Merge pull request #891 from basecamp/single-pull
...
Pull once from hosts that warm registry mirrors
2024-07-22 08:18:48 +01:00
Jeremy Daer
57d9ce177a
Pull once from hosts that warm registry mirrors
2024-07-18 09:14:22 -07:00
xiaohui
b12de87388
git clone with --recurse-submodules
2024-07-17 10:36:58 +08:00
Donal McBreen
8a98949634
Merge pull request #886 from guoard/patch-2
...
Remove `--update` flag from `apk add` command
2024-07-16 15:46:37 +01:00
Donal McBreen
0eb9f48082
Merge pull request #887 from basecamp/fix-tests-with-git-config
...
Fix the tests when you have a git config email set
2024-07-16 13:08:18 +01:00
Donal McBreen
9db6fc0704
Fix the tests when you have a git config email set
...
The ran ok on CI where we fall back to `whoami`, but failed locally
where there was a git email set.
2024-07-16 12:09:05 +01:00
Donal McBreen
27fede3caa
Merge pull request #884 from basecamp/x-config
...
Add support for configuration extensions
2024-07-16 11:38:28 +01:00
Donal McBreen
29c723f7ec
Add support for configuration extensions
...
Allow blocks prefixed with `x-` in the configuration as a place to
declare reusable blocks with YAML anchors and aliases.
Borrowed from the Docker Compose configuration file format -
https://github.com/compose-spec/compose-spec/blob/main/spec.md#extension
Thanks to @ruyrocha for the suggestion.
2024-07-15 20:47:55 +01:00
Ali Afsharzadeh
2755582c47
Remove --update flag from apk add command
2024-07-15 22:15:25 +03:30
Donal McBreen
fa73d722ea
Bump version for 1.8.0
2024-07-15 14:21:23 +01:00
Donal McBreen
c535e4e44f
Merge pull request #883 from basecamp/revert-840-main
...
Revert "Add x25519 gem, support Curve25519"
2024-07-15 13:56:49 +01:00
Donal McBreen
0ea07b1760
Merge pull request #878 from pagbrl/main
...
feat: Use git email as performer when available
2024-07-15 13:41:17 +01:00
Donal McBreen
03b531f179
Merge pull request #865 from basecamp/clean-envify-env
...
Ensure envify templates aren't polluted by existing env
2024-07-15 13:41:03 +01:00
Donal McBreen
d8570d1c2c
Merge pull request #847 from basecamp/remove-ruby-2.7-from-ci
...
Remove Ruby 2.7 from CI
2024-07-15 13:40:37 +01:00
Donal McBreen
3fe70b458d
Merge pull request #862 from jeromedalbert/bump-sshkit
...
Bump sshkit to support unbracketed IPv6 addresses
2024-07-15 13:40:18 +01:00
Donal McBreen
ade8b43599
Merge pull request #866 from acidtib/ssh-key-overwrite
...
Configurable SSH Identity
2024-07-15 13:39:51 +01:00
Donal McBreen
d24fc3ca4e
Revert "Add x25519 gem, support Curve25519"
2024-07-15 13:36:50 +01:00
Donal McBreen
7c244bbb98
Merge pull request #879 from basecamp/seed-mirror
...
Seed docker mirrors by pulling once per mirror first
2024-07-15 13:30:53 +01:00
Donal McBreen
1369c46a83
Seed docker mirrors by pulling once per mirror first
...
Find the first registry mirror on each host. If we find any, pull the
images on one host per mirror, then do the remainder concurrently.
The initial pulls will seed the mirrors ensuring that we pull the image
from Docker Hub once each.
This works best if there is only one mirror on each host.
2024-07-11 16:20:37 +01:00
Paul Gabriel
deccf1cfaf
feat: Use git email as performer when available
2024-07-11 11:19:44 +02:00
Donal McBreen
1573cebadf
Merge pull request #868 from nickhammond/env/service
...
Add ENV['KAMAL_SERVICE'] to hooks
2024-07-10 10:26:59 +01:00
Nick Hammond
85a2926cde
Remove the deprecated docker compose version ( #869 )
2024-06-28 15:00:23 -07:00
Nick Hammond
58a51b079e
Add KAMAL_SERVICE to custom hooks and exclude from auditor
2024-06-27 10:52:55 -06:00
Nick Hammond
f1f3fc566f
Add ENV['SERVICE'] to hooks
2024-06-27 10:26:11 -06:00
acidtib
44726ff65a
overwrite ssh identity
2024-06-26 17:14:13 -06:00
Jerome Dalbert
fd0d4af21f
Bump sshkit to support unbracketed IPv6 addresses
...
Set sshkit minimum version to 1.23.0, which includes an enhancement to
support unbracketed IPv6 addresses.
See https://github.com/capistrano/sshkit/pull/538
2024-06-25 12:17:40 -07:00
Jeremy Daer
13409ada5a
Ensure envify templates aren't polluted by existing env
...
Setting `GITHUB_TOKEN` as in the docs results in reusing the existing
`GITHUB_TOKEN` since `gh` returns that env var if it's set:
```bash
GITHUB_TOKEN=junk gh config get -h github.com oauth_token
junk
```
Using the original env ensures that the templates will be evaluated the
same way regardless of whether envify had been previously invoked.
2024-06-25 11:14:34 -07:00
Donal McBreen
9a1379be6c
Bump version for 1.7.3
2024-06-25 15:03:02 +01:00
Donal McBreen
31d6c198da
Merge pull request #861 from K4sku/update-docker-setup-sample-hook
...
Expand on docker-setup.sample hook
2024-06-25 14:44:13 +01:00
Donal McBreen
22afe4de77
Merge pull request #864 from basecamp/allow-arrays-in-args
...
Allow arrays in args
2024-06-25 14:41:07 +01:00
Donal McBreen
b63982c3a7
Allow arrays in args
...
Just check that args is a Hash without checking the value types.
Fixes: https://github.com/basecamp/kamal/issues/863
2024-06-25 14:18:23 +01:00
Cezary Kłos
9e12d32cc3
Expand on docker-setup.sample script so it creates docker network "kamal" on each of the defined hosts.
2024-06-24 12:45:56 +02:00
Donal McBreen
ff03891d47
Bump version for 1.7.2
2024-06-24 10:11:27 +01:00
Donal McBreen
f21dc30875
Merge pull request #858 from basecamp/match-does-not-exist
...
Match a "does not exist" error message
2024-06-24 09:54:25 +01:00
Donal McBreen
69fa7286e2
Match a "does not exist" error message
...
Only show the warning for building when we are actually going to do that
and match `does not exist` in the error message.
Fixes: https://github.com/basecamp/kamal/issues/851
2024-06-24 08:21:03 +01:00
Donal McBreen
e160852e4d
Remove Ruby 2.7 from CI
...
It's EOL since March 2023.
2024-06-20 08:54:55 +01:00
Donal McBreen
4697f89441
Bump version for 1.7.1
2024-06-20 08:50:37 +01:00
Donal McBreen
dde637ffff
Merge pull request #846 from basecamp/always-log-boot-errors
...
Log on boot errors with one role
2024-06-20 08:50:03 +01:00
Donal McBreen
f8f88af534
Log on boot errors with one role
...
We didn't log boot errors if there was one role because there was no
barrier and the logging is done by the first host to close the barrier.
Let's always create the barrier to fix this.
2024-06-20 08:28:37 +01:00
Donal McBreen
f6a9698f55
Merge pull request #845 from basecamp/revert-815-envify-already-pushes-env
...
Revert "Envify already env pushes"
2024-06-20 08:22:06 +01:00
Donal McBreen
3da7fad9ee
Revert "Envify already env pushes"
2024-06-20 08:11:18 +01:00
Donal McBreen
1109a864d0
Bump version for 1.7.0
2024-06-18 10:33:02 +01:00
Donal McBreen
da599d90c1
Merge pull request #828 from basecamp/configuration-validation
...
Configuration validation
2024-06-18 08:31:47 +01:00
Donal McBreen
6bf3f4888a
Allow aliases still
2024-06-18 08:20:27 +01:00
Donal McBreen
0a6b0b7133
Merge pull request #840 from HLFH/main
...
Add x25519 gem, support Curve25519
2024-06-18 08:17:48 +01:00
Gaspard d'Hautefeuille
6d6670a221
Add x25519 gem, support Curve25519
...
Fixes:
```
ERROR (Net::SSH::Exception): Exception while executing on host example.com: could not settle on kex algorithm
Server kex preferences: curve25519-sha256@libssh.org ,ext-info-s,kex-strict-s-v00@openssh.com
Client kex preferences: ecdh-sha2-nistp521,ecdh-sha2-nistp384,ecdh-sha2-nistp256,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1```
add x25519 in Gemfile.lock
2024-06-15 13:47:10 +02:00
Donal McBreen
10e3229d7c
Merge pull request #817 from nickhammond/grep-context
...
Add grep options to log commands
2024-06-13 14:38:54 +01:00
Nick Hammond
c7bd377fa5
Swap grep context with grep options
2024-06-06 09:26:12 -07:00
Donal McBreen
bdd951b756
Merge pull request #832 from basecamp/registry-skips
...
Allow registry commands to skip local and remote
2024-06-06 08:12:15 +01:00
Donal McBreen
080897dc4d
Merge pull request #831 from basecamp/check-buildx-contexts
...
Check that we have valid contexts before building
2024-06-06 08:12:05 +01:00
Donal McBreen
d652221100
Merge pull request #818 from fabiosammy/fix-header-docker-setup-template
...
Fix the header template of the docker-setup hook
2024-06-05 12:18:59 +01:00
Donal McBreen
00e0e5073e
Allow registry commands to skip local and remote
...
- Add local logout to `kamal registry logout`
- Add `skip_local` and `skip_remote` options to `kamal registry` commands
- Skip local login in `kamal deploy` when `--skip-push` is used
2024-06-05 12:10:36 +01:00
Donal McBreen
b52e66814a
Check that we have valid contexts before building
...
Load the hosts from the contexts before trying to build.
If there is no context, we'll create one. If there is one but the hosts
don't match we'll re-create.
Where we just have a local context, there won't be any hosts but we
still inspect the builder to check that it exists.
2024-06-05 11:52:45 +01:00
Donal McBreen
29fbe7a98f
Remove redundant Kamal::Configuration::
2024-06-04 16:45:39 +01:00
Donal McBreen
4f317b8499
Configuration validation
...
Validate the Kamal configuration giving useful warning on errors.
Each section of the configuration has its own config class and a YAML
file containing documented example configuration.
You can run `kamal docs` to see the example configuration, and
`kamal docs <section>` to see the example configuration for a specific
section.
The validation matches the configuration to the example configuration
checking that there are no unknown keys and that the values are of
matching types.
Where there is more complex validation - e.g for envs and servers, we
have custom validators that implement those rules.
Additonally the configuration examples are used to generate the
configuration documentation in the kamal-site repo.
You generate them by running:
```
bundle exec bin/docs <kamal-site-checkout>
```
2024-06-04 14:19:29 +01:00
Donal McBreen
6e60ab918a
Bump version for 1.6.0
2024-06-03 08:34:12 +01:00
Donal McBreen
90ecb6a12a
Merge pull request #821 from basecamp/retry-clone
...
Handle corrupt git clones
2024-05-28 15:23:36 +01:00
Donal McBreen
2c2053558a
Handle corrupt git clones
...
When cloning the git repo:
1. Try to clone
2. If there's already a build directory reset it
3. Check the clone is valid
If anything goes wrong during that process:
1. Delete the clone directory
2. Clone it again
3. Check the clone is valid
Raise any errors after that
2024-05-27 11:17:34 +01:00
fabiosammy
beac539d8c
Fix the header template of the docker-setup hook
2024-05-24 13:25:01 -03:00
Nick Hammond
eb79d93139
Run RC
2024-05-24 09:16:14 -07:00
Nick Hammond
89994c8b20
Add grep's context option to show lines before and after a match
2024-05-24 08:59:33 -07:00
Donal McBreen
10b8c826d8
Merge pull request #755 from basecamp/lock-less
...
Lock less
2024-05-21 12:33:45 +01:00
Donal McBreen
187861fa60
Space not tab
2024-05-21 12:20:19 +01:00
Donal McBreen
5ff1203c80
Always lock before pre-deploy hook
2024-05-21 12:02:16 +01:00
Donal McBreen
0e73f02743
Split lock and connection setup
...
Allow run the pre-connect hook before the first SSH command is executed,
but only run the locking in `with_lock` blocks.
2024-05-21 12:02:16 +01:00
Donal McBreen
83d0078525
Confirm outside mutating
2024-05-21 12:02:16 +01:00
Donal McBreen
96ef0fbc4d
Fix merge error
2024-05-21 12:02:16 +01:00
Donal McBreen
b12654ccd0
Don't lock until confirmed
2024-05-21 12:02:16 +01:00
Donal McBreen
64f5955444
Don't hold lock on error
2024-05-21 12:02:12 +01:00
Donal McBreen
d2a719998a
Building doesn't need a deploy lock
2024-05-21 12:01:08 +01:00
Donal McBreen
6a7c90cf4d
Only stopping containers locks
2024-05-21 12:01:07 +01:00
Donal McBreen
2c2d94c6d9
Merge pull request #740 from basecamp/remove-healthcheck-step
...
Remove the healthcheck step
2024-05-21 12:00:25 +01:00
Donal McBreen
c62bd1dc31
Merge pull request #815 from basecamp/envify-already-pushes-env
...
Envify already env pushes
2024-05-21 11:57:55 +01:00
Donal McBreen
a83df9e135
Merge pull request #620 from mlitwiniuk/allow_custom_ports_for_ssh
...
Allow custom user and port for builder host
2024-05-21 11:49:06 +01:00
Donal McBreen
7b55f4734e
Envify already env pushes
...
`kamal envify` will do `kamal env push` for us, so no need to call it
ourselves during setup.
2024-05-21 11:47:51 +01:00
Donal McBreen
1e296c4140
Update sshkit_with_ext.rb
2024-05-21 11:38:30 +01:00
Donal McBreen
9700e2b3c4
Merge pull request #646 from nickhammond/server/exec
...
Add in a server exec command for running ad-hoc commands directly on the server
2024-05-21 11:34:20 +01:00
Donal McBreen
706b82baa1
Simplify messages and remove multiple execute error
2024-05-21 10:40:01 +01:00
Donal McBreen
fa7e941648
Make SSHKit::Runner::Parallel fail slow
...
Using a different SSHKit runner doesn't work well, because the group
runner uses the Parallel runner internally. So instead we'll patch its
behaviour to fail slow.
We'll also get it to return all the errors so we can report on all the
hosts that failed.
2024-05-21 09:33:22 +01:00
Donal McBreen
78c0a0ba4b
Don't start other roles we have a healthy container
...
If a primary role container is unhealthy, we might take a while to
timeout the health check poller. In the meantime if we have started the
other roles, they'll be running tow containers.
This could be a problem, especially if they read run jobs as that
doubles the worker capacity which could cause exessive load.
We'll wait for the first primary role container to boot successfully
before starting the other containers from other roles.
2024-05-21 08:37:36 +01:00
Donal McBreen
060e5d2027
Update lib/kamal/cli/server.rb
...
Co-authored-by: Sijawusz Pur Rahnama <sija@sija.pl >
2024-05-21 08:22:20 +01:00
Nick Hammond
8a4f7163bb
Apply suggestions from code review
...
Co-authored-by: Donal McBreen <dmcbreen@gmail.com >
2024-05-20 11:15:14 -07:00
Donal McBreen
ee758d951a
Only use barrier when needed, more descriptive info
2024-05-20 12:18:30 +01:00
Donal McBreen
bb2ca81d87
Fix rebase method duplication
2024-05-20 12:18:30 +01:00
Donal McBreen
773ba3a5ab
Show container logs and healthcheck status on failure
2024-05-20 12:18:30 +01:00
Donal McBreen
5be6fa3b4e
Improve comments
2024-05-20 12:18:30 +01:00
Donal McBreen
07c5658396
Remove redundant method
2024-05-20 12:18:30 +01:00
Donal McBreen
0efb5ccfff
Remove the healthcheck step
...
To speed up deployments, we'll remove the healthcheck step.
This adds some risk to deployments for non-web roles - if they don't
have a Docker healthcheck configured then the only check we do is if
the container is running.
If there is a bad image we might see the container running before it
exits and deploy it. Previously the healthcheck step would have avoided
this by ensuring a web container could boot and serve traffic first.
To mitigate this, we'll add a deployment barrier. Until one of the
primary role containers passes its healthcheck, we'll keep the barrier
up and avoid stopping the containers on the non-primary roles.
It the primary role container fails its healthcheck, we'll close the
barrier and shut down the new containers on the waiting roles.
We also have a new integration test to check we correctly handle a
a broken image. This highlighted that SSHKit's default runner will
stop at the first error it encounters. We'll now have a custom runner
that waits for all threads to finish allowing them to clean up.
2024-05-20 12:18:30 +01:00
Donal McBreen
990f1b4413
Merge pull request #798 from basecamp/git-clone
...
Build from within a git clone by default
2024-05-20 12:18:07 +01:00
Donal McBreen
da9428f64d
Merge pull request #813 from basecamp/handle-no-env-tags
...
Don't blow up if there are no env tags
2024-05-20 10:58:11 +01:00
Donal McBreen
17dcaccb6a
Don't blow up if there are no env tags
2024-05-20 10:50:07 +01:00
Donal McBreen
448349d0e5
Merge pull request #812 from basecamp/sshkit-1.22.2-minimum
...
Set sshkit minimum version to 1.22.2
2024-05-20 10:39:17 +01:00
Donal McBreen
b6dba57c7d
Set sshkit minimum version to 1.22.2
...
This includes a fix for a bug in the eviction thread that could cause
this error:
```
[ERROR (IOError): Exception while executing on host foo: closed stream]
```
See https://github.com/capistrano/sshkit/pull/534
2024-05-20 10:06:53 +01:00
Donal McBreen
0ea2a2c509
Don't include destination in clone directory
...
Reusing the clone directory should allow caching of the build context
between deployments to different destinations.
2024-05-20 09:34:42 +01:00
Donal McBreen
307750ff70
Build from within a git clone by default
...
Docker does not respect the .dockerignore file when building from a tar.
Instead by default we'll make a local clone into a tmp directory and
build from there. Subsequent builds will reset the clone to match the
checkout.
Compared to building directly in the repo, we'll have reproducible
builds.
Compared to using a git archive:
1. .dockerignore is respected
2. We'll have faster builds - docker can be smarter about caching the
build context on subsequent builds from a directory
To build from the repo directly, set the build context to "." in the
config.
If there are uncommitted changes, we'll warn about them either being
included or ignored depending on whether we build from the clone.
2024-05-20 09:30:56 +01:00
Donal McBreen
88947b6a7b
Merge pull request #805 from basecamp/env-under-tags
...
Move env_tags under env key
2024-05-15 11:09:47 +01:00
Donal McBreen
f48c227768
Move env_tags under env key
...
Instead of:
```
env:
CLEAR_TAG: untagged
env_tags:
tag1:
CLEAR_TAG: tagged
```
We'll have:
```
env:
clear:
CLEAR_TAG: untagged
tags:
tag1:
CLEAR_TAG: tagged
```
2024-05-15 10:19:22 +01:00
David Heinemeier Hansson
f98380ef0c
Merge pull request #802 from basecamp/envify-during-setup
...
Envify during setup
2024-05-14 16:00:28 -07:00
David Heinemeier Hansson
0bc27c10cc
Fix tests
2024-05-14 11:59:42 -07:00
David Heinemeier Hansson
e58d2f67f2
Fix env template path check and tests
2024-05-14 10:07:31 -07:00
David Heinemeier Hansson
938ac375a1
Only envify if there is a template file available
2024-05-13 17:08:53 -07:00
David Heinemeier Hansson
dc1f707a56
Fix test
2024-05-13 17:01:50 -07:00
David Heinemeier Hansson
033f2a3401
Correct invocation
2024-05-13 16:59:50 -07:00
David Heinemeier Hansson
7cac7e6fb0
Envify during setup
2024-05-13 15:18:11 -07:00
Nick Hammond
fb58fc0ba6
Add in a server exec command for running ad-hoc commands directly on the server
2024-05-13 14:17:06 -07:00
Donal McBreen
12cad5458a
Merge pull request #762 from kryachkov/main
...
Trim long hostnames
2024-05-10 16:05:27 +01:00
Donal McBreen
f8b7f74543
Merge pull request #786 from hundredwatt/add-target-option-to-builder
...
Add --target option to Builder to support multi-stage Docker builds
2024-05-10 15:15:31 +01:00
Donal McBreen
489d6dbcbb
Merge pull request #789 from basecamp/host-tags
...
Host specific env with tags
2024-05-10 08:08:29 +01:00
Donal McBreen
6d062ce271
Host specific env with tags
...
Allow hosts to be tagged so we can have host specific env variables.
We might want host specific env variables for things like datacenter
specific tags or testing GC settings on a specific host.
Right now you either need to set up a separate role, or have the app
be host aware.
Now you can define tag env variables and assign those to hosts.
For example:
```
servers:
- 1.1.1.1
- 1.1.1.2: tag1
- 1.1.1.2: tag2
- 1.1.1.3: [ tag1, tag2 ]
env_tags:
tag1:
ENV1: value1
tag2:
ENV2: value2
```
The tag env supports the full env format, allowing you to set secret and
clear values.
2024-05-09 16:02:45 +01:00
Jason Nochlin
1e44cc2597
fix rubocop violation
2024-05-08 19:22:25 -06:00
André Falk
63c47eca4c
Trim long hostnames
...
Hostnames longer than 64 characters are not supported by docker
2024-05-07 19:06:39 +02:00
Donal McBreen
3c8428504d
Bump version for 1.5.2
2024-05-07 09:44:11 +01:00
Donal McBreen
8e71c48747
Merge pull request #759 from basecamp/details-accessory-host
...
Output the host when running accessory details
2024-05-02 15:54:08 +01:00
Donal McBreen
67a86e1068
Merge pull request #790 from basecamp/warn-on-missing-builder
...
Warn on missing builder
2024-05-02 12:50:00 +01:00
Donal McBreen
b67f40bdf7
Warn on missing builder
...
We are going to try to create a builder if one is missing, so let's warn
rather than report it as an error.
2024-05-02 12:38:20 +01:00
Donal McBreen
375f0283c4
Merge pull request #785 from basecamp/filter-traefik-hosts
...
Apply --hosts and --roles filters to traefik hosts as well
2024-04-29 14:48:23 +01:00
Jason Nochlin
947be0877f
add --target option for builder configuration
2024-04-27 10:24:47 -06:00
Matthew Kent
b8aaddb4c9
Apply --hosts and --roles filters to traefik hosts as well.
2024-04-26 17:08:57 -07:00
Donal McBreen
f48f528043
Bump version for 1.5.1
2024-04-26 14:26:02 +01:00
Donal McBreen
ec0a082542
Merge pull request #779 from basecamp/fix-log-following
...
Escape single quotes to fix log following
2024-04-26 14:25:27 +01:00
Donal McBreen
6c638a8a77
Merge pull request #778 from basecamp/glob-match-roles-and-hosts
...
Allow glob matches for roles and hosts
2024-04-26 14:20:17 +01:00
Donal McBreen
1f5b936fa2
Escape single quotes to fix log following
...
Fixes: https://github.com/basecamp/kamal/issues/777
2024-04-26 14:16:19 +01:00
Donal McBreen
f785451cc7
Allow glob matches for roles and hosts
...
This lets you do things like:
```
kamal details -h '1.1.1.[1-9]'
kamal details -r 'w{eb,orkers}'
```
2024-04-26 13:43:52 +01:00
Donal McBreen
d475e88dbe
Bump version for 1.5.0
2024-04-25 13:39:06 +01:00
Donal McBreen
d551f044d6
Merge pull request #772 from aishek/take-accessory-hosts-into-account
...
Take accessory hosts into account for --hosts
2024-04-25 11:57:45 +01:00
Donal McBreen
2611179d5e
Merge pull request #773 from xiaohui-zhangxh/docker-env-file-keep-non-ascii
...
don't escape non-ascii characters in docker env file
2024-04-25 11:57:14 +01:00
Donal McBreen
1a013b8d4b
Merge pull request #770 from ttilberg/769-ensure-valid-service-name-with-capital-letters
...
Allow capital letters to match valid service name, such as in MyApp
2024-04-25 11:52:55 +01:00
Maciej Litwiniuk
2f912367ac
Allow custom user and port for builder host
...
When ssh options are set, they overwrite username and password passed as ssh builder uri. Passing part of uri for ssh-kit is fine, as it then properly extracts username and password and forwards it as host.ssh_options (in which case it's no longer empty)
2024-04-17 17:49:50 +02:00
xiaohui
9a9a0914cd
don't escape non-ascii characters in docker env file
2024-04-17 17:42:06 +08:00
Alexandr Borisov
12c518097f
Take accessory hosts into account
2024-04-17 11:45:33 +03:00
Tim Tilberg
69f90387a8
Allow capital letters to match valid service name, such as in MyApp
2024-04-15 09:09:58 -05:00
Donal McBreen
e6d436f646
Output the host when running accessory details
...
We already do this for app and Traefik hosts.
2024-04-05 12:46:51 +01:00
Donal McBreen
31669d4dce
Merge pull request #758 from basecamp/any-runtime-in-test
...
Accept any runtime in the hook tests
2024-04-03 16:27:59 +01:00
Donal McBreen
9d20c1466e
Merge pull request #757 from basecamp/executable-sample-docker-setup-hook
...
Make the sample docker setup hook executable
2024-04-03 16:12:46 +01:00
Donal McBreen
ff1dabe7f8
Merge pull request #756 from basecamp/tidy-up-role-host-setup
...
Tidy up role and host commander setup
2024-04-03 16:09:12 +01:00
Donal McBreen
69aa422890
Accept any runtime in the hook tests
...
Occasionally in CI things run slowly and it takes more that 1 second
for a cli test to run, so let's allow any value for the runtime in the
hook checks.
2024-04-03 16:06:53 +01:00
Donal McBreen
f8b0883036
Make the sample docker setup hook executable
...
Fixes https://github.com/basecamp/kamal/issues/754
2024-04-03 15:50:47 +01:00
Donal McBreen
c8100d1f26
Tidy up role and host commander setup
...
Extract Kamal::Commander::Specifics to deal with host and role setup and
ensure that primary hosts and roles always come first. This means that
in a rolling deploy we deploy to the primary ones first.
This will be important when we remove the healthcheck step as we want
to confirm the primary host can be deployed to before completing a
deployment for other roles.
By setting the hosts and roles all together in one place we can sort
the primary ones to the front without creating infinite loops.
2024-04-03 15:46:30 +01:00
Donal McBreen
3628ecaa44
Merge pull request #753 from basecamp/dump-hook-output-on-failure
...
Include error message on failure
2024-04-03 10:52:49 +01:00
Donal McBreen
67a2d5e7ca
Include error message on failure
2024-04-03 10:43:20 +01:00
Donal McBreen
5e492ecc4d
Merge pull request #748 from basecamp/latest-by-tag
...
Latest by tag
2024-04-03 09:11:03 +01:00
Donal McBreen
77bad291a1
Merge pull request #751 from basecamp/app-exec-env
...
Set env variables when running kamal app exec
2024-04-02 11:03:38 +01:00
Donal McBreen
a0ce9f66c4
Merge pull request #752 from basecamp/dont-debug-hooks
...
Use default verbosity for hooks
2024-04-02 11:03:24 +01:00
Donal McBreen
82962c375d
Use default verbosity for hooks
2024-04-02 10:47:05 +01:00
Donal McBreen
8a6a51977f
Set env variables when running kamal app exec
...
Allow additional env variable to be set when running `kamal app exec`.
Works for both new and existing containers.
2024-04-01 15:01:32 +01:00
Donal McBreen
2562853ae3
Merge pull request #746 from igor-alexandrov/file-join
...
Replaced string interpolations with File.join to build paths
2024-03-29 13:47:24 +00:00
Donal McBreen
ed90b99f0d
Add tag_latest_image tests
2024-03-29 10:51:57 +00:00
Donal McBreen
ba7a13f895
Only tag after deploying to all hosts
2024-03-29 10:29:58 +00:00
Donal McBreen
05ac808f2a
Use image tag to determine stale containers
...
Use current_running_version to determine the latest version when finding
stale containers.
2024-03-29 10:23:50 +00:00
Donal McBreen
fb7d9077ff
Use latest tag for the current destination
2024-03-29 09:48:09 +00:00
Donal McBreen
bade195e93
Redefine what the "latest" container means
...
Currently the latest container is the one that was created last. But if
we have had a failed deployment that left two containers running that
would not be the one we want. The second container could be in a
restart loop for example.
Instead we want the container that is running the image tagged as
latest. As we now tag as latest after a successful deployment we can
trust that that is a healthy container.
In the case that there is no container running the latest image tag,
we'll fall back to the latest container.
This could happen if the deploy was halted in between the old container
being stopped and the image being tagged as latest.
2024-03-29 08:51:50 +00:00
Donal McBreen
55dd2f49c1
Tag image after booting and include destination
...
If you are deploying more than one destination to a host, the latest
tags will conflict, so we'll append the destination to the tag.
The latest tag is used when booting the app or exec-ing a new container.
If a deploy doesn't complete on a host for all roles then we should
probably not be using it, so move the tagging to the end of the boot
process.
2024-03-29 08:51:50 +00:00
Igor Alexandrov
511a182539
Replaced string interpolations with to build paths
2024-03-28 20:25:24 +04:00
Donal McBreen
8bb596e216
Merge pull request #741 from igor-alexandrov/destination_in_lock
...
Added destination to the lock directory
2024-03-28 08:26:57 +00:00
Igor Alexandrov
699bcc0d27
Combined two methods and into one
2024-03-27 20:56:47 +04:00
Donal McBreen
6aacd1f9e2
Merge pull request #745 from basecamp/add-empty-destination-label
...
Label containers with empty destinations
2024-03-27 15:05:43 +00:00
Donal McBreen
20e71d91c0
Label containers with empty destinations
...
This will allow us to filter for containers that have no destination in
cases where we deploy an empty + a non empty destination to the same
host.
To note:
```
\# Containers with a destination label
$ docker ps --filter label=destination
\# Containers with an empty destination label
$ docker ps --filter label=destination=
```
2024-03-27 14:48:55 +00:00
Donal McBreen
866303a59b
Merge pull request #700 from basecamp/git-archive-build
...
Build from a git archive
2024-03-27 09:23:00 +00:00
Donal McBreen
53bfefeb2f
Make building from a git archive the default
...
If no context is specified and we are in a git repo, then we'll build
from a git archive by default. This means we don't need a separate
setting and gives us a safer default build.
2024-03-27 08:42:10 +00:00
Donal McBreen
f3b7569032
Build from a git archive
...
Building directly from a checkout will pull in uncommitted files to or
more sneakily files that are git ignored, but not docker ignored.
To avoid this, we'll add an option to build from a git archive of HEAD
instead. Docker doesn't provide a way to build directly from a git
repo, so instead we create a tarball of the current HEAD with git
archive and pipe it into the build command.
When building from a git archive, we'll still display the warning about
uncommitted changes, but we won't add the `_uncommitted_...` suffix to
the container name as they won't be included in the build.
Perhaps this should be the default, but we'll leave that decision for
now.
2024-03-27 08:38:56 +00:00
Donal McBreen
e5457cf7b4
Merge pull request #736 from tiramizoo/traefik-info
...
Add tip how to apply changes to traefik by "traefik reboot"
2024-03-27 08:38:15 +00:00
Igor Alexandrov
cee449c269
Put locks in a locks directory. Ensure that locks directory exits on a primary host.
2024-03-27 12:04:39 +04:00
Donal McBreen
786454f2ee
Merge pull request #502 from latyshev/main
...
Fix accessory name checking that is passing to command `kamal accessory`
2024-03-26 13:58:26 +00:00
Donal McBreen
827e18480d
Merge pull request #732 from basecamp/always-send-clear-env
...
Always send the clear env to the container
2024-03-26 11:01:59 +00:00
Donal McBreen
9f9c9ccbde
Merge pull request #742 from igor-alexandrov/remove_service_role_dest
...
Removed unused method from Kamal::Commands::App
2024-03-26 08:10:36 +00:00
Evgeny Latyshev
981d391d4d
Fix accessory name check in with_accessory
2024-03-26 09:29:34 +03:00
Igor Alexandrov
900041001a
Removed unused method
2024-03-25 22:48:23 +04:00
Igor Alexandrov
43672ec9a5
Added destination to the lock directory
2024-03-25 22:42:22 +04:00
Donal McBreen
5481fbb973
Test that we pull in env host variables
...
Now that clear env variables specified on the command line we can check
that values specified as `${VAR}` are pulled in from the host.
2024-03-25 12:26:37 +00:00
Donal McBreen
49afdbb09a
Always send the clear env to the container
...
Secret and clear env variables have different lifecycles. The clear ones
are part of the repo, so it makes sense to always deploy them with the
rest of the repo.
The secret ones are external so we can't be sure that they are up to
date, therefore they require an explicit push via `envify` or `env push`.
We'll keep the env file, but now it just contains secrets. The clear
values are passed directly to `docker run`.
2024-03-25 11:42:27 +00:00
Donal McBreen
5f58575b62
Merge pull request #730 from igor-alexandrov/confirming_dialogs
...
Added -y option to kamal traefik reboot command
2024-03-22 15:14:44 +00:00
Wojciech Wnętrzak
cb49d7dada
Add tip how to apply changes to traefik by "traefik reboot"
...
Running "traefik restart" is not enough to apply changes
2024-03-22 13:50:54 +01:00
Igor Alexandrov
3d26fa8ddd
Updated confirmation text for the traefik reboot command
2024-03-22 14:27:18 +04:00
Donal McBreen
ea9f8b488d
Merge pull request #735 from basecamp/extract-app-boot-steps
...
Extract app boot steps
2024-03-22 09:35:04 +00:00
Donal McBreen
83472af32c
Merge pull request #734 from basecamp/rubocop-rails-omakase
...
Switch to rubocop-rails-omakase rubocop rules
2024-03-22 09:33:25 +00:00
Donal McBreen
e99e1955b8
Extract app boot steps
...
The Kamal::Cli::App#boot has a lot to do, so extract the steps to make
things clearer.
2024-03-22 09:21:52 +00:00
Donal McBreen
30e0c44396
Switch to rubocop-rails-omakase rubocop rules
...
No code changes required
2024-03-21 13:47:20 +00:00
Donal McBreen
20d6e5365e
Merge pull request #733 from basecamp/integration-test-roles
...
Integration test roles
2024-03-21 13:43:33 +00:00
Donal McBreen
72ace2bf0b
Add an integration test for roles
...
Add an app with roles to the integration tests. We'll deploy two web
containers and one worker. The worker just sleeps, so we are testing
that the container has booted.
2024-03-21 13:30:53 +00:00
Donal McBreen
ba40d026d0
Make integration test app to deploy configurable
2024-03-21 12:09:59 +00:00
Igor Alexandrov
0f13600ba3
Fixed Traefik integration test
2024-03-21 09:25:07 +04:00
Igor Alexandrov
bbf952952d
Added -y option to kamal traefik reboot command
2024-03-20 22:00:13 +04:00
Donal McBreen
474b76cf47
Merge pull request #701 from basecamp/rubocop
...
Add Rubocop
2024-03-20 10:59:35 +00:00
Donal McBreen
3ecfb3744f
Add Rubocop
...
- Pull in the 37signals house style
- Autofix violations
- Add to CI
2024-03-20 10:23:02 +00:00
Donal McBreen
c985fa33d1
Bump version for 1.4.0
2024-03-20 09:27:23 +00:00
Donal McBreen
e8b9f8907f
Merge pull request #715 from basecamp/use-role-not-string-in-config
...
Pass around Roles instead of Strings
2024-03-08 08:55:53 +00:00
Donal McBreen
4966d52919
Pass around Roles instead of Strings
...
Avoid looking up roles by names everywhere. This avoids the awkward
role/role_config naming as well.
2024-03-08 08:44:35 +00:00
Donal McBreen
52bb40add0
Merge pull request #656 from DanielJackson-Oslo/informative-error-message-on-lock
...
Informative message on lock error
2024-03-07 11:16:18 +00:00
Donal McBreen
73a9276cdd
Fix up app command tests
2024-03-07 11:11:20 +00:00
Donal McBreen
8c0784ed4a
Merge pull request #634 from alhafoudh/main
...
Allow lines option to be configured when following app logs
2024-03-07 11:11:08 +00:00
Donal McBreen
089a2d3bba
Merge pull request #710 from basecamp/install-wget-or-curl
...
Install docker with curl or wget
2024-03-07 11:01:30 +00:00
Donal McBreen
bd76d23916
Merge pull request #593 from CleverFew/role_logging_config
...
Role specific logging configuration
2024-03-07 10:53:34 +00:00
Donal McBreen
fa37fcd10c
Merge pull request #585 from tsvallender/docker-network
...
Add docker-setup hook
2024-03-07 10:51:08 +00:00
Donal McBreen
f5dc0858b0
Update error message to include wget
2024-03-07 10:49:32 +00:00
Donal McBreen
9dddb140b1
Merge pull request #558 from GeNiuS69/add-skip_push-to-setup
...
Add --skip_push option to setup
2024-03-07 10:26:41 +00:00
Donal McBreen
26b1d57c90
Install docker with curl or wget
...
If curl is not available to download the docker install script, try
with wget instead.
If neither is available or both fail, return a simple failing script
so that we don't carry on regardless.
Fixes: https://github.com/basecamp/kamal/issues/395
2024-03-07 10:16:03 +00:00
Donal McBreen
b94199415f
Convert combine by: '||' to any
2024-03-07 09:10:49 +00:00
Trevor Vallender
f69c45b7ea
Add docker-setup hook
...
This allows the user to make any necessary configuration changes to
Docker before setting up any containers, allowing those configuration
changes to take effect from the outset.
2024-03-06 19:01:48 +00:00
Donal McBreen
32a2ae5b2c
Merge pull request #708 from nickhammond/valid_service_name
...
Remove warning for valid service name
2024-03-06 16:22:04 +00:00
Nick Hammond
37544a6383
Merge branch 'basecamp:main' into valid_service_name
2024-03-06 09:09:13 -07:00
Nick Hammond
a1bc6d61af
Switch the regex ordering for hyphen and underscore for service name to remove warning
2024-03-06 09:08:17 -07:00
Donal McBreen
5c32be10f1
Merge pull request #707 from basecamp/boot-strategy-min-limit-1
...
Ensure a minimum limit of 1 for % boot strategy
2024-03-06 16:06:35 +00:00
Donal McBreen
dc5af03593
Update tests to match single quotes
2024-03-06 16:04:31 +00:00
Donal McBreen
1abd029ea0
Merge pull request #696 from dorianmariecom/patch-1
...
Replace \`service\` by 'service' so it doesn't get executed by bash
2024-03-06 16:04:11 +00:00
Donal McBreen
c4d0d3e5eb
Merge pull request #704 from basecamp/escape-registry-username-password
...
Escape the docker registry username and password
2024-03-06 15:58:46 +00:00
Donal McBreen
46e7cf8e78
Merge pull request #706 from basecamp/kamal-remove-noop
...
Ensure `kamal remove` completes without setup
2024-03-06 15:58:34 +00:00
Donal McBreen
c7cfc074b6
Ensure a minimum limit of 1 for % boot strategy
...
Fixes: https://github.com/basecamp/kamal/issues/681
2024-03-06 15:51:35 +00:00
Donal McBreen
c10f43e365
Merge pull request #692 from nickhammond/valid_service_name
...
Add a simple validation to the service name to prevent setup issues
2024-03-06 15:24:39 +00:00
Donal McBreen
8e2184d65e
Ensure kamal remove completes without setup
...
If `kamal setup` has not run or errored out part way through,
`kamal remove` should still complete.
Fixes: https://github.com/basecamp/kamal/issues/629
2024-03-06 14:59:26 +00:00
Donal McBreen
2be397b679
Escape the docker registry username and password
...
Fixes: https://github.com/basecamp/kamal/issues/278
2024-03-06 11:04:55 +00:00
Donal McBreen
cc8c508556
Merge branch 'main' into valid_service_name
2024-03-05 11:02:33 +00:00
Nick Hammond
3b16e047c5
Add hyphen to the allowed character list for service name
2024-03-04 10:03:22 -07:00
Donal McBreen
6563393d9a
Merge pull request #627 from aishek/626-mention-sprockets-config-in-deploy-template
...
Mention Sprockets config in deploy template
2024-03-04 15:31:41 +00:00
Ahmed Al Hafoudh
91f350fcce
Merge branch 'basecamp:main' into main
2024-03-04 16:22:28 +01:00
Nick Lozon
e4e9664049
use double quotes
2024-03-04 10:10:51 -05:00
Nick Lozon
1acef5221f
test deep_merge
2024-03-04 10:06:30 -05:00
Nick Lozon
788a57e85e
role logging_args method, use in app
2024-03-04 10:06:30 -05:00
Nick Lozon
f9a934a01f
configuration logging accessor
2024-03-04 10:06:30 -05:00
Aleksandr Borisov
f286fdc374
Update lib/kamal/cli/templates/deploy.yml
...
Co-authored-by: Donal McBreen <dmcbreen@gmail.com >
2024-03-04 16:26:11 +03:00
Donal McBreen
828cca322b
Merge pull request #650 from basecamp/retained-containers
...
Config the number of containers to keep
2024-03-04 12:05:35 +00:00
Donal McBreen
cb030e8751
Merge pull request #680 from igor-alexandrov/traefik-2.10
...
Bump default Traefik image to 2.10
2024-03-04 11:58:37 +00:00
Donal McBreen
6892abb4be
Config the number of containers to keep
...
By default we keep 5 containers around for rollback. The containers
don't take much space, but the images for them can.
Make the number of containers to retain configurable, either in the
config with the `retain_containers` setting on the command line
with the `--retain` option.
2024-03-04 11:55:45 +00:00
Donal McBreen
bcfd0ca88a
Merge pull request #645 from juan-apa/fix-missing-netscp-require
...
require missing net/scp dependency
2024-03-04 11:49:43 +00:00
Donal McBreen
2e8071a5b3
Merge pull request #608 from CleverFew/fix_accessory_cli_host_params
...
Accessory CLI respects `--hosts`
2024-03-04 11:31:50 +00:00
Donal McBreen
200e2686fd
Merge pull request #506 from rience/custom-acc-service-name
...
Allow for Custom Accessory Service Name
2024-03-04 10:57:10 +00:00
Donal McBreen
db94789dc1
Merge pull request #434 from rience/ssh-agent-support
...
Supports Passing SSH Agent Socket to Build Options
2024-03-04 10:54:47 +00:00
Dorian Marié
2bffc3bc74
Replace \service\ by 'service' so it doesn't get executed by bash
...
Fixes #694
2024-03-01 09:54:06 +01:00
Aleksandr Nigomatulin
064ace0598
Rollback passing invoke_options
2024-02-24 21:36:20 +06:00
Nick Hammond
a02af74dda
Add a simple validation to the service name to prevent setup issues
2024-02-22 09:47:48 -07:00
Aleksandr Nigomatulin
5ef384d666
Add test
2024-02-17 00:11:03 +06:00
Aleksandr Nigomatulin
b94dfe193b
Remove unnecessary code
2024-02-16 12:52:07 +06:00
Aleksandr Nigomatulin
bc6c027315
Upds according remarks
2024-02-16 11:56:58 +06:00
Krzysztof Adamski
1c2a45817a
Supports Passing SSH Args to Build Options
2024-02-15 14:20:20 +01:00
Krzysztof Adamski
b411356409
Allow for Custom Accessory Service Name
2024-02-15 11:12:18 +01:00
Igor Alexandrov
77e72e34ce
Bumped default Traefik image to 2.10
2024-02-13 16:00:02 +04:00
Daniel Jackson
ad04bb7556
Show context for lock status message on raise_if_locked
2024-01-23 09:17:15 +01:00
Daniel Jackson
1ec69d3764
Tell user about 'kamal lock help' when deploy fails due to a lock
2024-01-23 09:16:09 +01:00
Daniel Jackson
2d1a0dc9ba
Informative message on lock error
2024-01-22 09:11:17 +01:00
Juan Aparicio
c984db152f
require missing net/scp dependency
2024-01-11 17:00:13 -03:00
David Heinemeier Hansson
aea55480ad
Merge pull request #640 from basecamp/local-different-arch
...
Allow local builds using a different arch than native
2024-01-10 13:28:37 -08:00
dhh
5a09aa12ba
Allow local builds using a different arch than native
2024-01-10 13:00:48 -08:00
Donal McBreen
aca7796e9d
Bump version for 1.3.1
2024-01-10 08:56:34 +00:00
Donal McBreen
8b6d8306d1
Merge pull request #637 from basecamp/tests-wait-longer-for-health
...
Be a bit more patient during tests
2024-01-09 16:45:28 +00:00
Donal McBreen
bb50546467
Merge pull request #636 from basecamp/tests-clean-known-hosts
...
Fix Net::SSH::HostKeyMismatch between bin/test runs
2024-01-09 16:45:12 +00:00
Donal McBreen
acc6b9ad71
Merge pull request #635 from basecamp/missing-base64-require
...
Add a missing base64 require
2024-01-09 16:44:42 +00:00
Matthew Kent
9c681d4a38
Be a bit more patient during tests.
...
Seeing reasonably consistent local failures at 20 seconds.
2024-01-09 08:21:45 -08:00
Matthew Kent
2a8924b53c
Address Net::SSH::HostKeyMismatch seen locally between bin/test runs.
2024-01-09 08:21:30 -08:00
Matthew Kent
c5ae54d7d4
Add a missing base64 require.
...
Also, prepare for the moving of base64 from default to a bundled gem in ruby 3.4.
2024-01-09 08:21:10 -08:00
Donal McBreen
4b05068493
Merge pull request #638 from basecamp/rails-7.2-compatible-rubies
...
Rails 7.2 compatible Rubies
2024-01-09 12:10:29 +00:00
Donal McBreen
68eb549795
Update to actions/checkout@v4 to silence node warning
2024-01-09 11:35:10 +00:00
Donal McBreen
1a3dd52af4
Rails 7.2 compatible Rubies
...
1. Add Ruby 2.7 specific Gemfile that uses an older version of nokogiri
2. Rails edge doesn't support Ruby 2.7.0, so exclude it.
3. Add Ruby 3.3
4. Update Gemfile.lock to test against Rails 7.1.2 as it's the latest
version.
5. Remove continue-on-error from the matrix and always set to true
2024-01-09 11:13:11 +00:00
Ahmed Al Hafoudh
0d709a3fdb
Allow lines option to be configured when following app logs
2024-01-08 09:34:38 +01:00
Alexandr Borisov
414d29ae4e
Mention Sprockets config in deploy template
2024-01-04 09:18:38 +04:00
Nick Lozon
f8d8319c2f
better test description
2023-12-12 15:37:12 -05:00
Nick Lozon
f6a9d54902
unit test
2023-12-12 15:07:29 -05:00
Nick Lozon
b2fd5744fb
perform intersection on specified hosts
2023-12-12 14:39:33 -05:00
Donal McBreen
457f06da13
Merge pull request #598 from basecamp/fix-duplicate-role-env-vars
...
Fix duplicate role env vars
2023-11-29 10:09:34 +00:00
Matthew Kent
7fa53d90bd
Merge hashes to de-dupe the app and role envs.
...
This is better then adding them together which confusingly results in
both ENV vars in the same file, though based on the load order, they
worked anyway.
2023-11-28 15:59:03 -08:00
Donal McBreen
a155b7baab
Bump version for 1.3.0
2023-11-28 14:06:45 +00:00
Donal McBreen
175e3bc159
Merge pull request #507 from leonvogt/introduce-absolute-accessories-paths
...
Add option to set an absolute directory path
2023-11-28 10:15:27 +00:00
Donal McBreen
e3d8a2aa82
Merge pull request #594 from basecamp/match-primary-role-in-filters
...
Try to match primary_role when roles are filtered
2023-11-28 09:15:39 +00:00
Donal McBreen
0e067fb5e1
Merge pull request #595 from basecamp/error-on-filter-miss
...
Error out when roles or host filters don't match anything
2023-11-27 08:08:19 +00:00
Matthew Kent
63babecba7
Raise an error when either the filtered hosts or roles are empty.
...
Keeps us confusingly running things on the primary_host when nothing
matches.
2023-11-25 12:47:39 -08:00
Matthew Kent
79baa598fa
Make an effort to match the primary_role from a list of specific roles.
...
This is less surprising than picking the first role and first host.
2023-11-24 17:41:58 -08:00
Donal McBreen
b1dc188841
Remove stray file
2023-11-23 09:22:36 +00:00
Donal McBreen
635876bdb9
Merge pull request #523 from rmacklin/fix-error-message-in-pre-build-sample-hook
...
Fix duplicate error message in pre-build.sample
2023-11-16 08:51:22 +00:00
Donal McBreen
11521517fa
Merge pull request #550 from dmitrytrager/feature-name-all-for-accessory-reboot
...
feature: add NAME=all option for accessory reboot
2023-11-16 08:50:51 +00:00
Donal McBreen
610d9de3fd
Merge pull request #580 from happyscribe/feat/no-web
...
Allow Kamal to run without traefik
2023-11-16 08:44:45 +00:00
Donal McBreen
bf79df0f72
Bump version for 1.2.0
2023-11-15 14:48:11 +00:00
Donal McBreen
a0959b5afd
Merge pull request #573 from basecamp/pre-post-traefik-reboot-hooks
...
Pre and post Traefik reboot hooks
2023-11-15 14:01:40 +00:00
Yoel Cabo
7472e5dfa6
Merge remote-tracking branch 'origin/main' into feat/no-web
2023-11-14 12:11:18 +01:00
Yoel Cabo
887b7dd46d
Do not invoke healthcheck on deploy when no web role
2023-11-14 11:34:32 +01:00
Donal McBreen
77a79b299a
Merge pull request #583 from basecamp/wildcard-filters
...
Add wildcards to roles and hosts filters
2023-11-14 08:19:02 +00:00
Matthew Kent
efcb855db7
Advertise wildcard support.
2023-11-13 23:43:26 -08:00
Matthew Kent
7137850354
Add support for wildcard matches with '*' on roles and hosts.
...
eg:
--roles=*_chicago,*_tokyo
--hosts=app-*
Useful for targeted deploys.
2023-11-13 23:43:23 -08:00
Donal McBreen
8a85840a47
Merge pull request #582 from basecamp/allow-empty-roles
...
Add allow_empty_roles to control aborting on roles with no hosts.
2023-11-13 09:30:01 +00:00
Donal McBreen
80cc0c23d8
Merge pull request #578 from basecamp/enable-yaml-aliases
...
Enable yaml aliases
2023-11-13 09:28:40 +00:00
Donal McBreen
14a9129410
Merge pull request #577 from basecamp/set-primary-web-role
...
Support customizing the primary_web_role
2023-11-13 09:27:18 +00:00
Matthew Kent
60187cc3a4
Add allow_empty_roles to control aborting on roles with no hosts.
...
This added flexibility allows you to define base roles that might not
necessarily exist in each deploy destination.
2023-11-12 08:54:28 -08:00
Yoel Cabo
87cb8c1f71
fix: allow configurations without web roles
2023-11-12 09:39:07 +01:00
Matthew Kent
ed58ce6e61
Add test coverage with aliases.
2023-11-11 17:25:50 -08:00
Matthew Kent
263b4a4fb8
Enable aliases for more exotic templating situations.
...
This is super useful for DRY when configuring a number of roles and you
hit the limits of what's reasonable with ERB.
2023-11-11 17:25:50 -08:00
Matthew Kent
073f745677
Test for both undefined roles and missing traefik.
2023-11-11 12:57:52 -08:00
Matthew Kent
a9cc7c73d2
Handle an undefined primary_web_role.
2023-11-11 12:57:31 -08:00
Matthew Kent
6898e8789e
Further test the override.
2023-11-10 17:17:16 -08:00
Matthew Kent
d0ac6507e7
Add test coverage.
2023-11-10 16:49:37 -08:00
Matthew Kent
628a47ad88
Background for the new option.
2023-11-10 16:39:06 -08:00
Matthew Kent
47f8725cf3
Support a dynamic primary_web_role instead of assuming it's 'web'.
...
This allows for more meaningful naming in roles.
The only caution here is that we don't support the renaming of roles, so
any migration is left to the user.
2023-11-10 16:35:25 -08:00
Donal McBreen
5fd4a28bf7
Pre and post Traefik reboot hooks
...
Provide pre and post reboot hooks for Traefik, that can be used to
remove/add to an external load balancer to prevent requests from being
sent during the reboot.
Works best with the --rolling setting, where each hook is called once
per host.
2023-11-08 15:11:26 +00:00
Donal McBreen
97ba6b746b
Merge pull request #564 from basecamp/return-502-if-no-container
...
Return a 502 when container is down
2023-11-08 14:58:22 +00:00
Donal McBreen
9e25d8a012
Priority 2 for the main app
2023-11-08 14:12:45 +00:00
Donal McBreen
da161445fa
Merge pull request #508 from leonvogt/ssh-port-option
...
Configurable SSH port
2023-11-06 08:48:26 +00:00
Leon
f339626667
Add option to set absolute directory path
2023-11-03 22:48:30 +01:00
Leon
2d86d4f7cc
Add SSH port to run_over_ssh
2023-11-03 22:32:37 +01:00
Leon
792aa1dbdf
Add SSH port option
2023-11-03 22:32:37 +01:00
Donal McBreen
24a2f51641
Return a 502 when container is down
...
If the app container is down or not responding then traefik will return
a 404 response code. This is not ideal as it suggests a client rather
than a server problem.
To fix this, we'll define a catch all route that always returns a 502.
This is not ideal as this route would take priority over a shorter route
with priorty 1.
TODO: up the priority of the app route.
2023-11-03 14:20:52 +00:00
Donal McBreen
8f53104d00
Bump version for 1.1.0
2023-11-01 09:20:45 +00:00
dmitrytrager
2d22143a24
feature: add NAME=all option for accessory reboot
2023-10-31 00:13:45 +01:00
Aleksandr Nigomatulin
cbd99306eb
Add skip_push option to setup
2023-10-30 23:27:58 +06:00
Donal McBreen
78fc91f2ec
Merge pull request #557 from basecamp/envify-reset-env-before-push
...
Reset the env before pushing
2023-10-30 11:54:00 +00:00
Donal McBreen
dd748fac8c
Reset the env before pushing
...
Calling `load_envs` again does not load updated env variables, because
Dotenv does not overwrite existing values.
To fix this we'll store the original ENV and reset to it before
reloading.
https://github.com/basecamp/kamal/issues/512
2023-10-30 11:31:50 +00:00
Donal McBreen
b732b2dd55
Merge pull request #547 from nickhammond/envify/trim-lines
...
Enable trim mode with ERB
2023-10-30 08:57:55 +00:00
Donal McBreen
e3254b2aa8
Merge pull request #544 from nickhammond/bugfix-require-sshkit-sensitive-util
...
Require sshkit within the sshkit util
2023-10-30 08:57:08 +00:00
Donal McBreen
e9269d2ee8
Merge pull request #501 from rience/optional-envify-push
...
Optionally Skip Push for "envify"
2023-10-30 08:30:21 +00:00
Donal McBreen
d2214b43b7
Merge pull request #499 from basecamp/env-only-needed-for-push
...
Remove the env check
2023-10-30 08:22:56 +00:00
Donal McBreen
370481921e
Merge pull request #498 from basecamp/app-exec-env-file
...
App exec with env file
2023-10-30 08:22:35 +00:00
Donal McBreen
aa23f26330
Merge pull request #479 from npezza93/main
...
Loosen superuser check to match docker-installs script check
2023-10-30 08:21:30 +00:00
Donal McBreen
f4933d83bf
Merge pull request #477 from clintmiller/patch-1
...
Pass KAMAL_VERSION env var to container run
2023-10-30 08:19:20 +00:00
Nick Hammond
6c36c82153
Enable trim mode with ERB
2023-10-24 17:09:05 -07:00
Krzysztof Adamski
8ca04032a1
Optionally Skip Push for "envify"
2023-10-23 14:49:39 +02:00
Nick Hammond
2fb22c934b
Require sshkit within the sshkit util
2023-10-22 22:34:22 -07:00
Richard Macklin
f96d071222
Fix copy-pasted error message in pre-build.sample
...
The "No git remote set" error message was appropriate for the previous
block (where it was presumably copy-pasted from), but in this line we
have failed the check that determines if we have a git branch checked
out, so we should output a corresponding error.
2023-10-08 15:14:40 -07:00
Donal McBreen
f6662c7a8f
Remove the env check
...
The env check is not needded anymore as all the commands rely on the
env files having already been created remotely.
The only place the env is needed is when running `kamal env push` and
that will still raise an apropriate error.
2023-09-25 15:23:01 +01:00
Donal McBreen
645f5ab72d
App exec with env file
...
When calling `kamal app exec` for new non interactive containers, run
the command per role on each server and include the role config
including the environment.
Fixes: https://github.com/basecamp/kamal/issues/492
2023-09-25 15:07:05 +01:00
Clint Miller
8dca65f48f
Fix commands/app tests
2023-09-20 08:12:27 -05:00
dhh
83a2d52ff4
Bump version for 1.0.0
2023-09-18 17:39:01 -07:00
Nick Pezza
1a2796a7d0
Loosen superuser check to match docker-installs script check
2023-09-18 20:32:59 -04:00
Clint Miller
d80fdf8468
Pass KAMAL_VERSION env var to container run
...
In lieu of a general purpose mechanism to pass dynamically-evaluated env-vars at container execution time, we can pass the `config.version` as KAMAL_VERSION to avoid having to take apart the container name just to determine the SHA of the deployed version in the entrypoint.
2023-09-18 16:07:36 -05:00
dhh
90fefc419f
Point to rolling restarts
2023-09-18 08:31:49 -07:00
dhh
8671963719
Explain asset bridging
2023-09-18 08:16:44 -07:00
Donal McBreen
a03ffd5b92
Merge pull request #476 from basecamp/exec-with-role
...
Run interactive commands with the correct host
2023-09-18 12:14:13 +01:00
Donal McBreen
0861730e0e
Run interactive commands with the correct host
...
Fixes https://github.com/basecamp/kamal/issues/430
2023-09-18 12:00:36 +01:00
David Heinemeier Hansson
6b0f93a564
Update README.md
2023-09-16 16:02:54 -07:00
David Heinemeier Hansson
e6371faf4f
Merge pull request #473 from basecamp/introduce-git-gateway
...
Extract Kamal::Git as gateway for all git usage
2023-09-16 11:47:18 -07:00
dhh
e95a9b4fa2
Fix tests
2023-09-16 11:35:29 -07:00
dhh
e5886a1a8e
Merge branch 'main' into introduce-git-gateway
...
* main:
Healthcheck polling is a CLI concern
2023-09-16 11:31:48 -07:00
David Heinemeier Hansson
ec8192b160
Merge pull request #472 from basecamp/move-healthcheck-poller-to-cli
...
Healthcheck polling is a CLI concern
2023-09-16 11:31:28 -07:00
dhh
2da03a220d
Merge branch 'main' into introduce-git-gateway
...
* main:
No longer used
Fix env validation
Fix tests
Fix test
Extract Kamal::EnvFile
2023-09-16 11:31:18 -07:00
dhh
cfbfb37e23
Extract Kamal::Git as gateway for all git usage
2023-09-16 11:30:29 -07:00
David Heinemeier Hansson
ff4d025840
Merge pull request #471 from basecamp/extract-env-writer
...
Extract Kamal::EnvFile
2023-09-16 11:29:43 -07:00
dhh
59ac59d351
Healthcheck polling is a CLI concern
...
Also, it has no instance variables, so let's just have it be a module.
2023-09-16 11:19:38 -07:00
dhh
3df87520db
No longer used
2023-09-16 11:12:52 -07:00
dhh
85ce65a4ce
Merge branch 'main' into extract-env-writer
...
* main:
Inline util method only used in one place
2023-09-16 11:12:08 -07:00
dhh
12a82a6c58
Inline util method only used in one place
2023-09-16 11:11:24 -07:00
dhh
b2d2a254d7
Fix env validation
2023-09-16 11:05:47 -07:00
dhh
62cdf31ae2
Fix tests
2023-09-16 11:01:16 -07:00
dhh
0dcebe7d34
Fix test
2023-09-16 10:59:41 -07:00
dhh
32a5c157b9
Merge branch 'main' into extract-env-writer
...
* main:
No longer used
2023-09-16 10:56:29 -07:00
dhh
97cea8950d
No longer used
2023-09-16 10:56:00 -07:00
dhh
873be0b76b
Extract Kamal::EnvFile
...
Cleaning up the Utils junk drawer.
2023-09-16 10:55:41 -07:00
David Heinemeier Hansson
3a8eb0cf7d
Merge pull request #470 from basecamp/extract-app-concerns
...
Extract app concerns
2023-09-16 10:24:24 -07:00
dhh
e9ef13d06d
Group configuration methods in logical sections
2023-09-16 10:20:08 -07:00
dhh
f648fe6c3f
Grouping + ordering
2023-09-16 10:14:04 -07:00
dhh
46895d0b08
Better ordering and spacing
2023-09-16 10:11:42 -07:00
dhh
431ca9e809
Remind about env push
2023-09-16 10:09:42 -07:00
dhh
6b5c5f0650
Extract Logging too
...
Leave only the core essentials in App
2023-09-16 10:03:28 -07:00
dhh
d303fcc621
Extract Containers and Images concerns
2023-09-16 09:58:09 -07:00
dhh
3ae855ef28
Explain method better
2023-09-16 09:53:03 -07:00
dhh
76a3086569
Group related methods with spacing
2023-09-16 09:52:54 -07:00
dhh
07646bc020
Extract Cord, Assets, and Execution concerns from App
...
It was getting crowded!
2023-09-16 09:51:45 -07:00
dhh
880b8b267a
Fix test
2023-09-16 09:38:30 -07:00
dhh
37e5c48a27
Setup run directory on accessory hosts as well
...
cc @djmb
2023-09-15 11:08:27 -07:00
dhh
deb67386fa
No need to suggest use of erb
2023-09-15 10:54:50 -07:00
dhh
81d74e4a9d
Record push of env files for audit on app servers
2023-09-15 10:20:31 -07:00
dhh
39c13dcc18
Push env files as part of setup
2023-09-15 10:20:31 -07:00
dhh
e7314a0eea
Explain ensuring Docker is installed
2023-09-15 10:20:31 -07:00
Donal McBreen
168c6e2da3
Merge pull request #467 from basecamp/assets-copy-hidden-files
...
Copy all files into asset volume
2023-09-15 08:46:02 +01:00
Donal McBreen
564765862b
Add hidden file check to integration tests
2023-09-15 08:37:41 +01:00
Donal McBreen
3c12d1799c
Copy all files into asset volume
...
Adding -T to the copy command ensures that the files are copied at the
same level into the target directory whether it exists or not.
That allows us to drop the `/*` which was not picking up hidden files.
Fixes: https://github.com/basecamp/kamal/issues/465
2023-09-15 08:07:48 +01:00
Donal McBreen
60835d13a8
Merge pull request #444 from rience/custom-healthcheck-log-lines-count
...
Configurable Number of Lines in Healthcheck Log Output
2023-09-13 08:57:00 +01:00
Krzysztof Adamski
892cf0e66b
Configurable Log Lines Number in Healthcheck Log Output
2023-09-12 21:06:36 +02:00
Krzysztof Adamski
8ddc484ce6
Configurable Lines Number in Healthcheck Log Output
2023-09-12 21:04:18 +02:00
Donal McBreen
0e021e3c57
Merge pull request #461 from basecamp/escape-newline-from-inspect-format
...
Escape the newline in the inspect query
2023-09-12 19:19:47 +01:00
Donal McBreen
fb0aeec27e
Escape the newline in the inspect query
2023-09-12 19:10:39 +01:00
Donal McBreen
a367819a1c
Merge pull request #460 from basecamp/traefik-wait-5s-after-unhealthy
...
Give Traefik 5s to drop old container
2023-09-12 17:12:20 +01:00
Donal McBreen
0afe289a20
Give Traefik 5s to drop old container
2023-09-12 17:03:51 +01:00
Donal McBreen
bf6af46ac3
Merge pull request #459 from basecamp/env-file-escape-newlines
...
Escape newlines in docker env files
2023-09-12 15:05:38 +01:00
Donal McBreen
df2b76aee1
Escape newlines in docker env files
...
When env variables were passed via `-e` newlines were escaped. This
updates the env file to do the same thing.
2023-09-12 14:57:19 +01:00
Donal McBreen
70a3c7195a
Merge pull request #458 from basecamp/avoid-env-empty-file-warning
...
Fix empty file warning when uploading env files
2023-09-12 12:05:31 +01:00
Donal McBreen
c651de177f
Fix empty file warning when uploading env files
2023-09-12 11:57:28 +01:00
Donal McBreen
7b42daa9fb
Merge pull request #457 from basecamp/remove-dangling-image-filter
...
Remove the `dangling=true` filter
2023-09-12 11:21:50 +01:00
Donal McBreen
9d49b3e391
Merge pull request #456 from basecamp/validate-image
...
Validate the build image
2023-09-12 11:18:32 +01:00
Donal McBreen
2c5ab054db
Remove the dangling=true filter
...
This has been removed from Docker Engine 24 and `docker image prune`
only deletes dangling images anyway.
Fixes https://github.com/basecamp/kamal/issues/410
2023-09-12 11:09:26 +01:00
Donal McBreen
66291a2aea
Validate the build image
...
Kamal needs images to have the service label so it can track them for
pruning. Images built by Kamal will have the label, but externally built
ones may not.
Without it images will build up over time. The worst case is an outage
if all the hosts disks fill up at the same time.
We'll add a check for the label and halt if it is not there.
2023-09-12 10:45:01 +01:00
Donal McBreen
d96e086945
Merge pull request #452 from basecamp/preconnect-to-build-remote-host
...
Connect to remote host before creating builder
2023-09-12 09:21:57 +01:00
Donal McBreen
8424458174
Check protocol is SSH before connecting
2023-09-12 09:12:57 +01:00
Donal McBreen
6a3b0249fe
Connect to remote host before creating builder
...
Connecting to the remote host will make any SSH configuration issues
obvious and add the host to known hosts if that is how SSHKit is
configured.
2023-09-12 09:12:57 +01:00
Donal McBreen
dfc2803714
Merge pull request #454 from basecamp/lts-ubuntu
...
Use LTS version of Ubuntu for integration tests
2023-09-12 09:12:31 +01:00
Donal McBreen
ade90bc051
Use LTS version of Ubuntu for integration tests
2023-09-12 08:59:54 +01:00
Donal McBreen
daa53f5831
Merge pull request #451 from basecamp/require-destinations
...
Add a require_destination setting
2023-09-12 08:26:36 +01:00
Donal McBreen
50a4f83db6
Merge pull request #450 from basecamp/stop-stale-container-when-deploying
...
Stop stale containers when deploying
2023-09-12 08:26:16 +01:00
Donal McBreen
00cb7d99d8
Merge pull request #449 from basecamp/asset-path
...
Asset paths
2023-09-12 08:26:07 +01:00
Donal McBreen
fb74910dc8
Merge pull request #425 from basecamp/prune-healthcheck-containers
...
Prune healthcheck containers
2023-09-12 08:25:50 +01:00
Donal McBreen
26dcd75423
Add a require_destination setting
...
If you always want to use a destination, and have a base deploy.yml file
that doesn't specify any hosts, then if you forget to specific the
destination you will get a cryptic error.
Add a "require_destination" setting you can use to avoid this.
2023-09-11 16:57:11 +01:00
Donal McBreen
afb9b0bbe2
Stop stale containers when deploying
...
An interrupted deployment can leave older containers lying around. To
ensure they are cleaned up subsequently, stop stale containers during
deployments instead of just reporting them.
2023-09-11 14:49:06 +01:00
Donal McBreen
718776eb72
Prune healthcheck containers
...
If a deployment is interrupted it could leave stale healthcheck
containers around that prevent dependent images from being pruned.
2023-09-11 14:36:25 +01:00
Donal McBreen
9d35793287
Merge pull request #440 from gf3/fix/ssh-auth-methods
...
fix: do not hardcode Net::SSH auth_methods
2023-09-11 14:32:37 +01:00
Donal McBreen
0b439362da
Asset paths
...
During deployments both the old and new containers will be active for a
small period of time. There also may be lagging requests for older CSS
and JS after the deployment.
This can lead to 404s if a request for old assets hits a new container
or visa-versa.
This PR makes sure that both sets of assets are available throughout the
deployment from before the new version of the app is booted.
This can be configured by setting the asset path:
```yaml
asset_path: "/rails/public/assets"
```
The process is:
1. We extract the assets out of the container, with docker run, docker
cp, docker stop. Docker run sets the container command to "sleep" so
this needs to be available in the container.
2. We create an asset volume directory on the host for the new version
of the app on the host and copy the assets in there.
3. If there is a previous deployment we also copy the new assets into
its asset volume and copy the older assets into the new asset volume.
4. We start the new container mapping the asset volume over the top of
the container's asset path.
This means the both the old and new versions have replaced the asset
path with a volume containing both sets of assets and should be able
to serve any request during the deployment. The older assets will
continue to be available until the next deployment.
2023-09-11 12:18:18 +01:00
Donal McBreen
2962f545b9
Merge pull request #447 from basecamp/output-per-line-mounts
...
Output one mount per line
2023-09-07 15:30:03 +01:00
Donal McBreen
cd02510d0f
Output one mount per line
...
The go template was concatenating all the mounts into one line. It
happened to work because the mount we are interested was always first.
Fix it to output one mount per line instead.
2023-09-07 15:20:50 +01:00
Donal McBreen
cccf79ed94
Merge branch 'main' into fix/ssh-auth-methods
2023-09-07 10:21:28 +01:00
Donal McBreen
aa9999809c
Merge pull request #439 from basecamp/zero-downtime-deploy-file
...
Zero downtime deployment with cord file
2023-09-07 09:34:40 +01:00
Donal McBreen
6263bf96ba
Merge pull request #438 from basecamp/remote-env-file
...
Copy env files to remote hosts
2023-09-07 09:34:22 +01:00
Gianni Chiappetta
9a539ffc86
chore: update tests to remove hardcoded ssh auth method
2023-09-06 10:59:17 -04:00
Donal McBreen
8a41d15b69
Zero downtime deployment with cord file
...
When replacing a container currently we:
1. Boot the new container
2. Wait for it to become healthy
3. Stop the old container
Traefik will send requests to the old container until it notices that it
is unhealthy. But it may have stopped serving requests before that point
which can result in errors.
To get round that the new boot process is:
1. Create a directory with a single file on the host
2. Boot the new container, mounting the cord file into /tmp and
including a check for the file in the docker healthcheck
3. Wait for it to become healthy
4. Delete the healthcheck file ("cut the cord") for the old container
5. Wait for it to become unhealthy and give Traefik a couple of seconds
to notice
6. Stop the old container
The extra steps ensure that Traefik stops sending requests before the
old container is shutdown.
2023-09-06 14:35:30 +01:00
Donal McBreen
94bf090657
Copy env files to remote hosts
...
Setting env variables in the docker arguments requires having them on
the deploy host.
Instead we'll add two new commands `kamal env push` and
`kamal env delete` which will manage copying the environment as .env
files to the remote host.
Docker will pick up the file with `--env-file <path-to-file>`. Env files
will be stored under `<kamal run directory>/env`.
Running `kamal env push` will create env files for each role and
accessory, and traefik if required.
`kamal envify` has been updated to also push the env files.
By avoiding using `kamal envify` and creating the local and remote
secrets manually, you can now avoid accessing secrets needed
for the docker runtime environment locally. You will still need build
secrets.
One thing to note - the Docker doesn't parse the environment variables
in the env file, one result of this is that you can't specify multi-line
values - see https://github.com/moby/moby/issues/12997 .
We maybe need to look docker config or docker secrets longer term to get
around this.
Hattip to @kevinmcconnell - this was all his idea.
2023-09-06 14:33:13 +01:00
Donal McBreen
adc7173cf2
Merge pull request #437 from basecamp/kamal-run-directory
...
Configurable Kamal directory
2023-09-06 14:31:07 +01:00
Donal McBreen
fd6bf5324a
Merge pull request #443 from rience/custom-healthcheck-port
...
Configurable Healthcheck Expose Port
2023-09-06 11:09:48 +01:00
Krzysztof Adamski
c2b2f7ea33
Fixing Tests
2023-09-06 10:16:59 +02:00
Krzysztof Adamski
bbcc90e4d1
Configurable Healthcheck Expose Port
2023-09-05 10:53:32 +02:00
Gianni Chiappetta
84f78cd9f9
fix: do not hardcode Net::SSH auth_methods
2023-09-01 15:11:12 -04:00
Donal McBreen
787688ea08
kamal -> .kamal
2023-08-28 17:13:52 +01:00
Donal McBreen
bcfa1d83e8
Configurable Kamal directory
...
To avoid polluting the default SSH directory with lots of Kamal config,
we'll default to putting them in a `kamal` sub directory.
But also make the directory configurable with the `run_directory` key,
so for example you can set it as `/var/run/kamal/`
The directory is created during bootstrap or before any command that
will need to access a file.
2023-08-28 16:32:18 +01:00
David Heinemeier Hansson
9363b6a464
Bump version for 0.16.1
2023-08-24 09:16:13 -07:00
David Heinemeier Hansson
338fd4e493
Merge pull request #428 from tbuehlmann/main
...
Fix picking the first available role on primary_host
2023-08-24 08:36:29 -07:00
David Heinemeier Hansson
eb3cb81a79
Merge pull request #368 from tsvallender/main
2023-08-24 06:12:48 -07:00
Tobias Bühlmann
556f7f5a37
Fix picking the first available role on primary_host
2023-08-24 13:50:24 +02:00
Trevor Vallender
c2ec04f8c1
Allow Traefik to run without publishing port
...
Adds the `publish` option which, if set to false, does not pass `--publish` to
`docker run` when starting Traefik. This is useful when running Traefik
behind a reverse proxy, for example.
2023-08-24 10:52:10 +01:00
David Heinemeier Hansson
519659b84c
Merge pull request #422 from fig/fix-421
...
require ActiveSupport module to provide String#remove
2023-08-23 13:50:04 -07:00
David Heinemeier Hansson
560d0698ac
Merge pull request #426 from northeastprince/fix-site-in-gemspec
...
Fix site URL in gemspec
2023-08-23 13:47:26 -07:00
fig
f40e8e9af1
Merge branch 'fix-421' of https://github.com/fig/mrsk into fix-421
2023-08-23 15:22:41 +01:00
fig
1ab7405e36
require ActiveSupport module to provide String#remove
...
fixes #421
2023-08-23 15:17:26 +01:00
Matt Almeida
aeadd7c11f
Fix site URL in gemspec
2023-08-23 15:15:51 +02:00
Donal McBreen
d0fbf538d3
Add integration test hooks back in
2023-08-23 07:36:48 +01:00
David Heinemeier Hansson
cfe77934e8
Update README.md
...
Point all docs to the site so we don't duplicate everything.
2023-08-22 17:11:26 -07:00
David Heinemeier Hansson
3f6ca1648e
Update docker-publish.yml
...
Require setting tag
2023-08-22 15:44:07 -07:00
David Heinemeier Hansson
7c6d302baa
Update docker-publish.yml
...
Allow manual invocation
2023-08-22 15:20:02 -07:00
fig
b8eb50b982
require ActiveSupport module to provide String#remove
...
fixes #421
2023-08-22 20:58:48 +01:00
David Heinemeier Hansson
d981c3c968
Move hooks
2023-08-22 12:47:00 -07:00
David Heinemeier Hansson
416860d9b0
Update docker-publish.yml
...
Reflect rename
2023-08-22 12:34:57 -07:00
David Heinemeier Hansson
33d5d7e9a2
Update README.md
...
Point to name change.
2023-08-22 12:20:24 -07:00
David Heinemeier Hansson
99c1102a3a
Update README.md
...
Will do a new video shortly.
2023-08-22 12:13:54 -07:00
David Heinemeier Hansson
ac11089c7a
Bump version for 0.16.0
2023-08-22 11:42:32 -07:00
David Heinemeier Hansson
180ca219df
Merge pull request #423 from basecamp/rename
...
Rename project to Kamal
2023-08-22 11:41:42 -07:00
David Heinemeier Hansson
dc1421a1fc
Correct casing
2023-08-22 09:22:32 -07:00
David Heinemeier Hansson
c4a203e648
Rename to Kamal
2023-08-22 08:24:31 -07:00
Donal McBreen
e2c3709d74
Merge pull request #417 from manastyretskyi/main
...
Fix builder registry cache when using default registry
2023-08-17 14:08:05 +01:00
Liubomyr Manastyretskyi
f68a33465f
Fix review comments
2023-08-17 11:58:14 +03:00
Donal McBreen
e7bc74d9ee
Merge pull request #418 from mrsked/ssh-logging
...
Configurable log levels
2023-08-16 07:22:18 +01:00
Donal McBreen
1163c3de07
Configurable log levels
...
Allow ssh log_level to be set - this will help to debug connection
issues.
2023-08-15 16:51:56 +01:00
Donal McBreen
715cd94bbf
Merge pull request #413 from mrsked/extract-version-from-container-name-correctly
...
Extract versions that contains dashes
2023-08-15 15:11:03 +01:00
Donal McBreen
dda7099b2f
Merge pull request #414 from mrsked/traefik-start-stop-run-errors
...
Don't hide Traefik errors
2023-08-15 15:10:47 +01:00
Donal McBreen
4262fce863
Merge pull request #415 from igor-alexandrov/fix-builder-configuration-validation
...
Removed validation for remote and local builder params
2023-08-15 15:10:23 +01:00
Liubomyr Manastyretskyi
6774675547
Fix builder registry cache when using default registry
2023-08-13 12:04:03 +03:00
Igor Alexandrov
0c52a1053e
Removed not needed configuration test
2023-08-08 19:14:03 +04:00
Igor Alexandrov
c24c7abb79
Fix for https://github.com/mrsked/mrsk/issues/407
2023-08-08 19:04:35 +04:00
Donal McBreen
c2d7fd775f
Don't hide Traefik errors
...
When stopping or starting Traefik, don't hide important errors.
Docker doesn't return an error when starting a started container or
stopping a stopped container.
When rebooting we want to know about errors during run as we've just
stopped and removed the previous container.
When booting, we want to leave the running container if it exists,
restart a stopped container and run a new one if none exists.
We can implement this with `docker start ... || docker run ...`:
- if the container is started, `docker start` will exit with 0
- if the container is stopped, `docker start` will start it and exit with 0
- if the container doesn't exist, `docker start` will return a non zero
exit code and `docker run` will create a new container. Any errors in
`docker run` will be returned.
2023-08-08 15:41:16 +01:00
Donal McBreen
4dd8208290
Extract versions that contains dashes
...
The version extraction assumed that the version is everything after the
last `-` in the container name. This doesn't work if you deploy a
non-MRSK generated version that contains a `-`.
To fix we'll generate the non version prefix and strip it off. In some
places for this to work we need to make sure to pass the role through.
Fixes: https://github.com/mrsked/mrsk/issues/402
2023-08-08 14:16:32 +01:00
Donal McBreen
aa89ededde
Merge pull request #399 from mrsked/manage-ssh-connection-starts
...
Manage SSH connection starts
2023-08-07 14:37:34 +01:00
David Heinemeier Hansson
299b166db7
Merge pull request #389 from brunoprietog/include-role-options-when-executing-commands
...
Include role options when executing commands
2023-07-26 14:04:28 +02:00
Donal McBreen
94d6a763a8
Extract ssh and sshkit configuration
2023-07-26 12:26:23 +01:00
Donal McBreen
752ff53458
Merge pull request #396 from igor-alexandrov/track-uncommitted-changes
...
Log uncommitted changes during deploy
2023-07-25 14:35:44 +01:00
Donal McBreen
eb8c97a417
Document new sshkit settings
2023-07-25 13:09:49 +01:00
Donal McBreen
f64b596907
Prevent SSH connection restarts
...
Set a high idle timeout on the sshkit connection pool. This will
reduce the incidence of re-connection storms when a deployment has been
idle for a while (e.g. when waiting for a docker build).
The default timeout was 30 seconds, so we'll enable keepalives at a
30s interval to match. This is to help prevent connections from being
killed during long idle periods.
2023-07-25 13:09:46 +01:00
Donal McBreen
b25cfa178b
Limit SSH start concurrency
...
Starting many (90+) SSH connections has caused us some issues such as
failed DNS lookups and hitting process file descriptor limits.
To mitigate this, patch SSHKit::Backend::Netssh to limit concurrency of
connection starts. We'll default to 30 at a time which seems to work
without issue, but can be configured via:
```
sshkit:
max_concurrent_starts: 10
```
2023-07-25 13:08:44 +01:00
Donal McBreen
edcfc77d95
Bump version for 0.15.1
2023-07-25 13:07:04 +01:00
Donal McBreen
a71e167a03
Merge pull request #400 from mrsked/revert-386-ssh-log-levels
...
Revert "Configurable SSH log levels"
2023-07-25 13:04:21 +01:00
Donal McBreen
2daaf442fa
Revert "Configurable SSH log levels"
2023-07-25 12:53:45 +01:00
Igor Alexandrov
d414253393
Updated uncommitted notification text
2023-07-24 20:12:22 +04:00
Bruno Prieto
cbd180205d
Include role options when executing commands
2023-07-24 17:45:24 +02:00
Donal McBreen
61b7dc90f2
Bump version for 0.15.0
2023-07-24 13:43:50 +01:00
David Heinemeier Hansson
f6442513ae
Merge pull request #357 from igor-alexandrov/documentation-update
...
Updated README with info for Rails <7 usage
2023-07-24 14:39:48 +02:00
Igor Alexandrov
ea941f33f9
Moved uncommitted changes message out of run_locally block
2023-07-21 22:45:23 +04:00
Igor Alexandrov
9c2a1dc7cd
Removed commented code in tests
2023-07-21 18:44:01 +04:00
Igor Alexandrov
0cfafd1d25
Log uncommitted changes during deploy
2023-07-21 18:37:45 +04:00
Donal McBreen
5e8df58e6b
Merge pull request #393 from basecamp/rolling-traefik-restarts
...
Support a --rolling option for traefik reboots
2023-07-19 16:43:59 +01:00
Lewis Buckley
9d5a6d1321
Document the rolling option for traefik reboots
2023-07-19 15:03:15 +01:00
Lewis Buckley
ecfd258093
Document the rolling reboot option
2023-07-19 14:58:46 +01:00
Lewis Buckley
313f89a108
Merge branch 'main' into rolling-traefik-restarts
...
* main:
Removed not needed MRSK.traefik.run command in Traefil reboot
Updated README with locking directory name
Include service name to lock details
Configurable SSH log levels
Add registry container output to debug
Minor tweaks to hooks section in readme
Update README.md
Updated README.md to make setup examples consistent
Login to the registry proactively before stoping Accessory and Traefik
2023-07-19 14:46:16 +01:00
Lewis Buckley
9ab448e186
Support a --rolling option for traefik reboots
2023-07-19 14:39:27 +01:00
Donal McBreen
e1433f3895
Merge pull request #349 from igor-alexandrov/login-to-registry-proactively
...
Login to the registry proactively before stoping Accessory and Traefik
2023-07-19 13:36:00 +01:00
Igor Alexandrov
a29e188c90
Removed not needed MRSK.traefik.run command in Traefil reboot
2023-07-19 15:08:42 +04:00
Donal McBreen
95e3915991
Merge pull request #386 from mrsked/ssh-log-levels
...
Configurable SSH log levels
2023-07-17 14:09:21 +01:00
Donal McBreen
30d342183d
Merge pull request #387 from igor-alexandrov/lock-with-service-name
...
Include service name to lock details
2023-07-17 14:07:22 +01:00
Igor Alexandrov
83f5f3f053
Updated README with locking directory name
2023-07-17 10:39:50 +04:00
Igor Alexandrov
e6ca270537
Include service name to lock details
2023-07-15 21:50:39 +04:00
Donal McBreen
cd88c49c42
Configurable SSH log levels
...
Allow ssh log_level to be set to debug connection issues.
2023-07-14 16:08:47 +01:00
Donal McBreen
d03195ce1c
Merge pull request #385 from mrsked/integration-test-registry-debug
...
Add registry container output to debug
2023-07-14 13:50:31 +01:00
Donal McBreen
da1c049829
Add registry container output to debug
2023-07-14 13:41:30 +01:00
Donal McBreen
4095e1853d
Merge pull request #356 from helgeblod/fix-readme-username-typo
...
Update README.md to make setup examples consistent
2023-07-12 13:24:51 +01:00
Donal McBreen
dbc9989730
Merge pull request #364 from nickhammond/patch-2
...
Update README.md
2023-07-12 13:22:53 +01:00
Donal McBreen
e493369453
Merge pull request #379 from nickhammond/patch-3
...
Minor tweaks to hooks section in readme
2023-07-12 11:29:36 +01:00
Nick Hammond
e760cfa457
Minor tweaks to hooks section in readme
2023-07-08 10:59:55 -06:00
Nick Hammond
f8d651af0d
Update README.md
...
Add a note about utilizing biometrics with the envify example.
2023-06-28 10:03:27 -06:00
Igor Alexandrov
08172be375
Updated README with info for Rails <7 usage
2023-06-26 16:05:24 +04:00
Jonas Helgemo
a3cc2317e2
Updated README.md to make setup examples consistent
...
- SSH and apt examples should use same username
2023-06-26 11:57:23 +02:00
Igor Alexandrov
2746a48e88
Login to the registry proactively before stoping Accessory and Traefik
2023-06-22 15:13:47 +04:00
David Heinemeier Hansson
9a501867b4
Bump version for 0.14.0
2023-06-20 17:02:42 +02:00
David Heinemeier Hansson
c5397ff51e
Merge pull request #342 from mrsked/only-require-secrets-when-mutating
...
Only require secrets when mutating
2023-06-20 16:50:14 +02:00
Donal McBreen
4950f61a87
Only require secrets when mutating
...
Rename `with_lock` to more generic `mutating` and move the env_args
check to that point. This allows read-only actions to be run without
requiring secrets.
2023-06-20 15:39:51 +01:00
David Heinemeier Hansson
08d8790851
Merge pull request #337 from igor-alexandrov/feature/cache
...
Support for Docker multistage build cache
2023-06-20 11:38:46 +02:00
Igor Alexandrov
02256ac8fe
More code style improvements
2023-06-19 18:22:07 +04:00
Igor Alexandrov
dadd8225da
Various code style improvements
2023-06-18 23:39:44 +04:00
Igor Alexandrov
aa28ee0f3e
Inroduce Native::Cached builder
2023-06-18 22:45:04 +04:00
David Heinemeier Hansson
2007ab475e
Merge pull request #327 from bestfriendfinance/fix-run-over-ssh-with-proxy-command
...
Add support for proxy_command to run_over_ssh
2023-06-18 17:18:50 +02:00
Igor Alexandrov
4df3389d09
Added support for multistage build cache
2023-06-18 19:02:10 +04:00
Matt Robinson
21b13bf8d3
Add support for proxy_command to run_over_ssh
2023-06-16 08:22:10 -03:00
David Heinemeier Hansson
6e6f696717
Merge pull request #335 from mrsked/specify-min-version
...
Add a minimum version setting
2023-06-16 10:02:40 +02:00
Donal McBreen
98c12a254e
Add a minimum version setting
...
Allow a minimum MRSK version to be specified in the config.
2023-06-15 14:53:03 +01:00
Donal McBreen
f0301d2007
Merge pull request #328 from igor-alexandrov/319-override-default-traefik-args
...
Added ability to override default Traefik command line arguments
2023-06-15 14:49:56 +01:00
Igor Alexandrov
d3f5e9efe8
Updated Traefik CLI test
2023-06-15 17:11:20 +04:00
Igor Alexandrov
d9b3fac17a
Added ability to override default Traefik command line arguments
2023-06-15 15:41:20 +04:00
Donal McBreen
cd5c41ddbe
Merge pull request #334 from basecamp/fix-ssh-symlink
...
Fix ssh symlink
2023-06-15 12:14:30 +01:00
Donal McBreen
a14c6141e5
Dump container logs on failure
2023-06-15 12:05:50 +01:00
Donal McBreen
95d6ee5031
Remove /root/.ssh before symlinking
...
Ensure the symlinks are created correctly whether or not /root/.ssh
already exists.
2023-06-15 12:02:56 +01:00
David Heinemeier Hansson
80a4ca4f8a
Merge pull request #331 from basecamp/fix-sample-pre-deploy-hook
...
Fix up the sample pre-deploy hook
2023-06-12 14:09:29 +02:00
Donal McBreen
12ca865e71
Fix up the sample pre-deploy hook
...
- Fix the shebang
- Extract a GithubStatusChecks class
2023-06-12 12:47:51 +01:00
David Heinemeier Hansson
66b4a0ea40
Bump version for 0.13.2
2023-06-01 12:54:06 +02:00
David Heinemeier Hansson
04b39ea798
Fix spelling
2023-05-31 18:15:21 +02:00
David Heinemeier Hansson
ae55a7b5d8
Merge pull request #325 from mrsked/revert-324-fix-filename-typo
...
Revert "Fix typo in fixture filename"
2023-05-31 18:14:51 +02:00
David Heinemeier Hansson
601cfbd95e
Revert "Fix typo in fixture filename"
2023-05-31 18:14:43 +02:00
David Heinemeier Hansson
9fdc85c2e6
Merge pull request #324 from basecamp/fix-filename-typo
...
Fix typo in fixture filename
2023-05-31 18:13:11 +02:00
Donal McBreen
222eda6085
Fix typo in fixture filename
...
Following on from https://github.com/mrsked/mrsk/pull/320 , fix the
fixture filename as well
2023-05-31 17:11:13 +01:00
David Heinemeier Hansson
504a09ef1d
Merge pull request #318 from basecamp/pre-deploy-hook
...
Add a pre-deploy hook
2023-05-31 17:59:46 +02:00
David Heinemeier Hansson
5a25f073f7
Merge pull request #320 from jsoref/spelling
...
Spelling
2023-05-31 17:59:18 +02:00
David Heinemeier Hansson
c8f521c0e8
Merge pull request #323 from basecamp/prefix-docker-host-with-real-host
...
Prefix container hostname with the underlying one
2023-05-31 17:58:55 +02:00
Donal McBreen
28d6a131a9
Prefix container hostname with the underlying one
...
To make it easier to identity where a docker container is running,
prefix its hostname with the underlying one from the host.
Docker chooses a 12 character random hex string by default, so we'll
keep that as the suffix.
2023-05-31 16:22:25 +01:00
David Heinemeier Hansson
3a9075b8ba
Merge pull request #321 from basecamp/more-robust-image-pruning
2023-05-31 13:02:48 +02:00
Donal McBreen
079d9538bb
Improve image pruning robustness
...
If you different images with the same git SHA, on the second deploy the
tag is moved and the first image becomes untagged. It may however still
be attached to an existing container.
To handle this:
1. Initially prune dangling images - this will remove any untagged
images that are not attached to an existing image
2. Then filter out the untagged images when deleting tagged images - any
that remain will be attached to a container.
The second issue is that `docker container ls -a --format '{{.Image}}`
will sometimes return the image id rather than a tag. This means that
the image doesn't get filtered out when we grep to remove the active
images.
To fix that we'll grep against both the image id and repo:tag.
2023-05-31 10:17:52 +01:00
Josh Soref
8e94c21729
spelling: with
...
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com >
2023-05-29 20:46:34 -04:00
Josh Soref
b536fcfa43
spelling: percentage
...
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com >
2023-05-29 20:46:34 -04:00
Josh Soref
85005be07f
spelling: message
...
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com >
2023-05-29 20:46:34 -04:00
Josh Soref
fc00392d68
spelling: installed
...
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com >
2023-05-29 20:46:34 -04:00
Josh Soref
fe9affa349
spelling: healthchecks
...
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com >
2023-05-29 20:46:34 -04:00
Josh Soref
3ecb3a4bfc
spelling: guidelines
...
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com >
2023-05-29 20:46:34 -04:00
Josh Soref
787812cdc2
spelling: every time
...
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com >
2023-05-29 20:46:34 -04:00
Josh Soref
91fb85d6b5
spelling: etc.
...
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com >
2023-05-29 20:46:34 -04:00
Donal McBreen
db0bf6bb16
Add a pre-deploy hook
...
Useful for checking the status of CI before deploying. Doing this at
this point in the deployment maximises the parallelisation of building
and running CI.
2023-05-29 16:06:41 +01:00
David Heinemeier Hansson
de2de19434
Merge pull request #315 from basecamp/prune-unused-images
...
Prune unused images correctly
2023-05-29 11:42:49 +02:00
David Heinemeier Hansson
f9fbebaa72
Merge pull request #316 from f440/fix-typo
...
Fix typo
2023-05-29 11:42:26 +02:00
Donal McBreen
1e300f3798
Wait longer for app to come up
2023-05-29 08:31:19 +01:00
f440
0373f6c4de
Fix typo
2023-05-27 16:27:19 +09:00
Donal McBreen
9037088f99
Increase nginx timeouts in load balancer
2023-05-25 17:31:20 +01:00
Donal McBreen
ff7a1e6726
Prune unused images correctly
...
dangling=true doesn't prune any images, as we are not creating dangling
images.
Using --all should remove unused images, but it considers the Git SHA
tag on the latest image to be unused (presumably because there are two
tags, the SHA and latest and the running container is only considered to
be using "latest"). As a result it deletes the tag, which means that we
can't rollback to that SHA later.
Its a bit more complicated to only remove images that are not referenced
by any containers.
First we find the tags we want to keep from the containers (running and
stopped).
Then we append the latest tag to that list.
Then we get a full list of image tags and remove those tags from that
list (using `grep -v -w`).
Finally we pass the tags to `docker rmi`. That either deletes the tag if
there are other references to the image or both the tag and the image if
it is the only one.
2023-05-25 17:16:46 +01:00
David Heinemeier Hansson
602aa43496
Bump version for 0.13.1
2023-05-25 14:04:29 +02:00
David Heinemeier Hansson
e35334e5fe
Merge pull request #313 from basecamp/stop-restarting-containers
...
Stop containers with restarting status
2023-05-25 14:04:09 +02:00
Donal McBreen
cedb8d900f
Stop containers with restarting status
...
When stopping the old container we need to also look for ones with a
restarting status.
2023-05-25 12:10:26 +01:00
David Heinemeier Hansson
8f0b7829ce
Bump version for 0.13.0
2023-05-25 12:05:04 +02:00
David Heinemeier Hansson
57e4f08c4c
Merge pull request #308 from tannakartikey/hooks_small_fix
...
Hooks sample files typo fix
2023-05-25 09:02:25 +02:00
David Heinemeier Hansson
a8bfe90fbe
Merge pull request #312 from shafy/docs_docker_setup
...
docs: change intro command to mrsk setup
2023-05-25 09:01:04 +02:00
David Heinemeier Hansson
f114dd71f6
Merge pull request #311 from basecamp/pre-connect-hook
...
Add a pre-connect hook
2023-05-25 08:58:19 +02:00
Can Olcer
d1b5b9cf7a
docs: change intro command to mrsk setup
2023-05-24 20:32:41 +02:00
Donal McBreen
66f9ce0e90
Add a pre-connect hook
...
This can be used for hooks that should run before connecting to remote
hosts. An example use case is pre-warming DNS.
2023-05-24 14:39:30 +01:00
Kartikey Tanna
956ab3560b
Hooks typo fix
2023-05-23 22:12:49 +05:30
David Heinemeier Hansson
483b893018
Merge pull request #291 from basecamp/hooks
...
MRSK Hooks
2023-05-23 17:07:04 +02:00
Donal McBreen
19f0f40adf
Add skip_hooks option
2023-05-23 15:56:47 +01:00
Donal McBreen
f9cb87e55a
Fixup rebase issues
2023-05-23 14:10:38 +01:00
Donal McBreen
cc2b321d93
Combine post-deploy and post-rollback
2023-05-23 13:57:24 +01:00
Donal McBreen
004f1b04e6
Remove the skip_broadcast option
2023-05-23 13:57:00 +01:00
Donal McBreen
3b695ae127
Add service_version and add running hook message
2023-05-23 13:56:19 +01:00
Donal McBreen
258887a451
Set sample hook permissions and preserve when copying
2023-05-23 13:56:19 +01:00
Donal McBreen
9fd184dc32
Add post-deploy and post-rollback hooks
...
These replace the custom audit_broadcast_cmd code. An additional env
variable MRSK_RUNTIME is passed to them.
The audit broadcast after booting an accessory has been removed.
2023-05-23 13:56:16 +01:00
Donal McBreen
38023fe538
Remove post push hook
2023-05-23 13:55:05 +01:00
Donal McBreen
0bc1fbfb74
Set max-concurrent-downloads to 1 to prevent timeouts
2023-05-23 13:55:05 +01:00
David Heinemeier Hansson
5ab630cb03
Style
2023-05-23 13:55:04 +01:00
Donal McBreen
910f14e9c0
Add configuration for hooks_path
2023-05-23 13:55:04 +01:00
Donal McBreen
f3ec9f19c8
Add debug for failed version checks
2023-05-23 13:55:04 +01:00
Donal McBreen
58c1096a90
MRSK hooks
...
Adds hooks to MRSK. Currently just two hooks, pre-build and post-push.
We could break the build and push into two separate commands if we
found the need for post-build and/or pre-push hooks.
Hooks are stored in `.mrsk/hooks`. Running `mrsk init` will now create
that folder and add sample hook scripts.
Hooks returning non-zero exit codes will abort the current command.
Further potential work here:
- We could replace the audit broadcast command with a
post-deploy/post-rollback hook or similar
- Maybe provide pre-command/post-command hooks that run after every
mrsk invocation
- Also look for hooks in `~/.mrsk/hooks`
2023-05-23 13:55:04 +01:00
Donal McBreen
340ed94fa9
Make verify_local_dependencies private
...
We don't need to what it returns, it raises if there is a problem.
Move it out of the run_locally block to make it easier to add hooks.
2023-05-23 13:55:04 +01:00
David Heinemeier Hansson
4e9c39f26d
Merge pull request #271 from basecamp/app-boot-for-rollback
...
Call app:boot to rollback
2023-05-23 13:17:30 +02:00
David Heinemeier Hansson
d08aacadac
Merge pull request #287 from Novtopro/traefik-inject-environment-variables
...
Allow to inject environment variables to traefik
2023-05-22 10:10:34 +02:00
David Heinemeier Hansson
702490d10f
Merge pull request #305 from johnmcdowall/update_readme_for_aws_ecr
...
Update the README with info on AWS ECR
2023-05-22 09:58:33 +02:00
David Heinemeier Hansson
13079dd2a3
Merge pull request #299 from basecamp/report-host-with-error
...
Report the host an error occurred on
2023-05-22 09:57:22 +02:00
John McDowall
7daee9a0df
Update the README on the use of shelling out to the aws cli command to obtain the token for ECR automatically
2023-05-20 13:46:05 -07:00
Donal McBreen
f7c5840473
Report the host an error occurred on
...
The cause message doesn't include the host the error occurred on.
Before:
```
$ mrsk deploy
Acquiring the deploy lock...
Finished all in 0.1 seconds
ERROR (SocketError): getaddrinfo: nodename nor servname provided, or not known
```
After:
```
$ mrsk deploy -d staging
Acquiring the deploy lock...
Finished all in 0.1 seconds
ERROR (SocketError): Exception while executing on host server-123: getaddrinfo: nodename nor servname provided, or not known
```
2023-05-17 08:51:01 +01:00
David Heinemeier Hansson
a7d869ad40
Merge pull request #298 from basecamp/more-integration-tests
2023-05-17 09:39:00 +02:00
Donal McBreen
7cd25fd163
Add more integration tests
...
Add tests for main, app, accessory, traefik and lock commands.
Other commands are generally covered by the main tests.
Also adds some changes to speed up the integration specs:
- Use a persistent volume for the registry so we can push images to to
reuse between runs (also gets around docker hub rate limits)
- Use persistent volume for mrsk gem install, to avoid re-installing
between tests
- Shorter stop wait time
- Shorter connection timeouts on the load balancer
Takes just over 2 minutes to run all tests locally on an M1 Mac
after docker caches are primed.
2023-05-16 10:35:35 +01:00
Donal McBreen
ee25f200d7
Call app:boot to rollback
...
The code in Mrsk::Cli::Main#rollback was very similar to
Mrsk::Cli::App#boot.
Modify Mrsk::Cli::App#boot so it can handle rollbacks by:
1. Only renaming running containers
2. Trying first to start then run the new container
2023-05-16 08:59:07 +01:00
David Heinemeier Hansson
059388cb02
Merge pull request #292 from basecamp/unique-uncommited-changes-version
...
Highlight uncommitted changes in version
2023-05-15 14:05:31 +02:00
Donal McBreen
a5ef1f254f
Highlight uncommitted changes in version
...
If there are uncommitted changes in the app repository when building,
then append `_uncommitted_<random>` to it to distinguish the image
from one built from a clean checkout.
Also change the version used when renaming a container on redeploy to
distinguish and explain the version suffixes.
2023-05-12 11:08:48 +01:00
David Heinemeier Hansson
15e8ac0ced
Merge pull request #290 from acidtib/check-interval
...
add healthcheck interval option
2023-05-11 14:13:13 +02:00
acidtib
9a31c20321
add healthcheck interval option
2023-05-10 20:27:21 -06:00
River He
44b83151e3
Allow to inject environment variables to traefik
2023-05-10 03:18:26 +00:00
David Heinemeier Hansson
0defcbb640
Merge pull request #283 from basecamp/better-lock-messages
...
Better lock messages
2023-05-09 16:06:50 +02:00
Donal McBreen
5d33fb6c33
Better lock messages
...
- Debug verbosity commands
- Show lock status when we fail to acquire it
- Include lock acquire/release in runtime
2023-05-09 14:17:58 +01:00
David Heinemeier Hansson
e9d838ec46
Update README.md
2023-05-09 14:32:02 +02:00
David Heinemeier Hansson
ee319fee1c
Merge pull request #277 from xiaohui-zhangxh/bugfix/readme
...
Fix readme bug on traefik volumes option
2023-05-09 12:37:38 +02:00
xiaohui
5646f6cc64
fix readme bug on traefik volumes option
2023-05-07 23:58:38 +08:00
David Heinemeier Hansson
31aaa82991
Merge pull request #272 from olimart/patch-1
...
Fix typo mesasge --> message
2023-05-07 10:58:11 +02:00
Olivier
5ea552be40
Fix typo in message
2023-05-05 10:43:21 -04:00
David Heinemeier Hansson
625be70e4d
Bump version for 0.12.1
2023-05-05 14:33:25 +02:00
David Heinemeier Hansson
aafaee7ac8
Merge pull request #223 from basecamp/customizable-audit-broadcast
...
Allow customizing audit broadcast with env
2023-05-05 14:30:04 +02:00
David Heinemeier Hansson
97a190300d
Merge pull request #270 from basecamp/fix-aggressive-prune-breaking-rollback
...
Fix aggressive prune breaking rollback
2023-05-05 14:28:22 +02:00
Donal McBreen
326711a3e0
Fix aggressive prune breaking rollback
...
In the image prune command --all overrides --dangling=true. This removes
the image git sha image tag for the latest image which prevented
us from rolling back to it.
I've updated the integration test to now test deploy, redeploy and
rollback.
2023-05-05 12:13:14 +01:00
Kevin McConnell
82be521e66
Merge branch 'main' into customizable-audit-broadcast
...
* main:
Fix staging label bug
Fix typo
Capture container health log when unhealthy
Bump version for 0.12.0
2023-05-05 11:40:29 +01:00
David Heinemeier Hansson
21110080d5
Merge pull request #267 from danthegoodman1/patch-1
...
Fix staging label bug in README
2023-05-05 11:25:22 +02:00
David Heinemeier Hansson
ef107c41b6
Merge pull request #265 from Jberczel/improve-healthcheck-logging
...
Improve healthcheck logging
2023-05-05 11:24:55 +02:00
Dan Goodman
1bf4b6b76f
Fix staging label bug
...
I think this is the correct fix based on the `service-role-destination` format, but seeing as it wasn't changed I assumed it was incorrect.
2023-05-04 17:47:17 -04:00
Jeremy Daer
36a3b13bf4
Fix SSHKit #command override args mangling
2023-05-04 08:58:18 -07:00
Jberczel
01483140f5
Fix typo
2023-05-03 15:03:05 -04:00
Jberczel
0e19ead37c
Capture container health log when unhealthy
2023-05-03 15:03:05 -04:00
Jeremy Daer
048aecf352
Audit details ( #1 )
...
Audit details
* Audit logs and broadcasts accept `details` whose values are included as log tags and MRSK_* env vars passed to the broadcast command
* Commands may return execution options to the CLI in their args list
* Introduce `mrsk broadcast` helper for sending audit broadcasts
* Report UTC time, not local time, in audit logs. Standardize on ISO 8601 format
2023-05-02 11:42:05 -07:00
David Heinemeier Hansson
38c85e8021
Bump version for 0.12.0
2023-05-02 17:23:10 +02:00
David Heinemeier Hansson
88a7413b3e
Merge branch 'main' into pr/223
...
* main:
Don't run actions twice on PRs
Further distinguish dependency verification
Naming
Reveal configured dockerfile path
Style
Distinguish from server dependencies
Distinguish from local dependency verification
Improve clarity and intent
Style
Style
Style
Add local dependencies check
Bootstrap: use multi-platform installer
2023-05-02 14:44:16 +02:00
David Heinemeier Hansson
9cc73fed9a
Merge branch 'main' into pr/223
...
* main:
Simplify domain language to just "boot" and unscoped config keys
Retain a fixed number of containers when pruning
Don't assume rolling back in message
Check all hosts before rolling back
Ensure Traefik service name is consistent
Extend traefik delay by 1 second
Include traefik access logs
Check if we are still getting a 404
Also dump load balancer logs
Dump traefik logs when app not booted
Fix missing for apt-get
Report on container health after failure
Fix the integration test healthcheck
Allow percentage-based rolling deployments
Move `group_limit` & `group_wait` under `boot`
Limit rolling deployment to boot operation
Allow performing boot & start operations in groups
2023-05-02 14:43:17 +02:00
David Heinemeier Hansson
787ef96639
Don't run actions twice on PRs
2023-05-02 14:41:18 +02:00
David Heinemeier Hansson
1e8edc25e2
Merge pull request #205 from basecamp/docker-readiness
...
Bootstrap: multi-OS Docker install
2023-05-02 14:35:26 +02:00
David Heinemeier Hansson
b7877c59b4
Merge branch 'main' into docker-readiness
2023-05-02 14:30:35 +02:00
David Heinemeier Hansson
35b5b317af
Merge branch 'main' into pr/205
...
* main:
Simplify domain language to just "boot" and unscoped config keys
Retain a fixed number of containers when pruning
Don't assume rolling back in message
Check all hosts before rolling back
Ensure Traefik service name is consistent
Extend traefik delay by 1 second
Include traefik access logs
Check if we are still getting a 404
Also dump load balancer logs
Dump traefik logs when app not booted
Fix missing for apt-get
Report on container health after failure
Fix the integration test healthcheck
Allow percentage-based rolling deployments
Move `group_limit` & `group_wait` under `boot`
Limit rolling deployment to boot operation
Allow performing boot & start operations in groups
2023-05-02 14:29:06 +02:00
David Heinemeier Hansson
4c448f7eb1
Merge pull request #256 from Jberczel/check-local-dependencies
...
Add local dependencies check
2023-05-02 14:13:23 +02:00
David Heinemeier Hansson
263a24afe3
Further distinguish dependency verification
2023-05-02 14:09:10 +02:00
David Heinemeier Hansson
a2d99e48bf
Naming
2023-05-02 14:08:29 +02:00
David Heinemeier Hansson
a22e27dbf8
Reveal configured dockerfile path
2023-05-02 14:07:47 +02:00
David Heinemeier Hansson
bb74a74dc4
Style
2023-05-02 14:07:30 +02:00
David Heinemeier Hansson
c611a1616a
Distinguish from server dependencies
2023-05-02 14:06:06 +02:00
David Heinemeier Hansson
98e7b995d5
Distinguish from local dependency verification
2023-05-02 14:04:37 +02:00
David Heinemeier Hansson
ae2effb80c
Improve clarity and intent
2023-05-02 14:04:23 +02:00
David Heinemeier Hansson
f719540e0c
Style
2023-05-02 13:35:05 +02:00
David Heinemeier Hansson
cbda851436
Style
2023-05-02 13:34:56 +02:00
David Heinemeier Hansson
8854bb63a1
Merge pull request #254 from basecamp/retain-last-5-containers
...
Retain a fixed number of containers when pruning
2023-05-02 13:16:49 +02:00
David Heinemeier Hansson
35ea9f3c81
Merge pull request #255 from basecamp/check-all-hosts-for-rollback-container
...
Check all hosts before rolling back
2023-05-02 13:16:03 +02:00
David Heinemeier Hansson
18312f5191
Merge pull request #253 from basecamp/ensure-consistent-service-name
...
Ensure Traefik service name is consistent
2023-05-02 13:15:36 +02:00
David Heinemeier Hansson
71bc9bcf54
Merge pull request #222 from basecamp/deploy-groups
...
Allow booting containers in groups for rolling restarts
2023-05-02 13:14:32 +02:00
David Heinemeier Hansson
c83b74dcb7
Simplify domain language to just "boot" and unscoped config keys
2023-05-02 13:11:31 +02:00
Donal McBreen
971a91da15
Retain a fixed number of containers when pruning
...
Time based container and image retention can have variable space
requirements depending on how often we deploy.
- Only prune stopped containers, retaining the 5 newest
- Then prune dangling images so we only keep images for the retained
containers.
2023-05-02 10:15:08 +01:00
Donal McBreen
86d6f8d674
Don't assume rolling back in message
2023-05-02 10:14:50 +01:00
Donal McBreen
7fe24d5048
Check all hosts before rolling back
...
Hosts could end up out of sync with each other if prune commands are run
manually or when new hosts are added.
Before rolling back confirm that the required container is available on
all hosts and roles.
2023-05-02 10:14:50 +01:00
Kevin McConnell
a72f95f44d
Ensure Traefik service name is consistent
...
If we don't specify any service properties when labelling containers,
the generated service will be named according to the container. However,
we change the container name on every deployment (as it is versioned),
which means that the auto-generated service name will be different in
each container.
That is a problem for two reasons:
- Multiple containers share a common router while a deployment is
happening. At this point, the router configuration will be different
between the containers; Traefik flags this as an error, and stops
routing to the containers until it's resolved.
- We allow custom labels to be set in an app's config. In order to
define custom configuration on the service, we'll need to know what
it will be called.
Changed to force the service name by setting one of its properties.
2023-05-02 09:43:04 +01:00
David Heinemeier Hansson
dc3be30b16
Style
2023-05-02 10:29:49 +02:00
David Heinemeier Hansson
54881a0298
Merge pull request #250 from basecamp/integration-test-healthcheck-wget
...
Integration test healthcheck wget
2023-05-02 10:27:49 +02:00
David Heinemeier Hansson
19527b4f65
Merge branch 'main' into customizable-audit-broadcast
2023-05-02 10:25:25 +02:00
Jberczel
bfb70b2118
Add local dependencies check
...
Add checks for:
* Docker installed locally
* Docker buildx plugin installed locally
* Dockerfile exists
If checks fail, it will halt deployment and provide more specific error messages.
Also adds a cli subcommand:
`mrsk build dependencies`
Fixes : #109 and #237
2023-05-01 16:32:41 -04:00
Jeremy Daer
e85bd5ff63
Bootstrap: use multi-platform installer
...
* Limit auto-install to root users; otherwise, give manual install guidance
* Support non-Debian/Ubuntu with the multi-OS get.docker.com installer
2023-05-01 13:26:00 -07:00
Donal McBreen
d0f66db33c
Extend traefik delay by 1 second
2023-05-01 18:58:46 +01:00
Donal McBreen
650f9b1fbf
Include traefik access logs
2023-05-01 18:55:10 +01:00
Donal McBreen
1170e2311e
Check if we are still getting a 404
2023-05-01 18:32:07 +01:00
Donal McBreen
94f87edded
Also dump load balancer logs
2023-05-01 18:27:08 +01:00
Donal McBreen
548a1019c1
Dump traefik logs when app not booted
2023-05-01 18:21:22 +01:00
Donal McBreen
ca2e2bac2e
Fix missing for apt-get
2023-05-01 12:50:45 +01:00
Donal McBreen
494a1ae089
Report on container health after failure
2023-05-01 12:13:12 +01:00
Donal McBreen
a77428143f
Fix the integration test healthcheck
...
The alpine nginx container doesn't contain curl, so let's override the
healthcheck command to use wget.
2023-05-01 12:11:24 +01:00
David Heinemeier Hansson
4fa6a6c06d
Merge pull request #219 from basecamp/docker-health-checks
2023-04-28 11:43:33 +02:00
David Heinemeier Hansson
2ad0dc0703
Merge pull request #241 from Jberczel/fix-traefik-subcommand-typo
2023-04-28 11:38:46 +02:00
David Heinemeier Hansson
df067e4893
Merge pull request #244 from basecamp/get-lock-status-without-invoke
2023-04-25 18:57:05 +02:00
Donal McBreen
cd668066ff
Get lock status by executing directly
...
Getting the lock status with invoke passes through any options from the
original command which will raise an exception if they are not also
valid for the lock status command.
Fixes https://github.com/mrsked/mrsk/issues/239
2023-04-25 16:57:02 +01:00
David Heinemeier Hansson
1a7d123746
Merge pull request #245 from basecamp/integration-test-wait-for-healthy
...
Wait for healthy containers in integration test
2023-04-25 16:54:22 +02:00
Donal McBreen
52ca5b846a
Wait for healthy containers in integration test
...
Rather than waiting 5 seconds and hoping for the best after we boot
docker compose, add docker healthchecks and wait for all the containers
to be healthy.
2023-04-25 15:41:25 +01:00
Jberczel
126e0bbd06
Fix traefik remove_image desc typo
2023-04-24 17:40:28 -04:00
David Heinemeier Hansson
9ec3895dab
Merge pull request #216 from dmrty/add-ssh-client-to-dockerised-mrsk
2023-04-15 08:29:49 +02:00
David Heinemeier Hansson
a6245a6bc9
Merge pull request #221 from iamFIREcracker/patch-1
2023-04-15 08:29:03 +02:00
David Heinemeier Hansson
0d80709e2d
Merge pull request #224 from basecamp/integration-tests
2023-04-15 08:25:47 +02:00
Kevin McConnell
aceabb3824
Update README with env name change
2023-04-14 16:13:59 +01:00
Kevin McConnell
99fe31d4b4
Rename MRSK_EVENT -> MRSK_MESSAGE
...
It's a better name, and frees up `MRSK_EVENT` to be used later.
2023-04-14 16:11:42 +01:00
Donal McBreen
bcf8a927f5
Run a mrsk deploy integration test
...
Adds a simple integration test to ensure that `mrsk deploy` works.
Everything required is spun up with docker compose:
- shared: a container that contains an ssh key and a self signed cert to
be shared between the images
- deployer: the image we will deploy from
- registry: a docker registry
- two vm images to deploy into
- load_balancer: an nginx load balancer to use between our images
The other images are in privileged mode so that we can run
docker-in-docker. We need to run docker inside the images - mapping in
the docker socket doesn't work because both VMs would share the host
daemon.
The docker registry requires a self signed cert as you cannot use basic
auth over HTTP except on localhost. It runs on port 4443 rather than 443
because docker refused to accept that "registry" is a docker host and
tries to push images to docker.io/registry. "registry:4443" works fine.
The shared container contains the ssh keys for the deployer and vms, and
the self signed cert for the registry. When the shared container boots,
it copies them into a shared volume.
The other deployer and vm images are built with soft links from the
shared volume to the require locations. Their boot scripts wait for the
files to be copied in before continuing.
The root mrsk folder is mapped into the deployer container. On boot it
builds the gem and installs it.
Right now there's just a single test. We confirm that the load balancer
is returning a 502, run `mrsk deploy` and then confirm it returns 200.
2023-04-14 15:49:43 +01:00
Kevin McConnell
f055766918
Allow percentage-based rolling deployments
2023-04-14 12:46:14 +01:00
Kevin McConnell
a8726be20e
Move group_limit & group_wait under boot
...
Also make formatting the group strategy the responsibility of the
commander.
2023-04-14 11:31:51 +01:00
Kevin McConnell
100b72e4b4
Limit rolling deployment to boot operation
2023-04-14 10:41:07 +01:00
Kevin McConnell
828e56912e
Allow customizing audit broadcast with env
...
When invoking the audit broadcast command, provide a few environment
variables so that people can customize the format of the message if they
want.
We currently provide `MRSK_PERFORMER`, `MRSK_ROLE`, `MRSK_DESTINATION` and
`MRSK_EVENT`.
Also adds the destination to the default message, which we continue to
send as the first argument as before.
2023-04-13 17:54:25 +01:00
Kevin McConnell
df202d6ef4
Move health checks into Docker
...
Replaces our current host-based HTTP healthchecks with Docker
healthchecks, and adds a new `healthcheck.cmd` config option that can be
used to define a custom health check command. Also removes Traefik's
healthchecks, since they are no longer necessary.
When deploying a container that has a healthcheck defined, we wait for
it to report a healthy status before stopping the old container that it
replaces. Containers that don't have a healthcheck defined continue to
wait for `MRSK.config.readiness_delay`.
There are some pros and cons to using Docker healthchecks rather than
checking from the host. The main advantages are:
- Supports non-HTTP checks, and app-specific check scripts provided by a
container.
- When booting a container, allows MRSK to wait for a container to be
healthy before shutting down the old container it replaces. This
should be safer than relying on a timeout.
- Containers with healthchecks won't be active in Traefik until they
reach a healthy state, which prevents any traffic from being routed to
them before they are ready.
The main _disadvantage_ is that containers are now required to provide
some way to check their health. Our default check assumes that `curl` is
available in the container which, while common, won't always be the
case.
2023-04-13 16:08:43 +01:00
Kevin McConnell
f530009a6e
Allow performing boot & start operations in groups
...
Adds top-level configuration options for `group_limit` and `group_wait`.
When a `group_limit` is present, we'll perform app boot & start
operations on no more than `group_limit` hosts at a time, optionally
sleeping for `group_wait` seconds after each batch.
We currently only do this batching on boot & start operations (including
when they are part of a deployment). Other commands, like `app stop` or
`app details` still work on all hosts in parallel.
2023-04-13 15:58:27 +01:00
Matteo Landi
4b36df5dab
Configure git to trust /workdir
...
Resolves : #220
2023-04-13 15:13:13 +02:00
Gilles Demarty
79d46ceb16
Add OpenSSH Client to the alpine server
2023-04-12 19:20:09 +02:00
David Heinemeier Hansson
bc8875e020
Merge pull request #183 from basecamp/cleanup-excessive-containers-running
...
Clear stale containers
2023-04-12 15:58:59 +02:00
David Heinemeier Hansson
d4a72da9d8
Merge pull request #213 from ncreuschling/fix-spelling-of-label
...
fix spelling of label
2023-04-12 15:58:46 +02:00
David Heinemeier Hansson
04a04c05e0
Merge branch 'main' into fix-spelling-of-label
2023-04-12 15:58:41 +02:00
David Heinemeier Hansson
cff8b058af
Merge pull request #214 from tannakartikey/traefik_lables_readme_example_fix
...
Traefik label example typo fix
2023-04-12 15:58:08 +02:00
David Heinemeier Hansson
b6f7d94ac3
Merge pull request #144 from monorkin/shell-escape-dollar-signs
...
Shell escape dollar signs
2023-04-12 15:57:37 +02:00
Stanko K.R
3ab16c8994
Shell escape dollar signs
...
But allow for shell expansion using curly braces e.g. ${PWD}
2023-04-12 15:55:54 +02:00
Kartikey Tanna
b6743e5e1c
Traefik label example typo fix
2023-04-12 19:21:20 +05:30
Jacopo
9ddb181f50
Merge branch 'main' into cleanup-excessive-containers-running
...
* main:
Pull the primary host from the role
Minimise holding the deploy lock
2023-04-12 15:19:19 +02:00
Nicolai Reuschling
fbe1458478
fix spelling of label
2023-04-12 14:56:39 +02:00
David Heinemeier Hansson
2f1393cd92
Merge pull request #212 from basecamp/role-primary-hosts
...
Pull the primary host from the role
2023-04-12 14:09:38 +02:00
David Heinemeier Hansson
76673c0c1b
Merge pull request #211 from basecamp/minimise-lock-retention
...
Minimise holding the deploy lock
2023-04-12 14:08:05 +02:00
Donal McBreen
fb62f2e6e1
Pull the primary host from the role
...
So commands like this run on a host with the specified role:
```
mrsk app exec -r=console -i "/bin/bash`
mrsk app logs -f -r=workers
```
2023-04-12 13:03:02 +01:00
Donal McBreen
051556674f
Minimise holding the deploy lock
...
If we get an error we'll only hold the deploy lock if it occurs while
trying to switch the running containers.
We'll also move tagging the latest image from when the image is pulled
to just before the container switch. This ensures that earlier errors
don't leave the hosts with an updated latest tag while still running the
older version.
2023-04-12 12:09:56 +01:00
Jacopo
3cbf4aea46
Make method private method and use :send
2023-04-12 11:53:49 +02:00
Jacopo
5ed431b807
Merge branch 'main' into cleanup-excessive-containers-running
...
* main: (24 commits)
Bump version for 0.11.0
Labels can be added to Traefik
Make rollbacks role-aware
fix typo role to roles
Explained the latest modifications of Traefik container labels
Remove .idea folder
Updated README.md with new healthcheck.max_attempts option
Fix test case: console output message was not updated to display the current/total attempts
Require net-ssh ~> 7.0 for SHA-2 support
Improved deploy lock acquisition
Excess CR
Style
Simpler
Make it explicit, focus on Ubuntu
More explicit
Not that --bundle is a Rails 7+ option
Update README.md
Update README.md
Improved: configurable max_attempts for healthcheck
Traefik service name to be derived from role and destination
...
2023-04-12 11:52:47 +02:00
David Heinemeier Hansson
60a19f0b30
Bump version for 0.11.0
2023-04-12 11:45:33 +02:00
David Heinemeier Hansson
2d0a7e1b67
Merge pull request #208 from tannakartikey/add_labels_to_traefik
...
Labels can be added to Traefik
2023-04-12 11:35:28 +02:00
David Heinemeier Hansson
49df19fb0d
Merge pull request #209 from ncreuschling/fix-roles-documentation
...
fix typo role to roles
2023-04-12 11:34:02 +02:00
David Heinemeier Hansson
cef8fddfb4
Merge pull request #210 from basecamp/role-aware-rollbacks
...
Make rollbacks role-aware
2023-04-12 11:33:45 +02:00
Kartikey Tanna
c59eb00dd0
Labels can be added to Traefik
2023-04-12 14:53:48 +05:30
Donal McBreen
43f7409de0
Make rollbacks role-aware
...
Rollbacks stopped working after https://github.com/mrsked/mrsk/pull/99 .
We'll confirm that a container is available for the first role on the
primary host before attempting to rollback.
2023-04-12 09:59:39 +01:00
Nicolai Reuschling
448ea7719f
fix typo role to roles
2023-04-12 10:53:10 +02:00
Jacopo
72b70e3e9e
More compact
2023-04-11 16:22:47 +02:00
Jacopo
e8697327fa
Use no_commands block
2023-04-11 16:20:16 +02:00
Jacopo
0bfd4ca780
Use cli = self approach
2023-04-11 16:04:46 +02:00
Jacopo
12e3a562c4
Extract helper
2023-04-11 15:26:55 +02:00
David Heinemeier Hansson
ab54dbdb8b
Merge pull request #206 from tannakartikey/traefik_rule_docs
...
Explained the latest modifications of Traefik container labels
2023-04-11 14:18:31 +02:00
David Heinemeier Hansson
ac3771447a
Merge pull request #203 from matharvard/main
...
Require net-ssh ~> 7.0 for SHA-2 support
2023-04-11 14:17:52 +02:00
David Heinemeier Hansson
daa0c9b5be
Merge pull request #196 from handy-la/main
...
Configurable max_attempts for healthcheck
2023-04-11 14:17:17 +02:00
Jacopo
c3393c8213
Remove dot
2023-04-11 11:03:11 +02:00
Jacopo
03d933d10b
Add Role to the message
2023-04-11 10:59:25 +02:00
Jacopo
579b4cd9aa
Simplify
...
By using and ad-hoc command to detect and stop stale containers.
By default stale containers are only detected.
2023-04-11 10:22:03 +02:00
Jacopo
f9436d5673
Style
2023-04-11 08:53:33 +02:00
Jacopo
8ae5331d97
Boot stop all the old containers
2023-04-11 08:53:33 +02:00
Jacopo
4d47fbdf41
Merge stop and stop_stale_containers
2023-04-11 08:53:33 +02:00
Jacopo
e980f1164e
Avoid using GNU-only Perl Regepx Grep
2023-04-11 08:53:33 +02:00
Jacopo
e2f6db5cae
Clear stale containers
...
By stopping all the older containers with matching /#{service}-#{role}-#{dest}-.*/ running on the same host.
2023-04-11 08:53:33 +02:00
Kartikey Tanna
d3936363d0
Explained the latest modifications of Traefik container labels
2023-04-11 10:20:16 +05:30
Arturo Ojeda
cfc8fa0590
Remove .idea folder
2023-04-10 22:33:20 -06:00
Arturo Ojeda
161ebe4bc1
Updated README.md with new healthcheck.max_attempts option
2023-04-10 22:26:10 -06:00
Arturo Ojeda
514b2aa243
Fix test case: console output message was not updated to display the current/total attempts
2023-04-10 09:29:19 -06:00
David Heinemeier Hansson
18031bc552
Merge pull request #202 from basecamp/deploy-lock-acquisition
...
Improved deploy lock acquisition
2023-04-10 16:42:03 +02:00
Mat Harvard
d8c61004e4
Require net-ssh ~> 7.0 for SHA-2 support
...
Versions of net-ssh before 7.0 do not support the SHA-2 algorithm and result in mrsk not being able to connect to hosts using keys generated with it. net-ssh is also a dependency of sshkit, however, sshkit has a version requirement of >= 2.8.0 for net-ssh, so is not effective at ensuring mrsk has the version it needs to be the most compatible.
2023-04-10 07:29:07 -07:00
Donal McBreen
c4df440c79
Improved deploy lock acquisition
...
1. Don't raise lock error for non-lock issues during lock acquire
(see https://github.com/mrsked/mrsk/pull/181 )
2. If there is an error while the lock is held, don't release the lock
and send a warning to stderr
2023-04-10 15:23:00 +01:00
David Heinemeier Hansson
fb1718ca6d
Merge pull request #197 from tannakartikey/traefik_rules_with_destination
...
Traefik service name to be derived from role and destination
2023-04-10 15:11:07 +02:00
David Heinemeier Hansson
7d17a6c3b5
Excess CR
2023-04-10 15:10:08 +02:00
David Heinemeier Hansson
f4133de896
Merge pull request #176 from dilpreet92/enable_ssh_over_proxy_command
...
Enable ssh over proxy command
2023-04-10 14:41:45 +02:00
David Heinemeier Hansson
a9488e935d
Style
2023-04-10 14:39:18 +02:00
David Heinemeier Hansson
ac61528dfc
Merge pull request #189 from basecamp/traefik-image
...
Traefik image config for version pinning, upgrades, and custom images
2023-04-10 14:35:30 +02:00
David Heinemeier Hansson
0eb7a8d087
Merge branch 'main' into pr/176
...
* main:
Simpler
Make it explicit, focus on Ubuntu
More explicit
Not that --bundle is a Rails 7+ option
Update README.md
Update README.md
Add github discussions link to readme
Bump debug to fix missing deps in CI
Only redact the non-sensitive bits of build args and env vars.
improve code sample (traefik configuration)
2023-04-10 14:31:43 +02:00
David Heinemeier Hansson
7559f439e9
Merge pull request #195 from nickhammond/patch-1
...
Add github discussions link to readme
2023-04-10 14:28:59 +02:00
David Heinemeier Hansson
54a5b90d8f
Simpler
2023-04-10 14:28:52 +02:00
David Heinemeier Hansson
a245adfad2
Merge pull request #200 from huksley/main
...
Add sample commands to bootstrap non-root ssh server
2023-04-10 14:27:13 +02:00
David Heinemeier Hansson
f386c3bdab
Make it explicit, focus on Ubuntu
2023-04-10 14:26:49 +02:00
David Heinemeier Hansson
2a3e576182
More explicit
2023-04-10 14:24:51 +02:00
David Heinemeier Hansson
f3e3196ce5
Not that --bundle is a Rails 7+ option
2023-04-10 14:22:58 +02:00
Ruslan Gainutdinov
fca5b11682
Update README.md
...
Use docker.io on Ubuntu
2023-04-10 12:26:57 +03:00
Ruslan Gainutdinov
d09cddde8d
Update README.md
...
Add sample commands to bootstrap non-root ssh server.
2023-04-10 12:23:06 +03:00
Arturo Ojeda
3969f56fa6
Improved: configurable max_attempts for healthcheck
2023-04-09 12:07:27 -06:00
Kartikey Tanna
c60cc92dfe
Traefik service name to be derived from role and destination
2023-04-09 13:44:57 +05:30
Arturo Ojeda
cb3c5a53f4
Configurable max_attempts for healthcheck
2023-04-08 19:52:53 -06:00
Nick Hammond
ef04410d77
Add github discussions link to readme
...
I realize that there's a discussions link on github but I didn't realize mrsk actually utilized it until I saw it mentioned on Discord. I was thinking adding it to the readme would help push people there.
2023-04-08 13:33:31 -07:00
Jeremy Daer
bd8f13dd5e
Traefik image config for version pinning, upgrades, and custom images
...
Accounts for the 2.9.10 security release and allows testing Traefik 3 betas.
* Use `image` to configure a specific Traefik Docker image.
* Default to `traefik:v2.9` to track future 2.9.x minor releases rather
than tightly pinning to `v2.9.9`.
* Support images from the configured registry.
References #165
2023-04-07 14:15:25 -07:00
David Heinemeier Hansson
2146f6d0ec
Merge pull request #182 from basecamp/sensitive-args
...
Only redact the non-sensitive bits of build args and env vars.
2023-04-06 16:19:41 +02:00
David Heinemeier Hansson
52d8c112d3
Merge branch 'main' into pr/182
...
* main:
Bump debug to fix missing deps in CI
2023-04-06 16:18:22 +02:00
David Heinemeier Hansson
c9afd66222
Merge pull request #184 from basecamp/fix-ci
2023-04-06 13:21:26 +02:00
Jeremy Daer
36c458407f
Bump debug to fix missing deps in CI
2023-04-05 12:00:15 -07:00
Jeremy Daer
c137b38c87
Only redact the non-sensitive bits of build args and env vars.
...
* `-e [REDACTED]` → `-e SOME_SECRET=[REDACTED]`
* Replaces `Utils.redact` with `Utils.sensitive` to clarify that we're
indicating redactability, not actually performing redaction.
* Redacts from YAML output, including `mrsk config` (fixes #96 )
2023-04-05 09:45:28 -07:00
David Heinemeier Hansson
f851d6528d
Merge pull request #169 from ncreuschling/patch-1
...
improve code sample (traefik configuration)
2023-04-05 16:31:10 +02:00
Dilpreet Singh
12632aa7f9
Enable ssh over proxy command
2023-04-03 17:14:06 +05:30
Nicolai Reuschling
2f97bc488f
improve code sample (traefik configuration)
...
fixed yaml format (code sample traefik configuration)
2023-03-31 11:50:43 +02:00
David Heinemeier Hansson
032266a76a
Bump version for 0.10.1
2023-03-29 16:23:58 +02:00
David Heinemeier Hansson
33cc6c8bae
Merge pull request #166 from calmyournerves/exit-code
...
Set proper exit code on failure
2023-03-29 16:21:54 +02:00
Samuel Sieg
5638ab8594
Set proper exit code on failure
2023-03-29 13:47:34 +02:00
David Heinemeier Hansson
60916cdac3
Bump version for 0.10.0
2023-03-28 18:05:46 +02:00
David Heinemeier Hansson
1f83b5f6be
Fix failure to pass on class options to subcommands
2023-03-28 18:04:16 +02:00
David Heinemeier Hansson
070c6e8e75
Merge pull request #165 from basecamp/pin-traefik-version
...
Pin Traefik to v2.9.9
2023-03-28 16:27:49 +02:00
Kevin McConnell
2957388bf6
Pin Traefik to v2.9.9
2023-03-28 14:59:03 +01:00
David Heinemeier Hansson
7f178101f7
Merge pull request #164 from basecamp/accessory-hosts-or-roles
...
Run accessories on multiple hosts or roles
2023-03-28 14:31:24 +02:00
David Heinemeier Hansson
aed345466f
Dropped "all"
2023-03-28 14:28:54 +02:00
Donal McBreen
c06585fef4
Daemon/host/role accessories
...
Allow the hosts for accessories to be specified by host or role, or on
all app hosts by setting `daemon: true`.
```
# Single host
mysql:
host: 1.1.1.1
# Multiple hosts
redis:
hosts:
- 1.1.1.1
- 1.1.1.2
# By role
monitoring:
roles:
- web
- jobs
```
2023-03-28 13:26:27 +01:00
David Heinemeier Hansson
fd5313ec3e
Merge pull request #163 from milk1000cc/rolify-app-logs
...
Rolify app logs cli/command
2023-03-28 14:13:02 +02:00
David Heinemeier Hansson
4184d3204e
Merge pull request #161 from tbuehlmann/push-latest-image
...
Push <image>:latest in addition to <image>:<git-ref>
2023-03-28 14:09:32 +02:00
milk1000cc
15a41d3fd8
Follow web role logs when no roles are specified
2023-03-28 09:02:42 +09:00
milk1000cc
03614bfb79
Rolify app logs cli/command
2023-03-27 23:08:46 +09:00
Tobias Bühlmann
078d68b170
Push <image>:latest in addition to <image>:<git-ref>
2023-03-27 12:52:11 +02:00
David Heinemeier Hansson
cec82ac641
Merge pull request #158 from basecamp/zero-downtime-redeploys
2023-03-24 18:27:29 +01:00
Donal McBreen
05488e4c1e
Zero downtime redeploys
...
When deploying check if there is already a container with the existing
name. If there is rename it to "<version>_<random_hex_string>" to remove
the name clash with the new container we want to boot.
We can then do the normal zero downtime run/wait/stop.
While implementing this I discovered the --filter name=foo does a
substring match for foo, so I've updated those filters to do an exact
match instead.
2023-03-24 17:09:20 +00:00
David Heinemeier Hansson
01a2b678d7
Merge pull request #154 from basecamp/lock-deploys
...
Deploy locks
2023-03-24 15:50:33 +01:00
David Heinemeier Hansson
84540cee7b
Merge branch 'main' into pr/154
...
* main: (32 commits)
Inline default as with other options
Symbols!
Fix tests
test stop with custom stop wait time
No need to replicate Docker default
Describe purpose rather than elements
Style and ordering
Customizable stop wait time
Fix tests
Ensure it also works when configuring just log options without setting a driver
Add accessory test
Undo change
Improve test
Update README
Ensure default log option `max-size=10m`
#142 Allow to customize container options in accessories
Fix flaky test
Fix tests
More resilient tests
Fix other tests
...
2023-03-24 15:43:17 +01:00
David Heinemeier Hansson
5bbb4aeb58
Merge pull request #131 from calmyournerves/global-logging-config
...
Global logging configuration
2023-03-24 15:36:11 +01:00
David Heinemeier Hansson
6a27a46e5f
Inline default as with other options
2023-03-24 15:34:34 +01:00
David Heinemeier Hansson
b5ccc1fa5d
Merge branch 'main' into global-logging-config
2023-03-24 15:32:41 +01:00
David Heinemeier Hansson
e2e5e18af9
Merge pull request #155 from basecamp/gracefully-shut-down-containers
...
Customizable stop wait time
2023-03-24 15:31:14 +01:00
David Heinemeier Hansson
4fa71834ad
Symbols!
2023-03-24 15:27:11 +01:00
David Heinemeier Hansson
65663ae2ea
Merge branch 'main' into pr/155
...
* main:
Describe purpose rather than elements
Style and ordering
#142 Allow to customize container options in accessories
2023-03-24 15:25:45 +01:00
Samuel Sieg
4044abdde1
Fix tests
2023-03-24 15:25:29 +01:00
Samuel Sieg
bc64a07a95
Merge branch 'main' into global-logging-config
2023-03-24 15:24:06 +01:00
David Heinemeier Hansson
fdb2502216
test stop with custom stop wait time
2023-03-24 15:22:34 +01:00
David Heinemeier Hansson
a9bb8d7376
No need to replicate Docker default
2023-03-24 15:18:18 +01:00
David Heinemeier Hansson
53095a053e
Describe purpose rather than elements
2023-03-24 15:16:38 +01:00
David Heinemeier Hansson
4ab5199853
Style and ordering
2023-03-24 15:16:15 +01:00
David Heinemeier Hansson
348f5844d5
Merge pull request #153 from javierav/feature/accessory-options
...
#142 Allow to customize container options in accessories
2023-03-24 15:09:12 +01:00
Jacopo
9b43a6b23b
Customizable stop wait time
...
Configurable via a global `stop_wait_time` option.
The default is `10` which matches Docker defaults.
2023-03-24 15:04:45 +01:00
David Heinemeier Hansson
1f196045a9
Merge pull request #99 from tbuehlmann/role-awareness
...
Role aware container names
2023-03-24 15:01:34 +01:00
Samuel Sieg
86e99fb079
Merge branch 'main' into global-logging-config
2023-03-24 14:40:27 +01:00
David Heinemeier Hansson
494e29d672
Fix tests
2023-03-24 14:35:17 +01:00
David Heinemeier Hansson
93423f2f20
Merge branch 'main' into pr/99
...
* main:
Wording
Remove accessory images using tags rather than labels
Update readme to point to ghcr.io/mrsked/mrsk
Validate that all roles have hosts
Commander needn't accumulate configuration
Pull latest image tag, so we can identity it
Default to deploying the config version
Remove unneeded Dockerfile.dind, update Readme
add D-in-D dockerfile, update Readme
2023-03-24 14:26:31 +01:00
Donal McBreen
8d8f9f6ada
Deploy locks
...
Add a deploy lock for commands that are unsafe to run concurrently.
The lock is taken by creating a `mrsk_lock` directory on the primary
host. Details of who took the lock are added to a details file in that
directory.
Additional CLI commands have been added to manual release and acquire
the lock and to check its status.
```
Commands:
mrsk lock acquire -m, --message=MESSAGE # Acquire the deploy lock
mrsk lock help [COMMAND] # Describe subcommands or one specific subcommand
mrsk lock release # Release the deploy lock
mrsk lock status # Report lock status
Options:
-v, [--verbose], [--no-verbose] # Detailed logging
-q, [--quiet], [--no-quiet] # Minimal logging
[--version=VERSION] # Run commands against a specific app version
-p, [--primary], [--no-primary] # Run commands only on primary host instead of all
-h, [--hosts=HOSTS] # Run commands on these hosts instead of all (separate by comma)
-r, [--roles=ROLES] # Run commands on these roles instead of all (separate by comma)
-c, [--config-file=CONFIG_FILE] # Path to config file
# Default: config/deploy.yml
-d, [--destination=DESTINATION] # Specify destination to be used for config file (staging -> deploy.staging.yml)
-B, [--skip-broadcast], [--no-skip-broadcast] # Skip audit broadcasts
```
If we add support for running multiple deployments on a single server
we'll need to extend the locking to lock per deployment.
2023-03-24 12:28:08 +00:00
David Heinemeier Hansson
17e74910e4
Merge pull request #150 from basecamp/remove-accessory-image
...
Remove accessory images using tags rather than labels
2023-03-24 13:21:15 +01:00
David Heinemeier Hansson
8ebcafd3d8
Wording
2023-03-24 13:20:52 +01:00
David Heinemeier Hansson
89b4b909db
Merge pull request #118 from kumulustech/kumulus/docker-in-docker
...
Add docker in docker to Dockerfile for container dev
2023-03-24 13:19:33 +01:00
David Heinemeier Hansson
c89b77127b
Merge pull request #143 from djmb/default-to-deploying-config-version
...
Default to deploying the config version
2023-03-24 12:36:20 +01:00
Samuel Sieg
9c27ead21f
Ensure it also works when configuring just log options without setting a driver
2023-03-24 09:38:02 +01:00
Samuel Sieg
c3de89bb59
Add accessory test
2023-03-24 09:19:13 +01:00
Samuel Sieg
20a6bc31cd
Undo change
2023-03-24 09:15:37 +01:00
Samuel Sieg
ba5bdf95ec
Improve test
2023-03-24 09:15:30 +01:00
Samuel Sieg
3392fc6c1b
Update README
2023-03-24 09:15:03 +01:00
Samuel Sieg
7369be48ff
Ensure default log option max-size=10m
2023-03-24 09:10:36 +01:00
Samuel Sieg
4670db7f6d
Merge branch 'main' into global-logging-config
2023-03-24 08:35:43 +01:00
Jeremy Daer
e859a581ab
Remove accessory images using tags rather than labels
2023-03-23 15:59:28 -07:00
Javier Aranda
5d5d58a4ec
#142 Allow to customize container options in accessories
2023-03-23 23:56:59 +01:00
Robert Starmer
cf38feb1d6
Update readme to point to ghcr.io/mrsked/mrsk
2023-03-23 12:35:15 -07:00
David Heinemeier Hansson
e2d10ec5a9
Merge pull request #145 from basecamp/config-version
...
Commander needn't accumulate configuration
2023-03-23 17:51:30 +01:00
Jeremy Daer
035e4afff7
Validate that all roles have hosts
2023-03-23 08:57:34 -07:00
Jeremy Daer
1887a6518e
Commander needn't accumulate configuration
...
Commander had version/destination solely to incrementally accumulate CLI
options. Simpler to configure in one shot.
Clarifies responsibility and lets us introduce things like
`abbreviated_version` in one spot - Configuration.
2023-03-23 08:57:32 -07:00
Donal McBreen
1ed4a37da2
Pull latest image tag, so we can identity it
...
`docker image ls` doesn't tell us what the latest deployed image is (e.g
if we've rolled back). Pull the latest image tag through to the server
so we can use it instead.
2023-03-23 14:39:32 +00:00
David Heinemeier Hansson
7e1596e722
Fix flaky test
2023-03-23 15:36:02 +01:00
David Heinemeier Hansson
e7e3cd98eb
Fix tests
2023-03-23 15:16:10 +01:00
David Heinemeier Hansson
a1fc00347b
Merge branch 'main' into pr/99
...
* main:
Ask for access token
Style
Style
config.traefik is already nil safe
Update README.md
Bump dev deps and consolidate platform matches
Deploys mention the released service@version
Accessories aren't required to publish a port
Accessories may be pulled from authenticated registries
Polish destination config loading
Allow arbitrary docker options for traefik
Fixed typos
Fixed readme
Rebased on main
Added volume configuration in response to issue coments
Modified in response to PR comments
Added the additional_ports configuration
2023-03-23 14:48:13 +01:00
David Heinemeier Hansson
f73c526890
Ask for access token
2023-03-23 14:46:41 +01:00
David Heinemeier Hansson
65b90dd5c8
Merge branch 'main' into default-to-deploying-config-version
2023-03-23 14:42:31 +01:00
David Heinemeier Hansson
9648721ce7
Merge pull request #146 from basecamp/tell-me-more
...
Deploys mention the service and version
2023-03-23 14:38:31 +01:00
David Heinemeier Hansson
e409281bb2
Merge pull request #147 from basecamp/destination-config-polish
...
Polish destination config loading
2023-03-23 14:35:29 +01:00
David Heinemeier Hansson
bab8e42965
Merge pull request #151 from basecamp/portless-accessories
...
Accessories aren't required to publish a port
2023-03-23 14:32:58 +01:00
David Heinemeier Hansson
110df5244b
Merge pull request #152 from basecamp/deps
...
Bump dev deps and consolidate platform matches
2023-03-23 14:31:22 +01:00
David Heinemeier Hansson
01d684746e
Merge pull request #100 from stepbeekio/feature/multiple-traefik-entrypoints
...
Added the docker options override configuration for traefik
2023-03-23 14:28:40 +01:00
David Heinemeier Hansson
951a71f38e
Style
2023-03-23 14:26:12 +01:00
David Heinemeier Hansson
8b755c6973
Style
2023-03-23 14:24:34 +01:00
David Heinemeier Hansson
9a909ba7eb
config.traefik is already nil safe
2023-03-23 14:06:15 +01:00
David Heinemeier Hansson
14512fe409
Update README.md
2023-03-23 12:10:56 +01:00
David Heinemeier Hansson
e97216b0ea
Merge pull request #149 from basecamp/private-accessories
...
Private accessory images
2023-03-23 09:57:39 +01:00
Jeremy Daer
f3d93d3899
Bump dev deps and consolidate platform matches
2023-03-23 01:40:05 -07:00
Jeremy Daer
53d7f9d528
Deploys mention the released service@version
...
Less work for broadcast commands to take on.
Also fixes a bug where rollback on hosts without a running container
would stop the container they had just started.
2023-03-23 01:09:25 -07:00
Jeremy Daer
c870e560c1
Accessories aren't required to publish a port
...
Allows for background accessories like schedulers that don't act
as typical network service dependencies and have no port to expose.
2023-03-23 00:10:30 -07:00
Jeremy Daer
04b1d5e49e
Accessories may be pulled from authenticated registries
2023-03-22 23:48:22 -07:00
Robert Starmer
714960f184
Merge branch 'main' into kumulus/docker-in-docker
2023-03-22 11:27:28 -07:00
Jeremy Daer
c0d5b48f22
Polish destination config loading
...
* `Pathname#sub_ext` to munge .yml ext to .destination.yml
* Extract multi-file config merge
2023-03-22 10:38:37 -07:00
Donal McBreen
fb3353084f
Default to deploying the config version
...
If we don't supply a version when deploying we'll use the result of
docker image ls to decide which image to boot. But that doesn't
necessarily correspond to the one we have just built.
E.g. if you do something like:
```
mrsk deploy # deploys git sha AAAAAAAAAAAAAA
git commit --amend # update the commit message
mrsk deploy # deploys git sha BBBBBBBBBBBBBB
```
In this case running `docker image ls` will give you the same image
twice (because the contents are identical) with tags for both SHAs but
the image we have just built will not be returned first. Maybe the order
is random, but it always seems to come second as far as I have seen.
i.e you'll get something like:
```
REPOSITORY TAG IMAGE ID CREATED SIZE
foo/bar AAAAAAAAAAAAAA 6272349a9619 31 minutes ago 791MB
foo/bar BBBBBBBBBBBBBB 6272349a9619 31 minutes ago 791MB
```
Since we already know what version we want to deploy from the config,
let's just pass that through.
2023-03-22 16:14:50 +00:00
David Heinemeier Hansson
19104cafb4
Merge branch 'main' into role-awareness
2023-03-21 08:20:26 -04:00
Samuel Sieg
1bdfc217c4
Merge branch 'main' into global-logging-config
2023-03-21 13:20:12 +01:00
David Heinemeier Hansson
83dc82661b
Merge pull request #125 from calmyournerves/fix-destination-filter
...
Fix label filters when destination is passed
2023-03-21 07:44:59 -04:00
David Heinemeier Hansson
790be0f5f3
Style
2023-03-21 12:42:04 +01:00
David Heinemeier Hansson
49d60a045a
Style
2023-03-21 12:41:28 +01:00
David Heinemeier Hansson
60faf27a05
More resilient tests
2023-03-20 17:40:36 +01:00
David Heinemeier Hansson
43d1ecc94b
Fix other tests
2023-03-20 17:33:13 +01:00
David Heinemeier Hansson
00b970323b
Merge branch 'main' into pr/99
...
* main:
Add another assertion for `escape_shell_value`
Add tests for `Mrsk::Utils`
Fix indentation
Don't report exception here too
Don't report exception
Add CLI tests for remaining commands that are not tested yet
Minor: Properly require active_support
2023-03-20 17:31:50 +01:00
David Heinemeier Hansson
d0c4030257
Merge pull request #128 from calmyournerves/utils-tests
...
Tests for `Mrsk::Utils`
2023-03-20 02:28:42 -04:00
Robert Starmer
9591096131
Merge branch 'main' into kumulus/docker-in-docker
2023-03-19 12:34:32 -07:00
Samuel Sieg
b635b3198f
Fix
2023-03-19 09:49:23 +01:00
Samuel Sieg
662873de49
Add logging to README
2023-03-19 09:48:54 +01:00
Samuel Sieg
b5372988f7
Add global logging configuration
2023-03-19 09:21:08 +01:00
Samuel Sieg
c3d0382935
Add another assertion for escape_shell_value
2023-03-17 16:31:10 +01:00
Samuel Sieg
2de5250486
Add tests for Mrsk::Utils
2023-03-17 16:29:25 +01:00
Samuel Sieg
491777221f
Fix destination label filter
2023-03-16 16:15:31 +01:00
David Heinemeier Hansson
d167e48584
Merge pull request #122 from calmyournerves/add-cli-tests
...
Add CLI tests for remaining commands that are not tested yet
2023-03-16 09:31:28 -04:00
David Heinemeier Hansson
d071246865
Merge pull request #119 from ylecuyer/active_support-yle
...
Minor: Properly require active_support
2023-03-16 09:29:34 -04:00
Samuel Sieg
dae8b14469
Fix indentation
2023-03-16 08:35:12 +01:00
Samuel Sieg
b166f3fbf4
Don't report exception here too
2023-03-16 08:29:10 +01:00
Samuel Sieg
d33b723afb
Don't report exception
2023-03-16 08:24:54 +01:00
Samuel Sieg
aae290cefc
Add CLI tests for remaining commands that are not tested yet
2023-03-15 16:48:12 +01:00
Stephen van Beek
4c542930c5
Allow arbitrary docker options for traefik
2023-03-15 15:37:10 +00:00
Tobias Bühlmann
a15603655c
Adapt test for single host
2023-03-15 09:28:10 +01:00
Robert Starmer
11af999800
Remove unneeded Dockerfile.dind, update Readme
2023-03-14 16:27:19 -07:00
David Heinemeier Hansson
cb824bdc42
Merge branch 'main' into role-awareness
2023-03-14 19:11:10 -04:00
Yoann Lecuyer
85a0267447
Minor: Properly require active_support
2023-03-14 23:29:00 +01:00
Robert Starmer
886914c82e
Merge branch 'main' into kumulus/docker-in-docker
2023-03-14 14:14:07 -07:00
Robert Starmer
5b506a2daa
add D-in-D dockerfile, update Readme
2023-03-14 14:14:02 -07:00
Stephen van Beek
9843c5e1ce
Fixed typos
2023-03-14 20:13:13 +00:00
Stephen van Beek
c2ca269eb6
Fixed readme
2023-03-14 20:12:11 +00:00
Stephen van Beek
53046efad4
Rebased on main
2023-03-14 20:11:09 +00:00
Stephen van Beek
2db1bfde00
Added volume configuration in response to issue coments
2023-03-14 19:59:19 +00:00
Stephen van Beek
2cea12c56b
Modified in response to PR comments
2023-03-14 19:59:19 +00:00
Stephen van Beek
43a1b42f8c
Added the additional_ports configuration
...
ISSUE: https://github.com/mrsked/mrsk/issues/98
2023-03-14 19:59:19 +00:00
David Heinemeier Hansson
c282461265
Merge pull request #116 from tbuehlmann/traefik-command-options
...
Properly pass traefik command options
2023-03-14 15:08:27 -04:00
David Heinemeier Hansson
dcbe038555
Merge pull request #117 from calmyournerves/cli-main-tests
...
Add tests for main CLI commands
2023-03-14 15:07:07 -04:00
Samuel Sieg
3fd2f3f2c5
Improve comments
2023-03-14 16:05:57 +01:00
Samuel Sieg
46dad1ee6c
Add tests for main CLI commands
2023-03-14 15:58:12 +01:00
Tobias Bühlmann
3ca5bc50b6
Properly pass traefik command options
...
Traefik command options need to be passed as `--key=value`, not `--key value`.
2023-03-14 15:04:33 +01:00
David Heinemeier Hansson
b668ce3f25
Merge pull request #111 from calmyournerves/deploy-without-build-push
2023-03-14 07:32:27 -04:00
David Heinemeier Hansson
253d4ac37b
Merge pull request #115 from intrip/fix-traefik-default-middleware
2023-03-14 07:31:20 -04:00
Jacopo
50ee954ca9
Fix Traefik retry middleware
...
As per [Traefik docs](https://doc.traefik.io/traefik/middlewares/overview/#configuration-example )
a middleware to be activated needs to be applied to a route. Change the default settings
to apply the `retry` middleware on every role with Traefik enabled.
2023-03-14 12:15:00 +01:00
Samuel Sieg
0ac2cd2a4b
Add tests for deploy/redeploy commands
2023-03-14 11:49:31 +01:00
Tobias Bühlmann
72e0184e9f
Fix failing tests
2023-03-13 17:36:02 +01:00
Samuel Sieg
577cf2cec9
Merge branch 'main' into deploy-without-build-push
2023-03-13 16:11:38 +01:00
Samuel Sieg
5010850b86
Merge branch 'main' into deploy-without-build-push
2023-03-13 16:10:31 +01:00
David Heinemeier Hansson
fa07c2403c
Merge pull request #113 from moomerman/fix-healthcheck-test
...
Fix healthcheck test
2023-03-13 16:10:17 +01:00
Samuel Sieg
c29d1ddeba
Fix
2023-03-13 16:05:21 +01:00
Samuel Sieg
cb15800d25
Move option to deploy/redeploy, rename to skip-push
2023-03-13 16:02:24 +01:00
Richard Taylor
3e0b71b631
Fix healthcheck test
...
Looks like the tests started failing on the options healthcheck PR
after merging the container name env var PR.
2023-03-13 14:51:54 +00:00
David Heinemeier Hansson
9b666e54f3
Update README.md
2023-03-13 10:43:44 -04:00
David Heinemeier Hansson
d2f76dac6b
Merge branch 'main' into role-awareness
2023-03-13 15:16:44 +01:00
David Heinemeier Hansson
bf3d3f3ba7
Merge pull request #101 from davegudge/fix-docker-publish
...
fix: GitHub Workflow: Docker Publish
2023-03-13 15:14:06 +01:00
David Heinemeier Hansson
20733a4493
Merge pull request #102 from moomerman/cmd-options-for-healthcheck
...
Use custom web options for healthcheck
2023-03-13 15:12:25 +01:00
David Heinemeier Hansson
a267c1e835
Merge pull request #103 from 99linesofcode/fix-dockerfile-buildx
...
Install buildx inside container
2023-03-13 15:11:37 +01:00
David Heinemeier Hansson
c1c26a154d
Merge pull request #104 from moomerman/add-container-name-env-var
...
Add container name env var for containers
2023-03-13 15:10:02 +01:00
David Heinemeier Hansson
5969ff66d5
Merge pull request #107 from clowder/order-options-dig
...
Avoid `[ActiveSupport::OrderedOptions#dig]`
2023-03-13 15:08:31 +01:00
David Heinemeier Hansson
b1f5165dc0
Merge pull request #108 from clowder/patch-1
...
Update `accessory remove` description and warning
2023-03-13 15:07:47 +01:00
David Heinemeier Hansson
cce0fafdc4
Merge pull request #110 from kjellberg/patch-1
...
Update README.md to reflect backtick escaping in Utils.optionize
2023-03-13 15:07:09 +01:00
Samuel Sieg
6232175ef8
Undo changes from experimenting
2023-03-12 10:56:12 +01:00
Samuel Sieg
47af6d9483
Is a global option better?
2023-03-12 10:53:29 +01:00
Samuel Sieg
ff0170076e
Simplify
2023-03-12 10:44:33 +01:00
Samuel Sieg
9b39f2f3ab
Keep it simple for the proposal
2023-03-12 10:41:04 +01:00
Rasmus Kjellberg
600902ef5e
Update README.md
...
Backticks are handled by `Utils.optionize`
2023-03-12 07:39:07 +01:00
Richard Taylor
bb241dea43
Add container name env var for containers
...
Because the container name is generated it isn't possible to
determine this inside the container.
This adds the MRSK_CONTAINER_NAME env var when running the
container so it can be read by the service running inside the
container.
2023-03-11 10:14:41 +00:00
Chris Lowder
f26beeaa9f
Update accessory remove description and warning
...
Make it clear the accessory's data directory will also be removed.
2023-03-10 20:51:14 +00:00
Chris Lowder
41a5cb2a04
Avoid [ActiveSupport::OrderedOptions#dig]
...
The implementation has been updated upstream[^1] to expect symbolized
keys. MRSK relies heavily on the fact that nested keys are strings, so
we're removing existing uses of `#dig`.
[^1]: https://github.com/rails/rails/commit/5c15b586aab85fc4fa1465499fc9a97a446f4d52
2023-03-10 19:45:35 +00:00
Chris Lowder
643cb2c520
Include edge Rails in the build matrix
...
Highlighting an incompatibility with the new implementation of
`[ActiveSupport::OrderedOptions#dig]`.
[^1]: https://github.com/rails/rails/commit/5c15b586aab85fc4fa1465499fc9a97a446f4d52
2023-03-10 19:40:57 +00:00
Jordy Schreuders
b2c819fe32
Add README section on running MRSK from Docker
2023-03-10 19:23:14 +02:00
Jordy Schreuders
439b681308
Neglected to install buildx inside container
2023-03-10 18:13:32 +02:00
Richard Taylor
e5c5e89232
Use custom web options for healthcheck
...
If the web role has custom options, ensure these are used for the
healthcheck.
2023-03-10 15:55:04 +00:00
Samuel Sieg
4bf77ccd1b
Allow deploy/deliver without building and pushing the image
2023-03-10 11:26:35 +01:00
Dave Gudge
57e9231c5e
fix: Github Workflow: Docker Publish
...
The workflow was failing with:
```
The workflow is not valid. .github/workflows/docker-publish.yml (Line: 22, Col: 14): Unexpected symbol: '|'. Located at position 12 within expression: github.ref | replace('refs/tags/', '')
```
The `set-output` command is deprecated, so the issue has been fixed by utilising the `github.ref_name` context to retrieve the version tag that triggered the workflow.
> `github.ref_name`: The short ref name of the branch or tag that triggered the workflow run. This value matches the branch or tag name shown on GitHub. For example, `feature-branch-1`.
https://docs.github.com/en/actions/learn-github-actions/contexts
2023-03-10 10:02:33 +00:00
Tobias Bühlmann
ccf8762c98
Reuse web container per default
2023-03-10 10:50:26 +01:00
Tobias Bühlmann
418bc13ae7
Apply filters correctly
2023-03-10 10:33:55 +01:00
Tobias Bühlmann
7d4dfc4c86
Pass role names for simplicity
2023-03-10 09:18:47 +01:00
Tobias Bühlmann
fdb0c8ee91
Rolify app cli/command
2023-03-10 08:50:26 +01:00
Tobias Bühlmann
6b11303230
Prepare auditor to print a present role
2023-03-09 20:55:37 +01:00
Tobias Bühlmann
901484d75d
Filter roles and hosts by their respective counterpart
2023-03-09 18:21:39 +01:00
Tobias Bühlmann
e178907a21
Don't list duplicate hosts
2023-03-09 16:46:57 +01:00
David Heinemeier Hansson
3026a92c98
Merge pull request #71 from tbuehlmann/destination-awareness
...
Destination aware container names
2023-03-09 13:25:49 +00:00
David Heinemeier Hansson
ab7c6c6540
Use compact.join strategy here too
2023-03-09 14:24:19 +01:00
David Heinemeier Hansson
11f4dbfc5f
Bump version for 0.9.1
2023-03-09 14:11:42 +01:00
David Heinemeier Hansson
15e879e83c
Merge pull request #97 from martinbjeldbak/syntax-error-docker-install
...
Fix syntax error in dependency install step
2023-03-09 13:11:22 +00:00
Martin Bjeldbak Madsen
96180f9bd0
Fix syntax error in docker install exec
2023-03-09 22:34:11 +11:00
David Heinemeier Hansson
2f454c39e7
Bump version for 0.9.0
2023-03-09 11:22:44 +01:00
David Heinemeier Hansson
12f5b780b8
Merge pull request #93 from calmyournerves/update-readme-dockerfile-context
...
Update README with `dockerfile` and `context` builder options
2023-03-09 10:21:19 +00:00
David Heinemeier Hansson
3b7836f8e3
Merge pull request #95 from mrsked/cmd-args-for-roles
...
Custom options per role
2023-03-09 10:20:50 +00:00
David Heinemeier Hansson
64cc081f10
Explain container options
2023-03-09 11:20:28 +01:00
David Heinemeier Hansson
1f784176b7
Allow value-less options with true
2023-03-09 11:17:28 +01:00
David Heinemeier Hansson
d3f07d6313
Allow custom options per role
2023-03-09 11:09:19 +01:00
David Heinemeier Hansson
98a14f6173
Add cmd args for roles
2023-03-09 11:01:06 +01:00
David Heinemeier Hansson
487fcd4cea
Only used for traefik
2023-03-09 11:00:52 +01:00
David Heinemeier Hansson
c8badea6dd
Extract argumentization for cmd and add proper escaping
2023-03-09 10:54:53 +01:00
Samuel Sieg
16896fa8ad
💅
2023-03-09 10:15:07 +01:00
Samuel Sieg
716103590d
Keep it simple
2023-03-09 10:14:29 +01:00
Samuel Sieg
a9be6cc838
Add builder options for dockerfile and context to README
2023-03-09 10:12:53 +01:00
David Heinemeier Hansson
5a3ea24c6b
Merge pull request #77 from calmyournerves/dockerfile-context-build-options
...
Allow setting the Dockerfile and the Docker build context when building
2023-03-09 08:32:57 +00:00
David Heinemeier Hansson
a06c19633c
Merge pull request #92 from kjellberg/fix-traefik-host-port
...
fix: mrsk run command fails when traefik config is empty
2023-03-09 08:31:20 +00:00
David Heinemeier Hansson
46bec120c8
Test running without special config
2023-03-09 09:30:09 +01:00
David Heinemeier Hansson
0431bb5f97
Extract named constant and method
2023-03-09 09:29:56 +01:00
Samuel Sieg
2b95cdf8d0
Merge branch 'main' into dockerfile-context-build-options
2023-03-09 08:54:23 +01:00
Rasmus
eacdf34540
fix: mrsk deploy fails when traefik config is empty
2023-03-08 18:55:04 +01:00
David Heinemeier Hansson
7f0e6f1f13
Merge pull request #85 from clowder/traefik-host-port
...
Customizable Traefik host port
2023-03-08 17:06:51 +00:00
David Heinemeier Hansson
2e9d877185
Merge pull request #88 from simonrand/ensure-curl-is-available
...
Ensure curl is installed on hosts during bootstrapping
2023-03-08 17:05:40 +00:00
David Heinemeier Hansson
347046019f
Add test
2023-03-08 18:05:06 +01:00
David Heinemeier Hansson
3457c3f606
Style
2023-03-08 18:05:00 +01:00
David Heinemeier Hansson
155384472a
Allow primary host even when a specific role has been set
2023-03-08 18:00:13 +01:00
David Heinemeier Hansson
32ab79c0cc
Merge pull request #91 from kjellberg/lookup_username
...
Allow registry username to reference a secret
2023-03-08 16:44:09 +00:00
David Heinemeier Hansson
a4d576f105
Test ENV username
2023-03-08 17:43:29 +01:00
David Heinemeier Hansson
b809a971e2
One purpose per method
2023-03-08 17:43:23 +01:00
Rasmus
f531874be4
Allow registry username to be a reference to secret
2023-03-07 10:13:49 +01:00
Tobias Bühlmann
8b913068de
Add destination to healthcheck containers names
2023-03-06 16:54:13 +01:00
Simon Rand
9ae3886b2b
Ensure curl is installed during bootstrapping
2023-03-05 16:51:07 +00:00
Chris Lowder
963b96ff62
Customizable Traefik host port
...
Allow users to free up port 80 on the host machine, without losing
Traefik's Docker routing super-powers.
2023-03-05 13:13:22 +00:00
David Heinemeier Hansson
8c69990dbb
Merge pull request #82 from AxelTheGerman/ed25519
...
Add ed25519 and bcrypt_pbkdf to gemspec
2023-03-05 09:35:26 +01:00
Axel Gustav
3b6571ae55
Make sure ed25519 and bcrypt_pbkdf are in gemspec dependencies
2023-03-04 17:07:34 -04:00
David Heinemeier Hansson
013121c55d
Merge pull request #80 from kjellberg/patch-1
...
Publish Docker image for each release
2023-03-04 17:27:15 +01:00
Rasmus Kjellberg
059979b889
Update docker-publish.yml
2023-03-04 17:14:02 +01:00
Rasmus Kjellberg
11267b43c2
Publish and tag docker on a new version release
2023-03-04 17:05:50 +01:00
David Heinemeier Hansson
41168e8c23
Merge pull request #79 from calmyournerves/patch-1
...
Small README fixes
2023-03-04 15:19:23 +01:00
Samuel Sieg
cf73ae67a5
Fix README
2023-03-04 14:07:20 +01:00
Samuel Sieg
ff88ee0b22
Allow setting the build context used for building
2023-03-04 10:59:52 +01:00
Samuel Sieg
b6934b0f41
Allow configuring the Dockerfile used for building
2023-03-04 10:59:23 +01:00
David Heinemeier Hansson
e160b29693
Merge pull request #72 from kjellberg/patch-1
...
Update CONTRIBUTING.md
2023-03-04 08:50:03 +01:00
David Heinemeier Hansson
8ef88859ec
Build image on push
2023-03-04 08:23:24 +01:00
David Heinemeier Hansson
9c8bbb8640
Merge pull request #73 from kjellberg/dockerfile
...
Create Dockerfile
2023-03-04 08:18:48 +01:00
David Heinemeier Hansson
8faef72d33
Already created by WORKDIR
2023-03-04 08:15:32 +01:00
Rasmus
81cbd760d5
Group RUN commands - reduce image size
2023-03-04 07:38:29 +01:00
Rasmus
57b1a474fe
Create Dockerfile
2023-03-03 23:57:07 +01:00
Rasmus
38b8fe0d55
Added CODE_OF_CONDUCT.md
2023-03-03 19:17:35 +01:00
Rasmus Kjellberg
dcc4db1137
Update CONTRIBUTING.md
2023-03-03 17:44:04 +01:00
Tobias Bühlmann
170562c7e7
Let App be aware of destination
2023-03-03 15:29:00 +01:00
David Heinemeier Hansson
78927aa7a2
Create CONTRIBUTING.md
2023-03-03 15:00:56 +01:00
David Heinemeier Hansson
cec3468f50
Merge pull request #64 from jimt/typos-1
...
Fix typos
2023-03-02 10:26:52 +01:00
Jim Tittsler
cef13a2fe5
Fix typos
2023-03-02 10:48:12 +09:00
David Heinemeier Hansson
f9d6ffa746
Merge pull request #59 from lvnilesh/patch-1
...
add bitwarden erb for mrsk envify
2023-03-01 09:09:02 +01:00
David Heinemeier Hansson
8c8deb2e13
Update README.md
2023-03-01 09:05:22 +01:00
Nilesh Londhe
fa7b560d50
Update README.md
2023-02-28 17:24:05 -08:00
Nilesh Londhe
f7b0b9ac92
add bitwarden erb for mrsk envify
...
add bitwarden erb for mrsk envify
2023-02-28 17:22:11 -08:00
David Heinemeier Hansson
fcf226f790
Bump version for 0.8.4
2023-02-27 12:59:58 +01:00
David Heinemeier Hansson
2004cdaa0d
Fix test
2023-02-27 12:59:41 +01:00
David Heinemeier Hansson
b8413b3ab5
Recover README changes
...
Force push bad 😄
2023-02-26 11:34:32 +01:00
David Heinemeier Hansson
701f6ff237
Move sleep note out of host loop, so we only see it once
2023-02-26 11:27:19 +01:00
David Heinemeier Hansson
27279c6c82
Accessories can individually ask for confirmation
2023-02-23 15:41:49 +01:00
David Heinemeier Hansson
08dd468d87
Bump version for 0.8.3
2023-02-23 15:34:18 +01:00
David Heinemeier Hansson
9a4f502cc4
Pass confirmed flag to accessories
2023-02-23 15:31:56 +01:00
David Heinemeier Hansson
11e6f7914d
Merge pull request #56 from mrsked/more-resilient-zero-downtime-deploy
...
Start before stopping and longer timeouts
2023-02-23 12:24:06 +01:00
David Heinemeier Hansson
bc6963e6bf
Note that rebooting may cause air gap
2023-02-23 12:16:58 +01:00
David Heinemeier Hansson
f4f2b5cb17
Communicate the readiness delay
2023-02-23 12:04:57 +01:00
David Heinemeier Hansson
817336df49
No readiness delay in testing
2023-02-23 12:03:03 +01:00
David Heinemeier Hansson
4c399a74bb
Update to match latest
2023-02-23 12:02:56 +01:00
David Heinemeier Hansson
e12436a1db
Extract readiness_delay to config
2023-02-23 12:02:49 +01:00
David Heinemeier Hansson
b244e919bf
Merge branch 'main' into more-resilient-zero-downtime-deploy
...
* main:
Add option to skip audit broadcasts (useful when testing)
2023-02-23 11:52:45 +01:00
David Heinemeier Hansson
c1013543f9
Merge pull request #57 from intrip/document-cron
...
Example on how to set up Cron
2023-02-23 11:30:37 +01:00
Jacopo
eb46d0507e
Example on how to set up Cron
2023-02-23 11:02:39 +01:00
David Heinemeier Hansson
7ad416f029
Add option to skip audit broadcasts (useful when testing)
2023-02-23 10:04:35 +01:00
David Heinemeier Hansson
371f98d67f
Start before stopping and longer timeouts
2023-02-22 19:04:23 +01:00
David Heinemeier Hansson
b879412a6f
Upgrade to beta!
2023-02-21 15:31:28 +01:00
David Heinemeier Hansson
e678775a18
Merge pull request #54 from intrip/print-logs-for-healthcheck-status-mistmatch
...
Print container logs when HealthCheck response_code != 200
2023-02-21 14:34:46 +01:00
Jacopo
689b81014b
Print container logs when HealthCheck response_code != 200
...
The Healthcheck container is shut down right after performing the check, this
makes it harder to troubleshoot configuration issues in the healthcheck
endpoint, e.g DNS rebinding error. Printing the container logs helps the troubleshooting.
2023-02-21 11:48:29 +01:00
David Heinemeier Hansson
01a4eecf98
Bump version for 0.8.1
2023-02-20 18:21:05 +01:00
David Heinemeier Hansson
6f7422af44
Merge pull request #53 from pagbrl/fix-env-concatenation
...
fix(escape-cli-args): Always use quotes to escape CLI arguments
2023-02-20 18:20:28 +01:00
David Heinemeier Hansson
1fccaf60b2
Cleanup escaping logic
2023-02-20 18:20:08 +01:00
David Heinemeier Hansson
9b02a7668d
Merge branch 'main' into pr/53
...
* main:
Bump version for 0.8.0
Remove images of the same name before pulling a new one
Changed to a timeout
Better language
Switch to ruby-based retry
2023-02-20 18:14:47 +01:00
David Heinemeier Hansson
f6ea287e66
Bump version for 0.8.0
2023-02-20 18:06:56 +01:00
David Heinemeier Hansson
42b343436d
Remove images of the same name before pulling a new one
...
Or you'll end up with untagged dupes.
2023-02-20 18:06:16 +01:00
David Heinemeier Hansson
9d6ccf9889
Changed to a timeout
2023-02-20 17:59:41 +01:00
David Heinemeier Hansson
c4cc9e690b
Better language
2023-02-20 17:44:55 +01:00
David Heinemeier Hansson
1ccf679ca9
Switch to ruby-based retry
...
Retry connection errors with backoff
2023-02-20 17:42:55 +01:00
Paul Gabriel
f81ba12aa5
fix(escape): Escape double quotes and all other characters reliably
2023-02-20 16:49:47 +01:00
Paul Gabriel
25e8b91569
fix(escape-cli-args): Always use quotes to escape CLI arguments
2023-02-20 15:02:34 +01:00
Paul Gabriel
21c6a1f1ba
chore(rebase): Rebase main
2023-02-20 10:27:51 +01:00
David Heinemeier Hansson
5898fdd8f4
Expand arguments to be more self-explanatory in logs
2023-02-19 18:11:06 +01:00
David Heinemeier Hansson
5299826146
Alphabetical order
2023-02-19 17:43:56 +01:00
David Heinemeier Hansson
28be8dc0f0
Encourage registry password from ENV
2023-02-19 17:42:30 +01:00
David Heinemeier Hansson
2ed3ccc53e
More readable tests
2023-02-19 17:40:41 +01:00
David Heinemeier Hansson
11c726858d
Point to where secrets are from
2023-02-19 17:34:49 +01:00
David Heinemeier Hansson
8706fae2b5
Reveal all options in default config
2023-02-19 17:34:06 +01:00
David Heinemeier Hansson
67d6c3acfe
Think we can drop this
...
Now that we rescue at the top level
2023-02-19 17:33:54 +01:00
David Heinemeier Hansson
a5fd4c76ba
No need for invocation
2023-02-19 17:22:03 +01:00
David Heinemeier Hansson
f3a5845501
Remember this
2023-02-19 17:16:14 +01:00
David Heinemeier Hansson
5356f31e2e
Remove also removes accessories but requires confirmation
2023-02-19 17:16:14 +01:00
David Heinemeier Hansson
67cb89b9b9
Remove requires confirmation
2023-02-19 17:16:06 +01:00
David Heinemeier Hansson
745b09051e
Test app remove
2023-02-19 17:15:57 +01:00
David Heinemeier Hansson
0fa70f4688
Stop app before removing it
2023-02-19 17:15:57 +01:00
David Heinemeier Hansson
6bc2def677
No need for invoke
...
No double action possible
2023-02-19 17:15:57 +01:00
David Heinemeier Hansson
42bc691758
CLI doc updates
...
Match word
Language
Suggest what accessories are
There are also accessories
Default already shown
Better example
Warn about secrets being shown
Now also accessories
Wording
Clarifications
Clarify how to see options
General option for all
Options important here too
Hide subcommands
Implied
Simpler as just version
Be concise
Missing word
Wordsmith
Simpler and uniform words are better
Clarify what exactly we're manipulating
Wordsmithing
Implicit
Simpler language
Hide subcommands
Clarify its container management
Just one per server
Simpler
2023-02-19 17:15:44 +01:00
David Heinemeier Hansson
e5c4cb0344
Retry healthcheck for up to 10 seconds (in case container wasnt ready)
2023-02-19 15:34:36 +01:00
David Heinemeier Hansson
a0d71f3fe4
Protect against missing current version
2023-02-19 09:48:35 +01:00
David Heinemeier Hansson
389ce2f701
Only output if there's a failure
2023-02-19 09:36:04 +01:00
David Heinemeier Hansson
8e918b1906
Output logs when healthcheck fails
2023-02-19 09:33:49 +01:00
David Heinemeier Hansson
e37e5f7d09
Bump version for 0.7.2
2023-02-18 18:23:28 +01:00
David Heinemeier Hansson
7f1191bf59
Change broadcast cmd to just take an argument instead of STDIN
...
Simpler
2023-02-18 18:22:46 +01:00
David Heinemeier Hansson
0c03216fdf
Bump version for 0.7.1
2023-02-18 16:33:28 +01:00
David Heinemeier Hansson
1973f55c58
Don't include recorded_at with broadcast line
...
Receiving end will already add that
2023-02-18 16:33:12 +01:00
David Heinemeier Hansson
0a51cd0899
Update for healthcheck config
2023-02-18 16:28:31 +01:00
David Heinemeier Hansson
4b0a8728f1
Bump version for 0.7.0
2023-02-18 16:27:08 +01:00
David Heinemeier Hansson
3075f8daf1
Include healthcheck in config
2023-02-18 16:26:23 +01:00
David Heinemeier Hansson
9985834bd6
Use number
2023-02-18 16:26:17 +01:00
David Heinemeier Hansson
94b4461c76
Merge pull request #52 from mrsked/health-check-with-deploy
...
Add healthcheck before deploy
2023-02-18 16:24:41 +01:00
David Heinemeier Hansson
7afa9e0815
Mention healthcheck as part of steps instead
2023-02-18 16:23:46 +01:00
David Heinemeier Hansson
933ece35ab
Add healthcheck before deploy
2023-02-18 16:22:08 +01:00
David Heinemeier Hansson
2f80b300f0
Test rolling back to a good version too
2023-02-18 14:55:11 +01:00
David Heinemeier Hansson
2e06bf59a4
Protect against rolling back to a bad version
2023-02-18 14:33:47 +01:00
David Heinemeier Hansson
854795c2b6
Wording
2023-02-18 12:10:42 +01:00
David Heinemeier Hansson
4fe7fb705a
Use same sentence style as broadcasts for audit log lines
2023-02-18 12:00:15 +01:00
David Heinemeier Hansson
270e0d0e2c
Merge pull request #50 from pagbrl/labels-traefik-docs
...
docs(traefik-labels): Improve docs for traefik labels formatting
2023-02-18 11:42:43 +01:00
David Heinemeier Hansson
6ddc9cf017
Merge pull request #51 from mrsked/audit-broadcasts
...
Add audit broadcasts
2023-02-18 11:41:19 +01:00
David Heinemeier Hansson
2dcd76b2de
Merge branch 'main' into audit-broadcasts
...
* main:
Remove unnecessary audit recordings
2023-02-18 11:38:34 +01:00
David Heinemeier Hansson
a6eabd0b67
Remove unnecessary audit recordings
2023-02-18 11:36:52 +01:00
David Heinemeier Hansson
fb9357b5ba
Add audit broadcasts
2023-02-18 11:36:30 +01:00
Paul Gabriel
d484cfcc31
docs(traefik-labels): Improve docs for traefik labels formatting
2023-02-18 00:25:30 +01:00
David Heinemeier Hansson
5c93642f2a
Prepare for custom pruning
2023-02-15 20:34:08 +01:00
David Heinemeier Hansson
8ff206ba7e
Highlight
2023-02-15 18:08:46 +01:00
David Heinemeier Hansson
e36a5e111c
Make a note about the /up requirement
2023-02-15 18:08:26 +01:00
David Heinemeier Hansson
72522001e5
Merge pull request #46 from fschueller/fix-prune-desc
...
Adjust CLI description for prune command to mention 7 days
2023-02-15 14:09:06 +01:00
David Heinemeier Hansson
50c4bb83cb
Bump version for 0.6.4
2023-02-15 13:48:10 +01:00
David Heinemeier Hansson
b2875ad056
More readable tests
2023-02-15 13:47:16 +01:00
David Heinemeier Hansson
8ec94f105c
Tag images with service label so we can prune exclusively
2023-02-15 13:41:03 +01:00
David Heinemeier Hansson
90f4212a68
Stray copypasta
2023-02-15 13:39:53 +01:00
David Heinemeier Hansson
648894f9a9
No need for quoting
2023-02-15 13:32:59 +01:00
David Heinemeier Hansson
dc68639dfa
Prune all unused images matching time filter
2023-02-15 13:32:50 +01:00
David Heinemeier Hansson
244cf8b3b7
Add prune command test
2023-02-15 13:30:31 +01:00
David Heinemeier Hansson
f25f506d77
Don't use abbreviations when we don't have to
2023-02-15 13:26:57 +01:00
David Heinemeier Hansson
c29a177a7a
DRY the use of build options into one call
2023-02-15 13:23:14 +01:00
Farah Schüller
03328a998c
Adjust CLI description for prune command to mention 7 days
2023-02-14 17:05:36 +01:00
David Heinemeier Hansson
ec5fad5bea
Describe the vision
2023-02-11 14:30:23 +01:00
David Heinemeier Hansson
c671acf68f
Bump version for 0.6.3
2023-02-11 13:10:47 +01:00
David Heinemeier Hansson
4f2cb5e184
Shorter
2023-02-11 13:00:22 +01:00
David Heinemeier Hansson
63a065237a
Ensure .env file is only accessible to user
2023-02-11 12:56:57 +01:00
David Heinemeier Hansson
0f4e1888d9
Just delete the full cache directory, it isnt needed
2023-02-10 14:35:11 +01:00
David Heinemeier Hansson
d4d3308c34
Need to use args
2023-02-09 21:50:57 +01:00
David Heinemeier Hansson
b9c6d2966b
Bump version for 0.6.2
2023-02-09 19:57:39 +01:00
David Heinemeier Hansson
f371cda8d8
Stick with json logger for filebeat compatibility but cap at 10mb
2023-02-09 19:56:17 +01:00
David Heinemeier Hansson
9eaf0f3b8f
Lower default prune target for images to 7 days. Its just a local convenience cache. Dont risk filling up the disk on very active development.
2023-02-09 18:07:52 +01:00
David Heinemeier Hansson
a80289d046
Use local log driver for everything
...
Auto rotation, max is 100mb
2023-02-09 17:02:15 +01:00
David Heinemeier Hansson
aae45afb1b
Easier to read tests
2023-02-09 17:01:35 +01:00
David Heinemeier Hansson
f4157c95c4
Easier to read tests
2023-02-09 16:55:09 +01:00
David Heinemeier Hansson
bb5176673b
Deal with lazy-setting of configuration
2023-02-08 14:24:16 +01:00
David Heinemeier Hansson
e9cb5b64b3
Remove Fly as an example of k8s
2023-02-08 14:14:52 +01:00
David Heinemeier Hansson
0433619518
Tag new builds with latest
2023-02-08 14:08:36 +01:00
David Heinemeier Hansson
110bf44a3b
Recommend single layer
2023-02-08 10:27:27 +01:00
David Heinemeier Hansson
fbdf39a733
Code highlighting
2023-02-08 08:37:33 +01:00
David Heinemeier Hansson
f99ff47f75
Make sure folks dont leak GITHUB_TOKENs into the image when using git dependencies
2023-02-08 08:35:30 +01:00
David Heinemeier Hansson
bb18189b01
Bump version for 0.6.1
2023-02-07 15:05:58 +01:00
David Heinemeier Hansson
18bdb33de2
Fix issue with removing containers triggering twice, then ensure app stop runs closer to app run on each host
2023-02-07 15:05:58 +01:00
David Heinemeier Hansson
1ec016ecad
Add a brief note about Docker Swarm
...
A deeper comparison would be nice at some point.
2023-02-07 13:58:26 +01:00
David Heinemeier Hansson
bd61e04088
Merge pull request #38 from tbuehlmann/native-builder-image-tag-position
...
Move image tag to proper position
2023-02-06 09:22:57 +01:00
David Heinemeier Hansson
0da2a6408b
Merge pull request #39 from adammiribyan/outside-git
...
Commit hash as version but not in git
2023-02-06 09:22:25 +01:00
David Heinemeier Hansson
9697a9a6e0
Merge pull request #40 from adammiribyan/gemspec
...
Match README
2023-02-06 09:21:57 +01:00
Adam Miribyan
32d52b024c
Match README
...
Update gemspec description to match what's in README
2023-02-05 23:09:08 +01:00
Adam
2fe01f13df
Commit hash version but not in git
...
Fixes #11
2023-02-05 20:31:14 +01:00
Tobias Bühlmann
554a3558ab
Move image tag to proper position
2023-02-05 18:39:52 +01:00
David Heinemeier Hansson
9aa57dd0c7
Bump version for 0.6.0
2023-02-05 17:53:43 +01:00
David Heinemeier Hansson
cb9f57356e
Load destination ENV file also
2023-02-05 17:52:57 +01:00
David Heinemeier Hansson
02a5726072
Allow destination specific envifying
2023-02-05 16:35:37 +01:00
David Heinemeier Hansson
e865e823d5
Add envify for managing .env file
2023-02-05 16:30:56 +01:00
David Heinemeier Hansson
10cad5c459
Create binstub without bundler, document it all agnostically
...
You can use MRSK with something other than Rails.
2023-02-05 16:23:34 +01:00
David Heinemeier Hansson
ebcb297582
Merge pull request #24 from chrisdebruin/allow-bastion-server
...
Allow use of bastion host
2023-02-04 15:44:30 +01:00
David Heinemeier Hansson
0a293ae4d6
Fix and expand testing
2023-02-04 15:43:45 +01:00
Chris de Bruin
bdff11e1fc
Allow use of bastion host
2023-02-04 15:38:05 +01:00
David Heinemeier Hansson
9cfb6fb0a9
Merge issue
2023-02-04 15:34:48 +01:00
David Heinemeier Hansson
9ec6f9d74f
Merge branch 'main' into allow-bastion-server
2023-02-04 15:33:25 +01:00
David Heinemeier Hansson
45207f0c4f
Explain the dance
2023-02-04 15:27:41 +01:00
David Heinemeier Hansson
cf9a402ad8
Stop treating RAILS_MASTER_KEY as special
2023-02-04 15:26:59 +01:00
David Heinemeier Hansson
64a5a790a7
Ensure secret can be used alone
2023-02-04 15:26:43 +01:00
David Heinemeier Hansson
78d4e1e1e9
Easier to read
2023-02-04 15:12:06 +01:00
David Heinemeier Hansson
74c7a6d5de
Expand app command testing
2023-02-04 10:31:04 +01:00
David Heinemeier Hansson
340929e7e7
Use a version
2023-02-04 10:20:51 +01:00
David Heinemeier Hansson
6f1a3f5524
Don't need this, just use containers
2023-02-04 10:16:24 +01:00
David Heinemeier Hansson
7077da5a64
Spacing
2023-02-04 10:15:43 +01:00
David Heinemeier Hansson
77c63dcd04
Style
2023-02-04 10:14:35 +01:00
David Heinemeier Hansson
e7ac73be5a
Join in run_over_ssh instead of all over
2023-02-04 10:14:31 +01:00
David Heinemeier Hansson
dfca9d8c48
Merge branch 'main' into allow-bastion-server
2023-02-04 10:06:15 +01:00
David Heinemeier Hansson
6032d5651a
Merge pull request #35 from rails/zeitwerk
...
Load with Zeitwerk
2023-02-04 10:05:43 +01:00
Xavier Noria
539752e9bd
Load with Zeitwerk
2023-02-03 22:45:12 +01:00
David Heinemeier Hansson
94b28a1b29
Extract method
2023-02-03 20:53:33 +01:00
David Heinemeier Hansson
5911914e95
Bump version for 0.5.1
2023-02-03 20:48:21 +01:00
David Heinemeier Hansson
3daecf696a
Extract proper auditor and audit everything
2023-02-03 20:45:32 +01:00
David Heinemeier Hansson
497c57e3e5
Style
2023-02-03 20:44:43 +01:00
David Heinemeier Hansson
8a42fd2f30
Fix signature
2023-02-03 20:43:22 +01:00
David Heinemeier Hansson
2182cfb5c7
Bump version for 0.5.0
2023-02-03 17:49:47 +01:00
David Heinemeier Hansson
5c9a602d76
Fixed host
2023-02-03 17:46:41 +01:00
David Heinemeier Hansson
b964e04f93
Bring accessory execution in line with app
2023-02-03 17:24:36 +01:00
David Heinemeier Hansson
1fb2c71f65
Follow same dot style
2023-02-03 17:22:55 +01:00
David Heinemeier Hansson
58417f610f
Dupe comment
2023-02-03 17:20:14 +01:00
David Heinemeier Hansson
5856a77a53
Bring accessory execution in line with app
2023-02-03 17:19:20 +01:00
David Heinemeier Hansson
5ed3ea9d26
Grouping by spacing
2023-02-03 17:18:58 +01:00
David Heinemeier Hansson
59199cc69a
Fix bug
2023-02-03 17:18:47 +01:00
David Heinemeier Hansson
c453b947e0
Add exec tests
2023-02-03 17:18:42 +01:00
David Heinemeier Hansson
87e54d41e4
Need two stubs!
2023-02-03 17:03:26 +01:00
David Heinemeier Hansson
64b91daab1
Drop concerns
...
Not enough reuse possible
2023-02-03 16:55:34 +01:00
David Heinemeier Hansson
13e22f8a34
Repository really is app specific, since it relies on versions
2023-02-03 16:45:52 +01:00
David Heinemeier Hansson
8848335fbc
Extract executions into separate concern
2023-02-03 16:39:26 +01:00
David Heinemeier Hansson
a3fe8856c9
Fix test
2023-02-03 16:27:16 +01:00
David Heinemeier Hansson
d263b0ffa5
Extract xargs helper
2023-02-03 16:27:10 +01:00
David Heinemeier Hansson
3c1053fedd
Clarify exec modes and drop tailored versions
2023-02-03 16:07:25 +01:00
David Heinemeier Hansson
a3d998508b
Proper versioning for console and bash
2023-02-03 15:16:40 +01:00
David Heinemeier Hansson
3d71ecdf80
Only say if you're going to do it
2023-02-03 15:16:30 +01:00
David Heinemeier Hansson
37e216f2b7
Add some more tests
2023-02-03 15:08:44 +01:00
David Heinemeier Hansson
17e75ec2c9
No more reboot
2023-02-03 15:06:43 +01:00
David Heinemeier Hansson
7621784235
Bring back regular version with narration
2023-02-03 15:05:34 +01:00
David Heinemeier Hansson
687b8c9def
Rely on shared --version
2023-02-03 14:41:39 +01:00
David Heinemeier Hansson
13d4eb4017
Narrate multi-stage actions
2023-02-03 14:41:30 +01:00
David Heinemeier Hansson
78f0be9c76
Only multi-stage actions should talk
2023-02-03 14:33:49 +01:00
David Heinemeier Hansson
839a0df40e
Boot now does its own stopping
2023-02-03 14:31:56 +01:00
David Heinemeier Hansson
74c493def4
Don't actually need reboot now that boot can do that
2023-02-03 14:31:11 +01:00
Chris de Bruin
7d95472543
Added -J for ssh proxy
2023-02-03 14:31:09 +01:00
David Heinemeier Hansson
71681cb8be
Use single string-based proxy declaration
2023-02-03 14:30:20 +01:00
Chris de Bruin
1fef6ba505
Allow use of bastion host
2023-02-03 14:30:20 +01:00
David Heinemeier Hansson
22bbedf298
Show current running version
2023-02-03 14:08:00 +01:00
David Heinemeier Hansson
15a213eec6
Escape pipe and test for xargs
2023-02-03 14:07:52 +01:00
David Heinemeier Hansson
67f9ffe961
xargs when piping
2023-02-03 14:07:37 +01:00
David Heinemeier Hansson
25e52d6c93
Fix escaping
2023-02-03 14:07:20 +01:00
David Heinemeier Hansson
2023c377ab
Reboot if running
2023-02-03 13:52:31 +01:00
David Heinemeier Hansson
3bd2559c03
Version comes from config
2023-02-03 13:52:10 +01:00
David Heinemeier Hansson
ad26bce5a2
Add mocha for testing
2023-02-03 13:48:34 +01:00
David Heinemeier Hansson
aed7425b42
Streamline version handling
2023-02-03 13:21:11 +01:00
David Heinemeier Hansson
fadb73da39
Replace stub value
2023-02-03 13:20:10 +01:00
David Heinemeier Hansson
8024949fe7
Remove only specific container needed for rebooting
2023-02-03 13:20:03 +01:00
David Heinemeier Hansson
004c154abb
Reset MRSK between invocations in CLI tests
...
Don't love having #reset, but whatever for now.
2023-02-03 13:15:14 +01:00
David Heinemeier Hansson
35b42cc885
Fix tests
2023-02-02 18:05:56 +01:00
David Heinemeier Hansson
6d80005f5d
Run boot and console on relevant versions
...
Instead of just defaulting to local hash version
2023-02-02 18:05:03 +01:00
David Heinemeier Hansson
c8f673ef7c
Add images command to see what's on the server for the service repository
2023-02-02 16:53:46 +01:00
David Heinemeier Hansson
212d5ec783
Merge pull request #31 from fschueller/accessory-class
...
Align config class name with file name
2023-02-02 15:50:50 +01:00
David Heinemeier Hansson
f88685a525
Extract CliTestCase
2023-02-02 15:37:41 +01:00
David Heinemeier Hansson
08908c3925
Fix test
2023-02-02 15:31:33 +01:00
David Heinemeier Hansson
48a9f599b8
It's all of them
2023-02-02 15:31:27 +01:00
David Heinemeier Hansson
7cc64299c8
Add app reboot
2023-02-02 15:28:36 +01:00
David Heinemeier Hansson
7494f08978
Cleanup
2023-02-02 15:28:36 +01:00
David Heinemeier Hansson
2b232b41ce
Unbundle remove so parts can be triggered individually
2023-02-02 15:28:36 +01:00
David Heinemeier Hansson
c28065fd42
Fix doc
2023-02-02 15:28:36 +01:00
Farah Schüller
80b90ab689
Align config class name with file name
...
`Mrsk::Configuration::Assessory` -> `Mrsk::Configuration::Accessory` thus
aligning with the name of the file.
2023-02-02 12:44:48 +01:00
David Heinemeier Hansson
d71950f5e4
Merge pull request #30 from azolf/improve-test-coverage
...
Improve test coverage
2023-02-02 10:51:20 +01:00
David Heinemeier Hansson
00d194e3f3
Bump version for 0.4.0
2023-02-01 15:09:37 +01:00
David Heinemeier Hansson
3f44e25b63
Allow dynamic accessory files to reference declared ENVs
2023-02-01 14:45:56 +01:00
David Heinemeier Hansson
4c8b1a3e04
No longer needed
2023-02-01 14:11:52 +01:00
David Heinemeier Hansson
f06d639583
Add quiet mode
...
Only log errors
2023-02-01 14:10:51 +01:00
David Heinemeier Hansson
cdd77445d0
Not used
2023-02-01 14:04:57 +01:00
David Heinemeier Hansson
71f8f164ca
Expose ssh_run
2023-02-01 14:04:51 +01:00
David Heinemeier Hansson
1840f667d3
Accessory already knows its host
2023-02-01 14:04:36 +01:00
David Heinemeier Hansson
00afd5c6fc
Yield accessory
2023-02-01 13:30:04 +01:00
David Heinemeier Hansson
e17a7e28cb
Missing )
2023-02-01 13:29:14 +01:00
David Heinemeier Hansson
88b5e52b9f
Exec over ssh with accessory
2023-02-01 13:28:29 +01:00
David Heinemeier Hansson
bc0ae84eb1
Needn't pass existing ENVs either
2023-02-01 13:20:47 +01:00
David Heinemeier Hansson
cb6fdbefc8
Exec can't mount
2023-02-01 13:19:01 +01:00
Amirhosein Zolfaghari
5bf3c36001
added more test cases for traefik command
2023-02-01 11:53:25 +03:30
Amirhosein Zolfaghari
afb7b43f1a
added registry command tests
2023-02-01 11:48:47 +03:30
Amirhosein Zolfaghari
4f57976efe
ignore useless files
2023-02-01 11:48:47 +03:30
David Heinemeier Hansson
444e33721a
This is still there
2023-01-31 20:13:45 +01:00
David Heinemeier Hansson
ca86573d89
Custom cmd args for Traefik
2023-01-31 20:11:42 +01:00
David Heinemeier Hansson
e317935ab3
Already getting timestamps from Rails log
2023-01-30 19:19:35 +01:00
David Heinemeier Hansson
767991afe3
Clearer still
2023-01-30 16:59:44 +01:00
David Heinemeier Hansson
7e191dc267
Document use of .env
2023-01-30 16:59:10 +01:00
David Heinemeier Hansson
0f0529c785
Use dotenv to load .env
2023-01-30 16:39:38 +01:00
David Heinemeier Hansson
3ebf8d7777
Fix interpolation
2023-01-30 13:59:44 +01:00
David Heinemeier Hansson
cd8570d776
Catch all other exceptions too
2023-01-30 13:52:24 +01:00
David Heinemeier Hansson
7c72dfcb5d
Include env validation of new config
...
So we fail fast when required ENVs are missing!
2023-01-30 13:50:15 +01:00
David Heinemeier Hansson
52d75508ea
Ensure there's some cap on output
...
Need to DRY this out
2023-01-30 12:49:52 +01:00
David Heinemeier Hansson
ea6144e664
Set ENV verbose too to display backtraces
2023-01-30 12:49:52 +01:00
David Heinemeier Hansson
d1559949ba
Merge pull request #26 from adammiribyan/explicit-clear-only
...
Allow "clear" only env configuration
2023-01-29 16:13:50 +01:00
David Heinemeier Hansson
60c2d45bdc
Merge pull request #25 from dzhulk/docker-exec-options-fix
...
Exclude volume_args from `docker exec` arguments
2023-01-29 16:12:16 +01:00
Adam Miribyan
afefd32379
Allow "clear" only env configuration
2023-01-28 17:19:07 +01:00
David Heinemeier Hansson
c23928348b
Bump version for 0.3.1
2023-01-27 17:04:52 +01:00
Murat Dzhulkuttiev
4937673aac
Merge branch 'rails:main' into docker-exec-options-fix
2023-01-27 20:04:41 +04:00
David Heinemeier Hansson
979b7d80ba
Need the command, not config
2023-01-27 16:57:02 +01:00
Murat Dzhulkuttiev
c1cf834dfc
Exclude volume args from docker exec arguments
2023-01-27 22:29:31 +07:00
David Heinemeier Hansson
0111fcc4e4
Bump version for 0.3.0
2023-01-27 16:19:31 +01:00
David Heinemeier Hansson
407e1cc028
Protect accessory cli from missing accessory
2023-01-27 16:12:18 +01:00
David Heinemeier Hansson
f58e5e0935
Better error reporting and failure capture for build push
2023-01-27 15:56:07 +01:00
David Heinemeier Hansson
03fdb9a9ac
Chain builder setup for better resiliency
...
Context may already exist while buildx does not
2023-01-27 15:41:28 +01:00
David Heinemeier Hansson
a5ebb30de2
Include accessories in main details
2023-01-27 15:20:27 +01:00
David Heinemeier Hansson
ec18a2a1c4
Tolerable error reporting
2023-01-27 15:04:27 +01:00
David Heinemeier Hansson
9af09256d9
Nicer output
2023-01-26 22:17:02 +01:00
David Heinemeier Hansson
29a8a52cef
Execute over SSH too
2023-01-26 16:17:00 +01:00
David Heinemeier Hansson
de0a3f8ee8
Only catch what we can carry
2023-01-26 16:16:47 +01:00
David Heinemeier Hansson
08cac72475
Allow skipping master key
2023-01-24 13:19:12 +01:00
David Heinemeier Hansson
200f12a4a1
Single setup command
2023-01-23 14:13:17 +01:00
David Heinemeier Hansson
f0d88a5ffe
Bootstrap accessory hosts too
2023-01-23 14:13:10 +01:00
David Heinemeier Hansson
d6a6f000f9
Inspect accessories too
2023-01-23 14:12:50 +01:00
David Heinemeier Hansson
15495fb48c
Allow partial overwrites
2023-01-23 14:12:43 +01:00
David Heinemeier Hansson
05f84cdbef
Makes it easier to resume remove
2023-01-23 14:12:27 +01:00
David Heinemeier Hansson
03488bc67a
Add managed accessory directories
2023-01-23 13:36:47 +01:00
David Heinemeier Hansson
eceafbedf4
Better explaining variables
2023-01-23 12:50:44 +01:00
David Heinemeier Hansson
e1d518216a
Add dynamic file expansion
2023-01-23 12:45:49 +01:00
David Heinemeier Hansson
52d10394f7
Ensure uploads are readable
2023-01-23 12:45:36 +01:00
David Heinemeier Hansson
ddf52da132
Add exec and bash commands to accessories
2023-01-23 12:45:20 +01:00
David Heinemeier Hansson
747e0fd4c2
Fix tests
2023-01-23 10:58:31 +01:00
David Heinemeier Hansson
6177673870
Get details on all accessories
2023-01-23 10:39:22 +01:00
David Heinemeier Hansson
78e50f23cd
All boot/remove for all accessories
2023-01-23 10:38:03 +01:00
David Heinemeier Hansson
699f271e6e
No need for protecting against re-invocation
2023-01-23 10:37:49 +01:00
David Heinemeier Hansson
148c43fe29
Extract make_directory_for
2023-01-23 10:37:19 +01:00
David Heinemeier Hansson
cd44014069
Commands should do all the actual work
2023-01-23 10:35:22 +01:00
David Heinemeier Hansson
1bcc65bc56
Must use absolute path
2023-01-23 10:04:55 +01:00
David Heinemeier Hansson
62cc986c54
Cleanup files directory too
2023-01-23 10:04:46 +01:00
David Heinemeier Hansson
7b1ffbfd6d
Unify docs
2023-01-23 10:04:36 +01:00
David Heinemeier Hansson
8af7e48a90
Add file mapping to accessories
2023-01-23 09:43:57 +01:00
David Heinemeier Hansson
92565d58d5
Bump version for 0.2.0
2023-01-23 07:09:37 +01:00
David Heinemeier Hansson
2d0a1c33ae
Merge pull request #23 from rails/accessories
...
Accessories
2023-01-22 22:02:04 +01:00
David Heinemeier Hansson
75bfdaa702
Fix references
2023-01-22 22:00:16 +01:00
David Heinemeier Hansson
c69d6e1569
Fix volume args
2023-01-22 21:58:30 +01:00
David Heinemeier Hansson
25fb08791a
Correct merge conflict
2023-01-22 21:58:22 +01:00
David Heinemeier Hansson
6231a8668c
Merge branch 'main' into accessories
2023-01-22 21:54:52 +01:00
David Heinemeier Hansson
b74ce02f31
Document accessories
2023-01-22 21:54:13 +01:00
David Heinemeier Hansson
1099b6fa84
Fix tests
2023-01-22 21:51:11 +01:00
David Heinemeier Hansson
247aaeb6ef
Fix details to be per accessory
2023-01-22 21:39:12 +01:00
David Heinemeier Hansson
7ec7520d6d
Output command and logs
2023-01-22 21:39:02 +01:00
David Heinemeier Hansson
5e15de0394
Use shared filter
2023-01-22 21:38:43 +01:00
David Heinemeier Hansson
bb15f98496
Include env
2023-01-22 21:38:37 +01:00
David Heinemeier Hansson
beb77fd3ef
Merge pull request #21 from chrisdebruin/add-support-for-volumes
...
Added support for volumes
2023-01-22 19:48:16 +01:00
Chris de Bruin
6b19a0b6d4
Rename to volume_args
2023-01-22 17:09:08 +01:00
David Heinemeier Hansson
6b98eb3677
Operate accessories
...
When you want mysql, redis, and the like under MRSK management
2023-01-22 16:52:57 +01:00
David Heinemeier Hansson
48f8f7cb57
Fix test name from copypasta
2023-01-22 16:22:09 +01:00
Chris de Bruin
86ac1dd2d5
Add support for volumes
2023-01-22 16:21:50 +01:00
David Heinemeier Hansson
4432067585
Merge branch 'main' into add-support-for-volumes
2023-01-22 16:00:14 +01:00
David Heinemeier Hansson
a1c0cf39cb
Disambiguate
2023-01-22 15:47:46 +01:00
David Heinemeier Hansson
2213739156
Fix tests
2023-01-22 15:43:47 +01:00
David Heinemeier Hansson
936d346ca6
Use directory for better organization
2023-01-22 15:37:42 +01:00
David Heinemeier Hansson
2af4885b39
Doc tweaks
2023-01-22 11:47:06 +01:00
David Heinemeier Hansson
e9f8eea6c9
Word doesn't add anything
2023-01-22 11:34:58 +01:00
David Heinemeier Hansson
82067cd077
Use similar headline form
2023-01-22 11:32:59 +01:00
David Heinemeier Hansson
48c45a0cf8
Explain reboot procedure
2023-01-22 11:31:19 +01:00
David Heinemeier Hansson
3a9c8455ec
Style / presentatino
2023-01-22 11:27:39 +01:00
David Heinemeier Hansson
598e7ab97f
Add power to follow logs on app and traefik
2023-01-22 11:27:31 +01:00
David Heinemeier Hansson
6eb0abbb30
Explain traefik: true
2023-01-22 11:00:24 +01:00
David Heinemeier Hansson
34652ca321
Always fetch to fail quick
2023-01-22 11:00:18 +01:00
David Heinemeier Hansson
917d429901
Simpler
2023-01-22 10:51:18 +01:00
David Heinemeier Hansson
a16e5ce886
Use class specific buildx instances
...
So we don't have to muck with the machine default, and can swap between configurations without tearing down the old builder.
2023-01-22 10:47:22 +01:00
David Heinemeier Hansson
e783950825
Always be verbose about building
...
Serves as progress indicator, step too long without one
2023-01-22 10:45:05 +01:00
David Heinemeier Hansson
e4dc4c300e
Log more aggressively for now
2023-01-22 10:21:50 +01:00
David Heinemeier Hansson
925ac86459
No longer need actual class name with more descriptive name
2023-01-22 10:17:40 +01:00
David Heinemeier Hansson
1795c7c6a4
Doc updates
2023-01-22 10:12:46 +01:00
David Heinemeier Hansson
a3a7fce1e8
Note that it starts with SSH
2023-01-22 10:08:27 +01:00
David Heinemeier Hansson
bfec21c00f
Recommend fetch for early bail-out
2023-01-22 10:07:07 +01:00
David Heinemeier Hansson
2ad135c237
No builder definition needed for native multiarch
2023-01-22 10:06:20 +01:00
David Heinemeier Hansson
287798ad57
Add option for remote building of single-arch
2023-01-22 10:06:04 +01:00
David Heinemeier Hansson
5c75404fe9
Add reboot Traefik to apply new start config
2023-01-22 09:44:09 +01:00
Chris de Bruin
2dc0f7cb66
Add support for volumes
2023-01-21 14:48:01 +01:00
David Heinemeier Hansson
652e17f260
Configure Traefik logs and catch all
2023-01-21 12:39:47 +01:00
David Heinemeier Hansson
ff636c3df6
Fix doc line to match new options
2023-01-21 12:39:28 +01:00
David Heinemeier Hansson
885fd5d2c9
Also restrick traefik logs command]
2023-01-21 12:31:55 +01:00
David Heinemeier Hansson
578bf79a7d
Include builder options in to_h
2023-01-21 12:30:36 +01:00
David Heinemeier Hansson
fd23fc1dfd
Ensure env secrets are merged correctly with roles
2023-01-21 11:32:40 +01:00
David Heinemeier Hansson
dda20eec11
Ensure secret envs are present
2023-01-21 10:58:11 +01:00
David Heinemeier Hansson
f6ca864e06
Add secret envs
2023-01-21 10:56:24 +01:00
David Heinemeier Hansson
3bf56c2fdb
Allow custom version to be passed in via CLI
2023-01-20 17:46:09 +01:00
David Heinemeier Hansson
3d66e9ed33
Docs and outdated option
2023-01-20 17:19:37 +01:00
David Heinemeier Hansson
31389bc7b5
Global option for designating primary host only
2023-01-20 17:18:32 +01:00
David Heinemeier Hansson
79b5ed179e
Move hosts/roles specification to cli args instead of ENV
2023-01-20 16:57:25 +01:00
David Heinemeier Hansson
0388495819
Extract capture_with_info
2023-01-20 16:32:12 +01:00
David Heinemeier Hansson
5d629d0600
Extract puts_by_host
2023-01-20 16:27:05 +01:00
David Heinemeier Hansson
73c53dd138
Add command to start a bash session
2023-01-20 15:14:24 +01:00
David Heinemeier Hansson
cdc06dff11
Spacing
2023-01-20 15:04:22 +01:00
David Heinemeier Hansson
95d8e7a75c
All filters are optional
2023-01-20 14:55:28 +01:00
David Heinemeier Hansson
9551837c17
Allow since as an option
...
And properly output/grep logs
2023-01-20 14:48:53 +01:00
David Heinemeier Hansson
5f125f509f
Flat arrays please
2023-01-20 14:40:08 +01:00
David Heinemeier Hansson
435b558260
Extract pipe pattern
2023-01-20 14:38:27 +01:00
David Heinemeier Hansson
ef9259fdd8
Hash uses except not without
2023-01-20 14:37:43 +01:00
David Heinemeier Hansson
af22c32c94
Get the current running container ID
2023-01-20 14:26:07 +01:00
David Heinemeier Hansson
8e69514b78
Actually use the build secrets!
2023-01-20 14:05:31 +01:00
David Heinemeier Hansson
8a32cc9c84
Traefik hosts can now be more than just web
2023-01-20 13:38:57 +01:00
David Heinemeier Hansson
2cb09be0cd
Allow any role to turn on traefik labels
2023-01-20 13:32:12 +01:00
David Heinemeier Hansson
135fcdd9d3
Allow role to set env
2023-01-20 13:26:27 +01:00
David Heinemeier Hansson
c4006ee373
Add comparison to other options
2023-01-20 10:37:39 +01:00
David Heinemeier Hansson
4434b6e09b
Merge pull request #17 from anoldguy/switch-to-docker-secrets
...
Enable docker secrets as a more secure alternative to build args
2023-01-20 10:27:53 +01:00
David Heinemeier Hansson
9bb1fb7166
Move argumentize to Utils
2023-01-20 10:26:36 +01:00
David Heinemeier Hansson
454015b294
Reuse argumentize for build secrets
2023-01-20 10:24:23 +01:00
David Heinemeier Hansson
52fe8d358e
Secrets come just as keys
2023-01-20 10:13:03 +01:00
David Heinemeier Hansson
fe453ed38e
Setup CI
2023-01-20 10:09:37 +01:00
David Heinemeier Hansson
a8779f7055
Simpler API
...
No need for redactions, since values aren't shared.
2023-01-20 10:07:17 +01:00
David Heinemeier Hansson
c16d950136
Refine docs on build secrets
2023-01-20 10:04:34 +01:00
Nathan Anderson
e516f427cd
Enable docker secrets in the builder as a more secure alternative to build args.
2023-01-18 17:35:36 -05:00
David Heinemeier Hansson
84597e2fcd
Damn instance eval
2023-01-17 15:32:36 +01:00
David Heinemeier Hansson
611fbd1dab
Aliases and default
2023-01-17 15:19:02 +01:00
David Heinemeier Hansson
77fc10defb
Default to 1K lines
2023-01-17 15:18:54 +01:00
David Heinemeier Hansson
5d641b932c
Don't repeat the obvious
2023-01-17 15:18:45 +01:00
David Heinemeier Hansson
a342b565e8
Add grep and line configuration to logs
2023-01-17 14:11:27 +01:00
David Heinemeier Hansson
d580630ad2
Docs
2023-01-17 13:58:37 +01:00
David Heinemeier Hansson
7c844bf61d
servers are a must key too
2023-01-17 13:42:24 +01:00
David Heinemeier Hansson
3c6309b4dd
Add option to see combined config
...
Easier to realize how merged configs appear
2023-01-17 13:39:33 +01:00
David Heinemeier Hansson
9a84460754
Add option for two-part configs with the destination option
2023-01-17 13:35:55 +01:00
David Heinemeier Hansson
98af1d3d96
Naming
2023-01-17 13:34:59 +01:00
David Heinemeier Hansson
668b4060cb
Move tests into directory
2023-01-17 12:18:32 +01:00
David Heinemeier Hansson
cb26fb9dca
Run update as well before install (as some servers dont have it available otherwise)
2023-01-16 19:06:00 +01:00
David Heinemeier Hansson
9833a41382
Not interactive
2023-01-15 13:52:37 +01:00
David Heinemeier Hansson
8e58a9385a
Allow exec to run in its own container
2023-01-15 13:51:08 +01:00
David Heinemeier Hansson
89161b66a1
Use delegation for shorter access
2023-01-15 13:50:38 +01:00
David Heinemeier Hansson
8fac321973
Forgot a spot
2023-01-15 13:24:47 +01:00
David Heinemeier Hansson
b96d760b9b
Add the utils
2023-01-15 13:23:20 +01:00
David Heinemeier Hansson
760a87fe06
Redact build args (since they are often tokens)
2023-01-15 13:15:14 +01:00
David Heinemeier Hansson
bb8a8d3399
Singular form
2023-01-15 12:31:10 +01:00
David Heinemeier Hansson
2a0bcaf776
Shouldn't recommend embedding actual tokens in the config
2023-01-15 10:36:04 +01:00
David Heinemeier Hansson
bafbde52fe
Add build args
2023-01-15 10:35:17 +01:00
David Heinemeier Hansson
53cd13a0fa
Update README.md
2023-01-14 16:28:14 +01:00
David Heinemeier Hansson
15b0cc1df3
Check for remote/local
2023-01-14 13:07:22 +01:00
David Heinemeier Hansson
3c42d73ea7
Catch registry credentials errors nicer
2023-01-14 13:07:14 +01:00
David Heinemeier Hansson
f32ae43138
Bump version for 0.1.0
2023-01-14 12:35:17 +01:00
David Heinemeier Hansson
c3d2888c51
Update summary
2023-01-14 12:34:56 +01:00
David Heinemeier Hansson
6d1a166fdc
Simplify
2023-01-14 12:33:05 +01:00
David Heinemeier Hansson
59be40cf12
Merge pull request #12 from rails/convert-to-thor
...
Switch to proper standalone executable with Thor
2023-01-14 12:28:24 +01:00
David Heinemeier Hansson
78494bdb0f
Just rely on ENV for now
2023-01-14 12:27:38 +01:00
David Heinemeier Hansson
cce3d9ccfb
Fix rollback
2023-01-14 12:23:34 +01:00
David Heinemeier Hansson
f0a3466d9d
Rollback is clearer
2023-01-14 12:23:30 +01:00
David Heinemeier Hansson
e19e7f9bde
Explicitly trying to start a specific version should fail if it can't
2023-01-14 12:23:22 +01:00
David Heinemeier Hansson
0b7af9ac14
Simplify
2023-01-14 12:17:04 +01:00
David Heinemeier Hansson
4551a2b9d7
Always try to log the command we're running remotely
2023-01-14 12:13:31 +01:00
David Heinemeier Hansson
e78da2a925
Update README to match new exec approach
2023-01-14 12:09:09 +01:00
David Heinemeier Hansson
94b3cfd0f4
Ship is cuter, but deploy is clearer
...
Kill your darlings
2023-01-14 12:07:52 +01:00
David Heinemeier Hansson
e3c1992ae9
Move HOST option to real option
2023-01-14 12:04:41 +01:00
David Heinemeier Hansson
ec31e931bf
Add version task
2023-01-14 11:51:46 +01:00
David Heinemeier Hansson
e1e768d7cf
Log traefik details commands
2023-01-14 11:51:38 +01:00
David Heinemeier Hansson
c44e224587
Add option to skip binstubs for older apps
2023-01-14 11:44:16 +01:00
David Heinemeier Hansson
fed64ef244
Switch to proper standalone executable with Thor
2023-01-14 11:31:37 +01:00
David Heinemeier Hansson
bf98a0308c
Namespace buildx and contexts
...
To prevent clashes on remote builders
2023-01-13 17:29:53 +01:00
David Heinemeier Hansson
5179d0db37
Go with ship and make it the default
2023-01-13 17:12:46 +01:00
David Heinemeier Hansson
100d68d67e
Only install docker if missing
2023-01-13 17:11:01 +01:00
David Heinemeier Hansson
eed8165ec1
Not worth the log noise
2023-01-13 15:44:56 +01:00
David Heinemeier Hansson
be89077917
Bump version for 0.0.3
2023-01-13 10:42:19 +01:00
David Heinemeier Hansson
6bfcc582c8
Singular
2023-01-13 10:30:02 +01:00
David Heinemeier Hansson
fd5172266e
More expansive info on builder
2023-01-13 10:28:46 +01:00
David Heinemeier Hansson
e85c8161df
Style
2023-01-13 10:28:35 +01:00
David Heinemeier Hansson
a1fc01639e
Add build:info to check builder
2023-01-13 10:24:23 +01:00
David Heinemeier Hansson
7e764cbcd9
Explain how to use native builder
2023-01-13 10:18:42 +01:00
David Heinemeier Hansson
f177ee4cfe
Make remote builder quack as any other builder
2023-01-13 10:16:28 +01:00
David Heinemeier Hansson
ea9a50ec95
Extract command #combine
2023-01-13 10:00:11 +01:00
David Heinemeier Hansson
6ea06fd04e
Log the builder used
2023-01-13 09:49:06 +01:00
David Heinemeier Hansson
6ccb3d2319
Allow for fully native builds too
...
Skipping multiarch if there's a platform match between dev and prod.
2023-01-13 09:31:47 +01:00
David Heinemeier Hansson
05f1ef5ee8
Registry login actually not necessary
2023-01-12 22:22:22 +01:00
David Heinemeier Hansson
f1a98457b0
Pin platforms
2023-01-12 22:14:05 +01:00
David Heinemeier Hansson
7ae596ef60
Document remote native builds
2023-01-12 21:45:45 +01:00
David Heinemeier Hansson
2257c99189
Add local/remote builder combo for multiarch
2023-01-12 21:35:31 +01:00
David Heinemeier Hansson
5afadb10ca
Nicer name for CLI
2023-01-12 18:50:18 +01:00
David Heinemeier Hansson
b3992973d6
Extract builder from app
...
Building is different from running
2023-01-12 18:16:52 +01:00
David Heinemeier Hansson
08c30a14b9
Use a single builder for MRSK
2023-01-12 18:08:33 +01:00
David Heinemeier Hansson
76d34d2a1c
Note quoting issue
2023-01-12 17:42:49 +01:00
David Heinemeier Hansson
184ab18667
Style
2023-01-12 17:38:26 +01:00
David Heinemeier Hansson
87abf06076
Note on exception seen
2023-01-12 17:37:57 +01:00
David Heinemeier Hansson
453570b895
Breakout remove so we can do just containers
2023-01-12 17:37:50 +01:00
David Heinemeier Hansson
f61beb6827
Basic binstub
2023-01-12 17:29:26 +01:00
David Heinemeier Hansson
c481938cdb
Reference Traefik docs for more routing rules
2023-01-12 17:16:30 +01:00
David Heinemeier Hansson
7e9b73f86a
Add custom labels
2023-01-12 17:15:29 +01:00
David Heinemeier Hansson
1f06b1ff94
Switch to just last 100 log lines for now
2023-01-12 16:00:21 +01:00
David Heinemeier Hansson
d554ae8500
Add back prune
2023-01-12 15:51:01 +01:00
David Heinemeier Hansson
730de486b7
More doc changes
2023-01-12 15:29:56 +01:00
David Heinemeier Hansson
b333c4a05b
Simplify presentation of configuration
2023-01-12 15:22:48 +01:00
David Heinemeier Hansson
eec6670dbf
Tokens are good too
2023-01-12 15:16:29 +01:00
David Heinemeier Hansson
4aa96d6578
Switch to a Commander base to allow lazy loading config
2023-01-12 14:58:17 +01:00
David Heinemeier Hansson
d3ab10be22
Better require setup
2023-01-12 14:57:34 +01:00
David Heinemeier Hansson
d92318e234
Excess line
2023-01-11 17:58:50 +01:00
David Heinemeier Hansson
e62610069b
Correct commadn
2023-01-11 17:46:35 +01:00
David Heinemeier Hansson
a0582c1bdf
Explain registry
2023-01-11 17:46:00 +01:00
David Heinemeier Hansson
880ce46c39
Match service name
2023-01-11 17:44:26 +01:00
David Heinemeier Hansson
d049d73547
Realistic looking IP
2023-01-11 17:43:36 +01:00
David Heinemeier Hansson
453fea6c45
Don't rely on ERB interpolation that might fail
...
Error message isn't good
2023-01-11 17:43:28 +01:00
David Heinemeier Hansson
2694cf5d5f
Make init more resilient and communicative
2023-01-11 17:43:07 +01:00
David Heinemeier Hansson
5324fbe3d0
Give feedback on what happened
2023-01-11 17:35:53 +01:00
David Heinemeier Hansson
5e214cde3c
Explain where to set this
2023-01-11 17:35:46 +01:00
David Heinemeier Hansson
f61f41ad73
Document app console
2023-01-11 17:28:18 +01:00
David Heinemeier Hansson
d9cdbb87f9
Heads up that this could take a while
2023-01-11 17:26:49 +01:00
David Heinemeier Hansson
543af475d5
Create missing buildx builder if missing automatically
2023-01-11 17:24:32 +01:00
David Heinemeier Hansson
1bb9fe9095
Reuse existing exec command
2023-01-11 17:11:57 +01:00
David Heinemeier Hansson
c6fd4399f1
Hint at which version to start
2023-01-11 17:07:34 +01:00
David Heinemeier Hansson
a4a9f619ad
Protect against missing envs
2023-01-11 17:07:22 +01:00
David Heinemeier Hansson
4392bf0ee9
Allow you to turn full verbosity on easily
2023-01-11 17:05:20 +01:00
David Heinemeier Hansson
3b3ab48120
Set a different verbosity level for the duration of the yield
2023-01-11 17:01:19 +01:00
David Heinemeier Hansson
606550d46b
Reveal what was pruned
2023-01-11 17:01:12 +01:00
David Heinemeier Hansson
e1b327915f
Use error logger instead
2023-01-11 17:01:03 +01:00
David Heinemeier Hansson
9d3871d667
Split out proper Prune command
2023-01-11 16:48:10 +01:00
David Heinemeier Hansson
7d83be2d18
Readability
2023-01-11 16:26:26 +01:00
David Heinemeier Hansson
3e2c48782c
Explaining consts
2023-01-11 13:31:25 +01:00
David Heinemeier Hansson
bcdeeff94f
Start remote Rails console on primary host
2023-01-10 20:45:15 +01:00
David Heinemeier Hansson
c5249b4a9e
Host yield not needed
2023-01-10 20:44:54 +01:00
David Heinemeier Hansson
57e49bb26c
Bump version for 0.0.2
2023-01-10 19:16:34 +01:00
David Heinemeier Hansson
1609b43ef8
Temporary fix for #2
2023-01-10 19:15:40 +01:00
David Heinemeier Hansson
f9010c1b75
Only run Traefik on web role
2023-01-10 19:04:35 +01:00
David Heinemeier Hansson
73b7c691d6
Fix references
2023-01-10 18:56:30 +01:00
David Heinemeier Hansson
3473ec7a86
Explain running job servers separately
2023-01-10 17:31:36 +01:00
David Heinemeier Hansson
e8beb362d0
Add role concern with specialized cmds for job running
2023-01-10 17:27:56 +01:00
David Heinemeier Hansson
1cee87d440
Latest bundler
2023-01-10 15:02:25 +01:00
David Heinemeier Hansson
c2e09b9b2f
Added debug
2023-01-10 14:24:25 +01:00
David Heinemeier Hansson
78a5d08d3f
Switch to host naming
...
Servers concept will encompass custom cmd and labels. Host is just the IP address.
2023-01-10 14:15:16 +01:00
David Heinemeier Hansson
5ca6f32ee7
Use debug gem
2023-01-10 13:17:28 +01:00
David Heinemeier Hansson
6b098a1e2e
Ruby 3.2.0 compatibility
2023-01-10 13:17:18 +01:00
David Heinemeier Hansson
ff5ccac8fe
Cleanup
2023-01-09 20:44:54 +01:00
David Heinemeier Hansson
b4edf8eef9
Ignore nil command bits
...
They might come from conditional options
2023-01-09 18:08:34 +01:00
David Heinemeier Hansson
fe52ce6547
Add command execution
2023-01-09 14:36:33 +01:00
David Heinemeier Hansson
9641ce0edd
Update README.md
2023-01-08 18:38:55 +01:00
David Heinemeier Hansson
1dab9c1fb5
More documentation
2023-01-08 16:50:06 +01:00
David Heinemeier Hansson
10d973200d
Add command to list containers (to ease rollback)
2023-01-08 16:45:41 +01:00
David Heinemeier Hansson
fdfdff65e9
Explain command map overwrite
2023-01-08 16:33:09 +01:00
David Heinemeier Hansson
94d61f3d9a
Proper param array separation
2023-01-08 16:32:31 +01:00
David Heinemeier Hansson
483f686efc
Test config labels
2023-01-08 16:29:59 +01:00
David Heinemeier Hansson
51adbc032e
Test app#run
2023-01-08 16:29:51 +01:00
David Heinemeier Hansson
dcb3e4d491
Switch envs and labels to param array
2023-01-08 16:29:44 +01:00
David Heinemeier Hansson
55445ae110
Style
2023-01-08 16:22:50 +01:00
David Heinemeier Hansson
998525c93d
Switch to cmd array so we can redact
2023-01-08 16:20:06 +01:00
David Heinemeier Hansson
4ec04f8959
Language
2023-01-08 15:13:51 +01:00
David Heinemeier Hansson
3ddf2b9c41
Distinguish run from start
2023-01-08 15:13:45 +01:00
David Heinemeier Hansson
d4210b66d0
Language
2023-01-08 15:13:28 +01:00
David Heinemeier Hansson
7f37abac59
If already started, just carry on
2023-01-08 15:13:24 +01:00
David Heinemeier Hansson
399d32d7d0
Known VERSION means we've already pushed
2023-01-08 15:13:14 +01:00
David Heinemeier Hansson
8d16271150
Make run resilient to same version having already been run
2023-01-08 15:13:03 +01:00
David Heinemeier Hansson
e1724e0cd9
Clarify output
2023-01-08 14:55:51 +01:00
David Heinemeier Hansson
43eac9d414
Use DRY extraction
2023-01-08 14:55:14 +01:00
David Heinemeier Hansson
ffb532a50d
Add remove tasks to clean up
2023-01-08 14:55:06 +01:00
David Heinemeier Hansson
23c2cb898c
Explain need to match with Dockerfile LABEL
2023-01-08 14:38:03 +01:00
David Heinemeier Hansson
14867a2f61
Allow logging out of registry
2023-01-08 14:18:00 +01:00
David Heinemeier Hansson
4b46449fdf
Split out repository to be used alone
2023-01-08 14:07:29 +01:00
David Heinemeier Hansson
87ca059f32
Fix dangling parenthesis
2023-01-08 14:07:08 +01:00
David Heinemeier Hansson
1fcc2d3cfd
Remember to use Shellwords later
2023-01-08 13:39:38 +01:00
David Heinemeier Hansson
d43ceb975f
Create config stub with mrsk:init
2023-01-08 13:39:29 +01:00
David Heinemeier Hansson
4f06b5f99b
Clarify that one server needn't an LB
2023-01-08 12:14:46 +01:00
David Heinemeier Hansson
21df2aefe5
Prune containers first to release images
2023-01-08 12:13:19 +01:00
David Heinemeier Hansson
5979f1d43e
Prune by default after deploy
2023-01-08 12:11:44 +01:00
David Heinemeier Hansson
9e7ce59b85
Use a shared prune
2023-01-08 12:08:28 +01:00
David Heinemeier Hansson
6e853786eb
Prepare for auto-pruning
2023-01-08 11:54:43 +01:00
David Heinemeier Hansson
e378e9a6dd
Not used
2023-01-08 11:54:32 +01:00
David Heinemeier Hansson
6c3a4b1792
Explain rollback
2023-01-08 11:47:04 +01:00
David Heinemeier Hansson
73019bedfb
Keep containers around for quick rollback + restarting
...
Now need to deal with pruning.
2023-01-08 11:45:48 +01:00
David Heinemeier Hansson
e8fc046537
Update README.md
2023-01-08 11:33:09 +01:00
David Heinemeier Hansson
a45a40b996
Done
2023-01-08 11:29:55 +01:00
David Heinemeier Hansson
3cad095e2b
Add ERB eval so we can use credentials
2023-01-08 11:11:57 +01:00
David Heinemeier Hansson
cc3619173d
Split out push/pull and aggregate in deliver
2023-01-08 10:07:32 +01:00
David Heinemeier Hansson
ddb4d549f2
Need setup
2023-01-08 10:07:13 +01:00
David Heinemeier Hansson
7f220ea987
Bootstrap entirely clean new server
2023-01-08 10:07:08 +01:00
David Heinemeier Hansson
4cbc4aa9b7
Update README.md
2023-01-08 09:37:12 +01:00
David Heinemeier Hansson
9c6cd33dec
Ensure we're logged in
2023-01-08 09:35:55 +01:00
David Heinemeier Hansson
ef87cd5634
Explain registry configuration
2023-01-08 09:35:45 +01:00
David Heinemeier Hansson
9d9a9c4116
Only need absolute_image
2023-01-07 22:02:28 +01:00