Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iog master diff #126

Draft
wants to merge 53 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
86607fb
Refactor data to settings (specificity)
blaggacao Aug 7, 2021
18eba45
Expand environmental variables in sshOpts
nrdxp Aug 10, 2021
e6c50d9
Refactor data structures into thier own module
blaggacao Aug 7, 2021
e7d950a
Refactor implement from_str trait for `Target` data
blaggacao Aug 7, 2021
5fcece6
Refactor move flake parsing into adapter file
blaggacao Aug 8, 2021
7027879
Refactor homologate data structures
blaggacao Aug 8, 2021
29a90ae
Refactor accesor for ssh uri from DeployData
blaggacao Aug 26, 2021
492b4de
Refactor & simplify the target setting resolver
blaggacao Aug 8, 2021
011b351
Refactor merge DeployDefs into DeployData (single view)
blaggacao Aug 11, 2021
ce40968
Refactor & simplify the target setting resolver
blaggacao Aug 26, 2021
6610bad
Refactor create push.rs views into data.rs owned data & cleanup
blaggacao Aug 12, 2021
bea6fe0
run cargo fmt
nrdxp Aug 27, 2021
dad7542
fix clippy lints
nrdxp Aug 27, 2021
03d9974
expose base from activate.custom
manveru Aug 30, 2021
120c31f
update dependencies
nrdxp Nov 4, 2021
cb5aa4a
flake: replace naersk with buildRustPackage
lovesegfault Sep 15, 2021
40ff561
add aarch64-darwin to built systems
pjjw Aug 6, 2021
d630e13
Fix darwin build
balsoft Sep 28, 2021
f508d4b
change external interface to take parsed Opts
nrdxp Nov 5, 2021
c518de4
make Opts fields public for external use
nrdxp Nov 5, 2021
6dbb524
don't require hostname, since we pass in on the fly
nrdxp Nov 5, 2021
efde6ef
improve logging
blaggacao Nov 6, 2021
5075460
imp(flags): make bools true bools
blaggacao Nov 6, 2021
df1b349
imp(hostname): make hostname optional
blaggacao Nov 6, 2021
9dc9229
fix(hostname): accessor resolved values, not raw ones
blaggacao Nov 6, 2021
fee7e09
imp(ip-suffix): implement target ip suffix
blaggacao Nov 6, 2021
5603808
imp(socket): resolve sockets at the entrypoint
blaggacao Nov 6, 2021
5564608
imp tests
blaggacao Nov 6, 2021
0c28e0c
fix ssh uri/socket for nix copy
blaggacao Nov 6, 2021
9553b8c
feat(ssh_opts): concede multiple values to downstream
blaggacao Nov 7, 2021
3a8d4f3
ensure spawned thread exits before main
nrdxp Nov 18, 2021
aebc73d
optionally skip checks from environment
nrdxp Nov 18, 2021
3b9dcd1
flake: update lock and follow fenix nixpkgs
nrdxp Nov 19, 2021
1d3d7a0
clippy: resolve lints
nrdxp Nov 19, 2021
ef7e1f8
Cargo.lock: remove unused dependency
nrdxp Nov 19, 2021
bef8614
nix: ensure package and shell use same toolchain
nrdxp Nov 19, 2021
633b9bc
cargo: use thin lto
nrdxp Nov 19, 2021
e41fd9c
cargo: update deps
nrdxp Nov 19, 2021
5a6db26
flake: use self instead of ./.
nrdxp Nov 19, 2021
1d3a4f4
imp debugging
blaggacao Dec 1, 2021
f70cb4f
fix: fast connection
blaggacao Dec 3, 2021
fe35ea7
fmt: cargo fmt
nrdxp Dec 10, 2021
64ca7a8
flake.lock: update to rust 1.57.0
nrdxp Dec 10, 2021
55b397d
show copy progress
nrdxp Dec 10, 2021
0c02577
cargo: update deps
nrdxp Dec 10, 2021
7267eab
imp: apply source filter
blaggacao Dec 17, 2021
1c60c23
nix: ran nixfmt across flake.nix
craigem Feb 23, 2022
feb44f8
fenix: corrected inputs for fenix and nixpkgs
craigem Feb 23, 2022
dabb79d
build: show command output
nrdxp Aug 16, 2022
9e449da
invert rollback settings
nrdxp Aug 16, 2022
b086e4d
keep going on error
nrdxp Aug 16, 2022
f81eb2b
skip checks by default
nrdxp Aug 18, 2022
4da8eb9
export flake config in the environment
nrdxp Aug 22, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
560 changes: 197 additions & 363 deletions Cargo.lock

