add scripts to use docker for linux deploy-rs on macOS
parent
bf0019001a
commit
56061420bb
@ -0,0 +1,3 @@
|
|||||||
|
.git/
|
||||||
|
deploy/
|
||||||
|
.gitignore
|
@ -1 +1,3 @@
|
|||||||
result
|
result
|
||||||
|
/deploy/.ssh/*
|
||||||
|
!/deploy/.ssh/.gitkeep
|
||||||
|
@ -0,0 +1,9 @@
|
|||||||
|
from nixos/nix
|
||||||
|
|
||||||
|
run echo "experimental-features = nix-command flakes" >> /etc/nix/nix.conf
|
||||||
|
run nix-channel --update
|
||||||
|
|
||||||
|
run nix-env -iA nixpkgs.deploy-rs
|
||||||
|
|
||||||
|
copy . /deploy
|
||||||
|
workdir /deploy
|
@ -0,0 +1,18 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||||
|
cd $SCRIPT_DIR/..
|
||||||
|
|
||||||
|
echo "Building Nix environment in docker"
|
||||||
|
IMAGE=$(docker build . -q -f ./deploy/Dockerfile)
|
||||||
|
|
||||||
|
echo "Beginning deploy"
|
||||||
|
docker run \
|
||||||
|
--name "nixos-deploy" \
|
||||||
|
--rm \
|
||||||
|
--mount type=bind,src=$(pwd)/deploy/.ssh/,dst=/root/.ssh/,readonly=true \
|
||||||
|
--mount type=volume,src=nixCache,dst=/nix/ \
|
||||||
|
-it $IMAGE \
|
||||||
|
deploy
|
||||||
|
|
@ -0,0 +1,13 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||||
|
cd $SCRIPT_DIR/..
|
||||||
|
|
||||||
|
echo "Seeding known_hosts for (nyx|git).tempest.dev"
|
||||||
|
cat ~/.ssh/known_hosts | grep -E '(nyx|git).tempest.dev' > deploy/.ssh/known_hosts
|
||||||
|
|
||||||
|
echo "Generating deploy keys"
|
||||||
|
ssh-keygen -t ed25519 -f ./deploy/.ssh/id_ed25519 -C "$USER@nixos-deploy"
|
||||||
|
echo ""
|
||||||
|
echo "Be sure to copy these keys onto any git servers your flake pulls from and onto machines you want to deploy to"
|
Loading…
Reference in New Issue