<feed xmlns='http://www.w3.org/2005/Atom'>
<title>deploy-rs/src/bin, branch nom-flag</title>
<subtitle>forked from https://github.com/serokell/deploy-rs/
</subtitle>
<link rel='alternate' type='text/html' href='https://stuebinm.eu/git/deploy-rs/'/>
<entry>
<title>[#245] Return non-zero exit code in case of confirmation timeout</title>
<updated>2023-12-11T13:42:55+00:00</updated>
<author>
<name>Roman Melnikov</name>
</author>
<published>2023-12-08T13:26:33+00:00</published>
<link rel='alternate' type='text/html' href='https://stuebinm.eu/git/deploy-rs/commit/?id=b076e35c4ac157110b894032fe3155172668cdd8'/>
<id>b076e35c4ac157110b894032fe3155172668cdd8</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
<entry>
<title>[Chore] Make activation wait timeout configurable</title>
<updated>2023-11-02T10:29:52+00:00</updated>
<author>
<name>Roman Melnikov</name>
</author>
<published>2023-11-01T11:42:30+00:00</published>
<link rel='alternate' type='text/html' href='https://stuebinm.eu/git/deploy-rs/commit/?id=aeeee3c1e3e9bfc38462cb315b6e19ee9fe6db70'/>
<id>aeeee3c1e3e9bfc38462cb315b6e19ee9fe6db70</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
<entry>
<title>[#201] Deduce profile directory during activation</title>
<updated>2023-09-12T10:00:17+00:00</updated>
<author>
<name>Roman Melnikov</name>
</author>
<published>2023-09-06T12:54:22+00:00</published>
<link rel='alternate' type='text/html' href='https://stuebinm.eu/git/deploy-rs/commit/?id=f26e888c41d28107de9dbc5b4e1553c1dfcf83db'/>
<id>f26e888c41d28107de9dbc5b4e1553c1dfcf83db</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
<entry>
<title>[Chore] Handle 'temp_path' as an actual 'Path' instead of 'String'</title>
<updated>2023-04-20T07:13:13+00:00</updated>
<author>
<name>Roman Melnikov</name>
</author>
<published>2023-04-19T09:46:43+00:00</published>
<link rel='alternate' type='text/html' href='https://stuebinm.eu/git/deploy-rs/commit/?id=784e9ee24d977c99dcb5ba5aef81dae48cb899fb'/>
<id>784e9ee24d977c99dcb5ba5aef81dae48cb899fb</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
<entry>
<title>Add new activation strategy `boot` as equivalent to `nixos-rebuild boot`</title>
<updated>2022-10-09T16:47:08+00:00</updated>
<author>
<name>Maximilian Bosch</name>
</author>
<published>2022-10-09T16:37:10+00:00</published>
<link rel='alternate' type='text/html' href='https://stuebinm.eu/git/deploy-rs/commit/?id=068372aad18f04122bbdb836e36c655c157ebe71'/>
<id>068372aad18f04122bbdb836e36c655c157ebe71</id>
<content type='text'>
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).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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).
</pre>
</div>
</content>
</entry>
<entry>
<title>General code cleanup</title>
<updated>2021-08-12T07:18:06+00:00</updated>
<author>
<name>notgne2</name>
</author>
<published>2021-08-04T08:04:23+00:00</published>
<link rel='alternate' type='text/html' href='https://stuebinm.eu/git/deploy-rs/commit/?id=e5546f9c2503c26d175f08a81fc0a0f330be4cbe'/>
<id>e5546f9c2503c26d175f08a81fc0a0f330be4cbe</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>optionally take args as input</title>
<updated>2021-07-30T00:17:53+00:00</updated>
<author>
<name>Timothy DeHerrera</name>
</author>
<published>2021-07-15T16:44:40+00:00</published>
<link rel='alternate' type='text/html' href='https://stuebinm.eu/git/deploy-rs/commit/?id=8a27483dce6490eae77b5064a632a91b68c2d10c'/>
<id>8a27483dce6490eae77b5064a632a91b68c2d10c</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>export cli run in lib</title>
<updated>2021-07-14T21:21:56+00:00</updated>
<author>
<name>Timothy DeHerrera</name>
</author>
<published>2021-07-14T21:21:29+00:00</published>
<link rel='alternate' type='text/html' href='https://stuebinm.eu/git/deploy-rs/commit/?id=3c4d7d53d0e5cc16f3ea19ce5856406aa88ec878'/>
<id>3c4d7d53d0e5cc16f3ea19ce5856406aa88ec878</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Cargo fmt</title>
<updated>2021-06-22T11:57:50+00:00</updated>
<author>
<name>Alexander Bantyev</name>
</author>
<published>2021-06-22T11:57:50+00:00</published>
<link rel='alternate' type='text/html' href='https://stuebinm.eu/git/deploy-rs/commit/?id=1d88b8409ed24efd52889c73a0938a2ab29d3022'/>
<id>1d88b8409ed24efd52889c73a0938a2ab29d3022</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Add multi node support</title>
<updated>2021-06-22T11:41:15+00:00</updated>
<author>
<name>Yannik Sander</name>
</author>
<published>2021-03-30T15:32:58+00:00</published>
<link rel='alternate' type='text/html' href='https://stuebinm.eu/git/deploy-rs/commit/?id=1a2d35be27de412bd2c406ed01189dc93ae0985a'/>
<id>1a2d35be27de412bd2c406ed01189dc93ae0985a</id>
<content type='text'>
Run multiple deployments in sequence

Resolve targets later

Extend context by deployed flake

Apply clippy suggestions

Add revoke command builder

Track succeeded deploys

Add revoke function

Register revoke error as deploy error

Prepare revoke command in activate

Extend logger to handle revoke

Implement revoke command client side

Run revoke on previously suceeded

Control whether to override by flag

Adhere profile configuration auto_rollback setting

Cargo fmt

Correctly provide profile path to activation script when revoking

Document multi flake mode in README

Resolve a typo in README.md

Co-authored-by: notgne2 &lt;gen2@gen2.space&gt;

Use existing teminology

rename revoke_suceeded -&gt; rollback_suceeded

Use more open CLI argument name `targets` instead of `flakes`

Document name changes in README

Add sudo command support for revokes

Call run_deploy with `dry_active` flag

Test revoke commands contains sudo

Set default temp_path in activate binary

Require temp_path for wait and activate subcommands

Add copyright comment

Address review change requests

Fix typo in README

Co-authored-by: Alexander Bantyev &lt;balsoft@balsoft.ru&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Run multiple deployments in sequence

Resolve targets later

Extend context by deployed flake

Apply clippy suggestions

Add revoke command builder

Track succeeded deploys

Add revoke function

Register revoke error as deploy error

Prepare revoke command in activate

Extend logger to handle revoke

Implement revoke command client side

Run revoke on previously suceeded

Control whether to override by flag

Adhere profile configuration auto_rollback setting

Cargo fmt

Correctly provide profile path to activation script when revoking

Document multi flake mode in README

Resolve a typo in README.md

Co-authored-by: notgne2 &lt;gen2@gen2.space&gt;

Use existing teminology

rename revoke_suceeded -&gt; rollback_suceeded

Use more open CLI argument name `targets` instead of `flakes`

Document name changes in README

Add sudo command support for revokes

Call run_deploy with `dry_active` flag

Test revoke commands contains sudo

Set default temp_path in activate binary

Require temp_path for wait and activate subcommands

Add copyright comment

Address review change requests

Fix typo in README

Co-authored-by: Alexander Bantyev &lt;balsoft@balsoft.ru&gt;
</pre>
</div>
</content>
</entry>
</feed>
