Skip to content

Commit

Permalink
add first custom script
Browse files Browse the repository at this point in the history
  • Loading branch information
AnthonyEnr1quez committed Oct 2, 2023
1 parent 4d4ad84 commit 75ca4f9
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 15 deletions.
19 changes: 7 additions & 12 deletions hosts/darwin/anthonyenriquez-MacBook-Pro/direnvs/mf/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@

bumper = pkgs.buildGoModule rec {
pname = "bumper";
version = "0.3.0";
version = "0.4.0";
src = builtins.fetchGit {
url = "git@github.com:moovfinancial/bumper.git";
ref = "v${version}";
rev = "da5e33b2fd07ba3927004d4106f64d4dce5a2c2a";
rev = "5aea0cecb5f946805539880602a9fe40eacc348d";
};
doCheck = false;
vendorSha256 = "sha256-ix72uivcxw2TzYZnifjbjT0sogdZk5PNEEVpfgitJkY=";
Expand All @@ -40,11 +40,12 @@
};

scriptDefs = {
simple-script = mkScriptPackage {
name = "simple-script";
pdev-test = mkScriptPackage {
name = "pdev-test";
deps = [
pkgs.cowsay
pkgs.ddate
bumper
pkgs.coreutils
pkgs.git
];
};
};
Expand All @@ -66,12 +67,6 @@
zstd

bumper
] ++ [
(writeScriptBin "testing123" ''
tmp="bob"
echo hello $tmp!
which bump
'')
] ++ scripts;

# env vars
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash
service_name=$(basename -s .git `git config --get remote.origin.url`)
short_sha=$(git rev-parse --short HEAD)

dry_run=""
if [ "$1" = "-c" ]; then
dry_run="-n"
fi

bumper_output=$( (bump deploy $dry_run pdev $service_name:dev-$short_sha | sort; ) 2>&1 )

if [ -z "$dry_run" ]; then
echo $(echo "$bumper_output" | grep "Created")
else
branch_name=$(echo "$bumper_output" | grep "checkout -b"| rev | cut -d " " -f1 | rev)
commit_msg=$(echo "$bumper_output" | grep "with message"| cut -d'"' -f 2)

git -C $BUMPER_PD_PATH checkout -q -b $branch_name
git -C $BUMPER_PD_PATH commit -am "$commit_msg" > /dev/null

echo "Created branch $branch_name in platform-dev, add your configs and push :)"
fi

This file was deleted.

0 comments on commit 75ca4f9

Please sign in to comment.