-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
37 lines (30 loc) · 1.06 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# Add missing dependencies to the go.mod file
tidy:
go mod tidy
# Build the single binary of the app
build:
go build
# Clean up the old binary builds
clean:
rm ./deploy-ci
# Start the deploy-ci daemon
start:
sudo systemctl start deploy-ci
# Restart the deploy-ci daemon
restart:
sudo systemctl restart deploy-ci
# Stop the deploy-ci daemon
stop:
sudo systemctl start deploy-ci
# Clean up old builds, get dependecies, build and restart the app daemon
update: tidy build restart
# Configure systemd and start the vieo daemon
setup: tidy build
cat deploy-ci.conf > deploy-ci.temp
sed -i 's+User=.*+User='"$$(whoami)"'+g' ./deploy-ci.temp
sed -i 's+EnvironmentFile=.*+EnvironmentFile='"$$(pwd)"/environment.conf'+g' ./deploy-ci.temp
sed -i 's+WorkingDirectory=.*+WorkingDirectory='"$$(pwd)"'+g' ./deploy-ci.temp
sed -i 's+ExecStart=.*+ExecStart='"$$(pwd)"'/deploy-ci ${DEPLOY_PORT} ${DEPLOY_ANSIBLE_FILE} ${DEPLOY_USER}+g' ./deploy-ci.temp
sudo mv ./deploy-ci.temp /etc/systemd/system/deploy-ci.service
sudo systemctl daemon-reload
sudo systemctl restart deploy-ci