Commit Graph

320 Commits

Author SHA1 Message Date
Philipp Herzog
e7638a7867
better error messages: provide node names
printing what node caused an error is very useful for debugging
build or deployment failures, especially when deploying to several
nodes at the same time
2024-06-10 17:42:53 +02:00
Roman Melnikov
9c3147639c
Merge pull request #277 from Anillc/patch-1
allow --ssh-opts starts with hyphen
2024-06-10 13:48:08 +02:00
Anillc
20261c6428
add test for allow_hyphen_values of --ssh-opts 2024-06-10 19:43:52 +08:00
Roman Melnikov
5b5ebfa497
Merge pull request #276 from emanueljg/patch-1
Link to new official wiki
2024-06-10 13:26:17 +02:00
Anillc
ddf42d7238
allow --ssh-opts that starts with hyphen 2024-06-10 18:59:45 +08:00
Emanuel Johnson Godin
e818923223
Link to new official wiki 2024-06-08 12:59:51 +02:00
Ivar Larsson
b3ea6f333f
Update example to make it work (#247) 2024-05-14 17:16:12 +02:00
Sereja313
88b3059b02
Merge pull request #268 from serokell/sereja/fix-overlay
[Chore] Fix overlay
2024-04-01 15:18:25 +03:00
Sergey Gulin
f10a3aa17c
[Chore] Fix overlay
Problem: In my recent PR(#264), I accidentally picked overlay output
changes from the philtaken/nixos-vm-tests branch, which broke existing
overlay imports after updating the deploy-rs input.

Solution: Add backwards compatibility so that users don't have to make
changes to their nix flakes.
2024-04-01 15:02:55 +03:00
Sereja313
2bad21828e
Merge pull request #264 from serokell/sereja/OPS-1384-add-nixos-vm-test
[OPS-1384] Introduce NixOS VM tests
2024-03-29 20:29:42 +03:00
Sergey Gulin
a928352641
[OPS-1384] Introduce NixOS VM tests
Problem: Currently, the only way to test deploy-rs deployments is to
actually do a deployment to an existing NixOS instance (either in VM,
or a real machine) manually. This is a bit inconvenient and one can
forget to test changes when developing/reviewing deploy-rs changes.

Solution: Add NixOS VM tests.
2024-03-29 20:25:47 +03:00
Roman Melnikov
0a0187794a
Merge pull request #257 from n-hass/feature/interactive-sudo
Add support for entering sudo password interactively
2024-02-16 14:49:44 +01:00
Nick Hassan
5f694ef481
add support for entering password for sudo 2024-02-16 23:21:25 +10:30
Roman Melnikov
1776009f1f
Merge pull request #252 from SuperSandro2000/patch-1
Remove note about unstable nix version
2024-01-10 09:33:11 +01:00
Sandro
3f91911972
Remove note about unstable nix version
The current stable nix version supports flakes.
2024-01-09 22:51:41 +01:00
Roman Melnikov
b709d63deb
Merge pull request #251 from serokell/rvem/add-missing-activation-timeout-documentation
[Chore] Add missing documentation for timeout options
2023-12-20 16:49:20 +01:00
Roman Melnikov
56ba8c3929
[Chore] Add missing documentation for timeout options
Problem: README misses documentation for 'confirmTimeout' and
'activationTimeout'.

Solution: Mention them in README.
2023-12-20 13:55:53 +01:00
Roman Melnikov
915327515f
Merge pull request #189 from serokell/automatic-update
Automatically update flake.lock to the latest version
2023-12-13 10:41:29 +01:00
Flake Update Bot
6d70659c84
Automatically update flake.lock to the latest version
flake-compat 009399224d (2022-11-17) -> 0f9255e01c (2023-10-04)
nixpkgs      bb31220cca (2022-12-19) -> e97b3e4186 (2023-12-11)
utils        5aed5285a9 (2022-11-02) -> 4022d587cb (2023-12-04)
2023-12-12 15:50:43 +00:00
Roman Melnikov
2ccd5d9939
Merge pull request #248 from serokell/update-checkout-action
[Chore] Update "actions/checkout"
2023-12-12 11:53:43 +01:00
Roman Melnikov
99664561ec
[Chore] Update "actions/checkout"
Problem: node16 is now deprecated and github-runner provided by nixpkgs
no longer supports this runtime. However, "actions/checkout@v3" uses
this runtime.

Solution: Update CI pipeline to use "actions/checkout@v4".
2023-12-12 11:48:45 +01:00
Roman Melnikov
514fa3bc3d
Merge pull request #246 from serokell/rvem/#245-return-non-zero-exit-code-for-confirmation-timeout
[#245] Return non-zero exit code in case of confirmation timeout
2023-12-11 14:46:29 +01:00
Roman Melnikov
b076e35c4a
[#245] Return non-zero exit code in case of confirmation timeout
Problem: When profile activation confirmation fails due to
confirmation timeout and performs a rollback, zero exit code is
returned. Such a behavior is confusing since rollback usually means
something went wrong during deployment and it shouldn't return
successful exit code.

Solution: Explicitly return confirmation waiting error instead of
printing it and silently signalizing success.
2023-12-11 14:42:55 +01:00
Roman Melnikov
660180bbbe
Merge pull request #240 from serokell/rvem/make-wait-activation-timeout-configurable
[Chore] Make activation wait timeout configurable
2023-11-02 11:37:22 +01:00
Roman Melnikov
50d640f403
fixup! [Chore] Make activation wait timeout configurable 2023-11-02 11:29:53 +01:00
Roman Melnikov
aeeee3c1e3
[Chore] Make activation wait timeout configurable
Problem: Currently profile activation waiting timeout is hardcoded to
240 seconds, see https://github.com/serokell/deploy-rs/pull/48.
In some cases, this timeout can be exceeded (e.g.
activation performs a heavy DB migration and waits for it to finish
before considering the profile activation succesful).

Solution: Make this timeout configurable via 'activationTimeout' deploy
attribute or corresponding '--activation-timeout' CLI option. For the
sake of backward compatibility, the new 'wait' subcommand
'--activation-timeout' option is made optional and defaults to 240
seconds if it wasn't provided.
2023-11-02 11:29:52 +01:00
Roman Melnikov
d507370803
Merge pull request #242 from serokell/phil/fix-rollback-error-message
[Chore] fix error messages claiming to have rolled back when not actually doing so
2023-11-02 11:21:55 +01:00
Philipp Herzog
6f77c65c25
[Chore] fix error messages claiming to have rolled back when not actually doing so
closes: #241
2023-11-02 09:25:24 +01:00
Roman Melnikov
e3f4183268
Merge pull request #236 from serokell/rvem/run-ci-on-pull_request
[Chore] Run CI checks on 'pull_request'
2023-09-18 18:01:06 +02:00
Roman Melnikov
5617d39d3a
[Chore] Run CI checks on 'pull_request'
Problem: We want to be able to run CI checks on PRs from external forks.
However, this is only possible with 'on: pull_request', while currently
CI is triggered 'on: push'

Solution: Change CI triggering condition to 'on: pull_request'.
2023-09-18 12:40:24 +02:00
Roman Melnikov
57d5071e60
Merge pull request #234 from fd/master
Replace jsonschema-cli with check-jsonschema
2023-09-18 11:24:41 +02:00
Simon Menke
b5625de9c9
Replace jsonschema-cli with check-jsonschema
jsonschema-cli is deprecated and will be removed in the future.
The recommended replacement is check-jsonschema.
2023-09-17 10:34:25 +02:00
Roman Melnikov
31c32fb295
Merge pull request #231 from serokell/rvem/#201-dont-hardcode-profile-directory
[#201] Deduce profile directory during activation
2023-09-12 12:15:07 +02:00
Roman Melnikov
f26e888c41
[#201] Deduce profile directory during activation
Problem: Since https://github.com/NixOS/nix/pull/5226 nix profiles for
users are stored in 'XDG_STATE_HOME' or 'HOME' directory. However,
'deploy-rs' still expects profiles to be present in
'/nix/var/nix/profiles/per-user'. As a result, an attempt to deploy a
profile with newer nix may fail with an error about non-existing files.

Solution: Instead of deducing the profile path prior to ssh'ing and
actual activation, deduce the path to the profile during as a part of
'activate-rs' invocation.

Now if the profile path is not specified explicitly as an attribute in
profile within the deploy flake, the path to the profile is determined
based on the user to which the profile belongs and on the values of
'XDG_STATE_HOME' and 'HOME' variables.
Additionally, if the old profile directory (in
'/nix/var/nix/profiles/per-user') for a given user already exists, it is
used instead for the sake of backward compatibility.
2023-09-12 12:00:17 +02:00
Derek Mahar
d0cfc042eb
Update README.md (#227)
Replace "eachother" with "each other".
2023-09-08 09:34:30 +02:00
Roman Melnikov
724463b5a9
Merge pull request #218 from faithanalog/master
actually merge confirm_timeout into merged_settings
2023-06-14 14:52:03 +02:00
Artemis Everfree
f28f8c6063 actually merge confirm_timeout into merged_settings 2023-06-08 01:33:01 -07:00
Roman Melnikov
65211db63b
Merge pull request #213 from serokell/rvem/darwin-activation
[#210] Add activation script for darwin system and provide a usage example
2023-06-05 14:59:10 +08:00
Roman Melnikov
8ef5b948e3
fixup! [#210] Add activation script for darwin system and provide a usage example 2023-05-12 10:59:19 +08:00
Roman Melnikov
f406295680
[#210] Add activation script for darwin system and provide a usage example
Problem: It's possible to use 'deploy-rs' for deploying 'darwinSystem'
configuration from 'nix-darwin' to a darwin system. However, there is no
dedicated activatiot script for darwin and thus one has to come up with
'custom' activation script.

Solution:
1) Add 'darwin' attribute to 'lib.activate' that provides a script that
   should be used to activate 'darwinSystem' config with 'deploy-rs'.
2) Add a new 'examples/darwin' example that provides simple flake for
   deploying configuration to a darwin target.
2023-05-11 16:02:01 +08:00
Roman Melnikov
c801899170
Merge pull request #207 from Flakebi/nixpkgs-cache
Make it possible to not rebuild deploy-rs
2023-05-11 12:37:24 +08:00
Roman Melnikov
64160276cd
Merge pull request #203 from serokell/rvem/#202-add-workaround-for-derivations-store-paths-interpolation
[#202] Provide '^out' suffix for deriver on newer nix
2023-05-08 11:05:03 +08:00
Roman Melnikov
c17d71fadf
fixup! [#202] Provide '^out' suffix for deriver on newer nix 2023-05-05 15:04:26 +08:00
Roman Melnikov
e3bc066bd8
[#202] Provide '^out' suffix for deriver on newer nix
Problem: Since 2.15 nix no longer reference '.drv' as derivation
outputs. At the same time, nix before '2.13' doesn't support '.drv'
special suffix handling.

Solution: Provide '^out' suffix for the profile deriver in case
'nix path-info <...>.drv' returns the same '<...>.drv' path.
In other cases either an error about the build result not being present
in the /nix/store is returned or an actual build result path is
returned.
2023-05-05 14:57:31 +08:00
Roman Melnikov
6b0b6a1c25
Merge pull request #205 from serokell/rvem/improve-temp-path-handling
[Chore] Handle 'temp_path' as an actual 'Path' instead of 'String'
2023-05-05 10:53:03 +08:00
Roman Melnikov
c2ea4e642d
Merge pull request #198 from serokell/rvem/#197-fix-options-handling-with-remote-build
[#197] Fix hostname overriding for remote builds
2023-04-21 15:54:10 +08:00
Roman Melnikov
784e9ee24d
[Chore] Handle 'temp_path' as an actual 'Path' instead of 'String'
Problem: 'temp_path' and 'lock_path' are handled as 'String'.
This can be a problem when the 'temp_path' directory is a symlink
on the target system, e.g. this is the case with the default
'/tmp' and macOS, where this directory is actually a symlink to '/private/tmp'.

Solution: Handle 'temp_path' and 'lock_path' as actual Paths.
Also, canonicalize 'temp_path' to avoid canary file path mismatches when checking
filesystem events.

As a side effect, also update the 'notify' dependency to the latest stable version.
2023-04-20 15:13:13 +08:00
Flakebi
03b02d2097
Make it possible to not rebuild deploy-rs
Use the deploy-rs from the final packages set. This can avoid rebuilding
deploy-rs when using it in a nixos config. It can use the version cached
in nixpkgs.

Also add instructions to the readme on how to craft an overlay that uses
nixpkgs deploy-rs.
2023-04-16 16:38:12 +02:00
Roman Melnikov
55aac55cfa
[#197] Fix hostname overriding for remote builds
Problem: '--hostname' is ignored when used with '--remote-build'.

Solution: Account for 'data.deploy_data.cmd_overrides.hostname' when
building a profile remotely.
2023-04-14 13:44:09 +08:00
Philipp Herzog
8c9ea9605e
Switch from buildkite CI to github-actions (#190) 2023-01-19 12:16:57 +01:00