Commit Graph

309 Commits

Author SHA1 Message Date
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
2xsaiko
a5619f5660
Build every profile first, then push (#158)
Try to build everything first before pushing to remotes. Since the build
is more likely to fail than the upload, if there is an error the deployment
will fail sooner and before uploading any potentially unusable configuration.
2022-12-29 19:19:59 +04:00
serokell-bot
351352374c
Automatically update flake.lock to the latest version (#152)
flake-compat 64a525ee38 (2022-03-25) -> 009399224d (2022-11-17)
nixpkgs      30d3d79b7d (2022-03-25) -> bb31220cca (2022-12-19)
utils        0f8662f131 (2022-03-26) -> 5aed5285a9 (2022-11-02)

Co-authored-by: Flake Update Bot <operations+update@serokell.io>
Co-authored-by: Alexander Bantyev <balsoft@balsoft.ru>
2022-12-29 18:48:32 +04:00
Alexander Bantyev
3878dd40f6
Merge pull request #176 from Ma27/activate-boot
Add new activation strategy `boot` as equivalent to `nixos-rebuild boot`
2022-12-29 18:25:47 +04:00
Philipp Herzog
2a3c5f70ee
Merge pull request #175 from serokell/philtaken/remote-building
Add option to build on the target host
2022-11-18 19:46:37 +01:00
Philipp Herzog
d0c8665042
Add option to build on the remote host 2022-11-18 13:41:54 +01:00
Philipp Herzog
be40823735
Merge pull request #182 from serokell/philtaken/checks-unique-names
More unique names for the checks generated by deploy-rs
2022-11-14 20:23:26 +01:00
Philipp Herzog
38d9005a73
More unique names for the checks generated by deploy-rs
Closes #162
2022-11-11 14:03:07 +01:00
Philipp Herzog
b011f13bc5
Merge pull request #181 from serokell/philtaken/rollback_exit_code
Introduce non-zero exit code for rollbacks
2022-11-11 12:29:23 +01:00
Philipp Herzog
28961e2c2d
Introduce non-zero exit code for rollbacks
Closes #179
2022-11-11 12:20:54 +01:00
Maximilian Bosch
068372aad1
Add new activation strategy boot as equivalent to nixos-rebuild boot
This can be useful when e.g. deploying a kernel update to a target host.
You usually plan a reboot (or kexec) after that to activate the new
kernel. However you don't want to wait for services to be restarted
first since these will be "restarted" anyways on the reboot. In cases
like GitLab or the Atlassian stack this actually makes a difference.

This patch changes the following things:

* If `--boot` is provided, `nix-env -p profile-to-activate --set` is
  called for each deployed profile to make sure that it is activated
  automatically after a reboot.

* However, the actual activation (e.g. `switch-to-configuration switch`)
  is skipped. Instead:

  * For NixOS, `switch-to-configuration boot` is called to set the new
    profile as default in the bootloader.

  * For everything else, nothing else is done. The profile is already
    the new default (and thus picked up on the next boot).
2022-10-09 18:47:08 +02:00
Alexander Bantyev
41f15759dd
Merge pull request #168 from rycee/runCommand
Replace runCommandNoCC by runCommand
2022-08-05 22:50:33 +04:00