Large diffs are not rendered by default.

11 changes: 8 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
name = "deploy-rs"
version = "0.1.0"
authors = ["notgne2 <[email protected]>", "Serokell <[email protected]>"]
edition = "2018"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
clap = "3.0.0-beta.2"
clap = { version = "3.0.0-rc.3", features = [ "derive", "env" ] }
flexi_logger = "0.16"
fork = "0.1"
futures-util = "0.3.6"
linked_hash_set = "0.1.4"
log = "0.4"
merge = "0.1.0"
notify = "5.0.0-pre.3"
Expand All @@ -27,6 +27,7 @@ tokio = { version = "1.9.0", features = [ "full" ] }
toml = "0.5"
whoami = "0.9.0"
yn = "0.1"
envmnt = "0.9.0"

# smol_str is required by rnix, but 0.1.17 doesn't build on rustc
# 1.45.2 (shipped in nixos-20.09); it requires rustc 1.46.0. See
Expand All @@ -37,3 +38,7 @@ smol_str = "=0.1.16"
[lib]
name = "deploy"
path = "src/lib.rs"

[profile.release]
lto = "thin"
opt-level = 3
18 changes: 8 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ You can try out this tool easily with `nix run`:

In you want to deploy multiple flakes or a subset of profiles with one invocation, instead of calling `deploy <flake>` you can issue `deploy --targets <flake> [<flake> ...]` where `<flake>` is supposed to take the same format as discussed before.

Running in this mode, if any of the deploys fails, the deploy will be aborted and all successful deploys rolled back. `--rollback-succeeded false` can be used to override this behavior, otherwise the `auto-rollback` argument takes precedent.
Running in this mode, if any of the deploys fails, the deploy will be aborted and all successful deploys rolled back. `--rollback-succeeded false` can be used to override this behavior, otherwise the `no-auto-rollback` argument takes precedent.

If you require a signing key to push closures to your server, specify the path to it in the `LOCAL_KEY` environment variable.

Expand All @@ -48,7 +48,7 @@ This type of design (as opposed to more traditional tools like NixOps or morph)

### Magic Rollback

There is a built-in feature to prevent you making changes that might render your machine unconnectable or unusuable, which works by connecting to the machine after profile activation to confirm the machine is still available, and instructing the target node to automatically roll back if it is not confirmed. If you do not disable `magicRollback` in your configuration (see later sections) or with the CLI flag, you will be unable to make changes to the system which will affect you connecting to it (changing SSH port, changing your IP, etc).
There is a built-in feature to prevent you making changes that might render your machine unconnectable or unusuable, which works by connecting to the machine after profile activation to confirm the machine is still available, and instructing the target node to automatically roll back if it is not confirmed. If you do not disable `noMagicRollback` in your configuration (see later sections) or with the CLI flag, you will be unable to make changes to the system which will affect you connecting to it (changing SSH port, changing your IP, etc).

## API

Expand Down Expand Up @@ -166,17 +166,15 @@ This is a set of options that can be put in any of the above definitions, with t
# This defaults to `false`
fastConnection = false;

# If the previous profile should be re-activated if activation fails.
# This defaults to `true`
autoRollback = true;
# If the previous profile should NOT be re-activated if activation fails.
noAutoRollback = true;

# See the earlier section about Magic Rollback for more information.
# This defaults to `true`
magicRollback = true;
# See the earlier section about Magic Rollback for more information, disable with this attr.
noMagicRollback = true;

# The path which deploy-rs will use for temporary files, this is currently only used by `magicRollback` to create an inotify watcher in for confirmations
# The path which deploy-rs will use for temporary files, this is currently only used by the magic rollback to create an inotify watcher in for confirmations
# If not specified, this will default to `/tmp`
# (if `magicRollback` is in use, this _must_ be writable by `user`)
# (if magic rollback is in use, this _must_ be writable by `user`)
tempPath = "/home/someuser/.deploy-rs";
}
```
Expand Down
4 changes: 2 additions & 2 deletions examples/system/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
defaultPackage.x86_64-linux = import ./hello.nix nixpkgs;

deploy.nodes.example = {
sshOpts = [ "-p" "2221" ];
hostname = "localhost";
sshOpts = [ "-i" "./path/to/private/key" ];
hostname = "localhost:2221";
fastConnection = true;
profiles = {
system = {
Expand Down
84 changes: 50 additions & 34 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading