-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #106 from holochain/deploy-from-github
feat(apps): add git-push and deploy scripts for darwin and nixos
- Loading branch information
Showing
12 changed files
with
88 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{ | ||
self, | ||
lib, | ||
... | ||
}: { | ||
perSystem = {pkgs, ...}: let | ||
mkGitPush = { | ||
attrName, | ||
hostName, | ||
}: | ||
pkgs.writeShellScript "git-push-${hostName}" '' | ||
set -Eeou pipefail | ||
export PATH="${lib.makeBinPath (with pkgs; [ | ||
git | ||
])}:$PATH" | ||
set -x | ||
remote=''${1:-origin} | ||
local_branch=''${2:-HEAD} | ||
shift || : | ||
shift || : | ||
git push $remote $local_branch:refs/heads/deploy/${attrName} ''${@} | ||
''; | ||
|
||
mkGitPushApp = attrName: config: | ||
lib.nameValuePair "git-push-${attrName}" { | ||
type = "app"; | ||
program = builtins.toString (mkGitPush { | ||
inherit attrName; | ||
inherit (config.config) hostName; | ||
}); | ||
}; | ||
in { | ||
config.apps = lib.mapAttrs' mkGitPushApp (self.darwinConfigurations // self.nixosConfigurations); | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters