about summary refs log tree commit diff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--users/fcuny/notes/Makefile9
-rwxr-xr-xusers/fcuny/notes/scripts/deploy.sh14
2 files changed, 15 insertions, 8 deletions
diff --git a/users/fcuny/notes/Makefile b/users/fcuny/notes/Makefile
index 4644ac3..fbd1205 100644
--- a/users/fcuny/notes/Makefile
+++ b/users/fcuny/notes/Makefile
@@ -5,7 +5,7 @@ DOCKER_IMAGE_REF := $(shell git rev-parse HEAD)
 DOCKERFILE := Dockerfile
 PROJECT_DIR := $(realpath $(CURDIR))
 
-.PHONY: server deploy docker-build docker-run worktree-clean
+.PHONY: server docker-build docker-run worktree-clean
 
 server:
 	@echo "Running hugo server ..."
@@ -15,13 +15,6 @@ worktree-clean:
 	git diff --exit-code
 	git diff --staged --exit-code
 
-deploy: worktree-clean docker-build
-	@echo "Deploying to fly ..."
-	flyctl deploy
-	@git tag -a --message $$(flyctl info -j |jq -r '.App | "notes.fcuny.net/v\(.Version)"') $$(flyctl info -j |jq -r '.App | "notes.fcuny.net/v\(.Version)"')
-	@git push origin --all
-	@git push origin --tags
-
 docker-build:
 	@echo "Building Docker image ..."
 	$(DOCKER) build $(DOCKER_BUILD_ARGS) \
diff --git a/users/fcuny/notes/scripts/deploy.sh b/users/fcuny/notes/scripts/deploy.sh
new file mode 100755
index 0000000..4075f08
--- /dev/null
+++ b/users/fcuny/notes/scripts/deploy.sh
@@ -0,0 +1,14 @@
+#!/usr/bin/env bash
+
+git diff --exit-code
+git diff --staged --exit-code
+
+flyctl deploy
+
+VERSION=$(flyctl info -j |jq -r '.App | "notes.fcuny.net/v\(.Version)"')
+
+git tag -a --message ${VERSION} ${VERSION}
+git push origin --all
+git push origin --tags
+
+flyctl agent stop