-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b32c106
commit 8cafe1b
Showing
3 changed files
with
160 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# | ||
# Copyright (c) 2024, Rafael Santiago | ||
# All rights reserved. | ||
# | ||
# This source code is licensed under the GPLv2 license found in the | ||
# COPYING.GPLv2 file in the root directory of Eutherpe's source tree. | ||
# | ||
|
||
define do_update | ||
@if [ "$(USER)" != "root" ]; then\ | ||
echo error: You are not root.;\ | ||
exit 1;\ | ||
fi | ||
@if [ ! -d /etc/eutherpe ]; then\ | ||
echo error: You have not ran bootstrap yet.;\ | ||
exit 1;\ | ||
fi | ||
@if [ "$$(systemctl status eutherpe | grep 'active (' | wc -l)" = "1" ]; then\ | ||
systemctl stop eutherpe;\ | ||
while [ "$$(systemctl status eutherpe | grep 'inactive (' | wc -l)" != "1" ]; do\ | ||
sleep 1s;\ | ||
done;\ | ||
fi | ||
@cp eutherpe $$(which eutherpe) && \ | ||
cp -rf web/ /etc/eutherpe/web/ && \ | ||
systemctl start eutherpe && \ | ||
echo info: Your Eutherpe\'s core was updated. | ||
endef | ||
|
||
eutherpe: | ||
@ if [ -f /etc/profile.d/goenv.sh ] ; then\ | ||
. /etc/profile.d/goenv.sh ;\ | ||
go build ;\ | ||
else \ | ||
go build ;\ | ||
fi | ||
|
||
tests: | ||
@go clean -testcache | ||
@go test internal/... -v | ||
|
||
bootstrap: | ||
@$(shell cd .. && ./bootstrap.sh) | ||
|
||
update: eutherpe | ||
@$(call do_update) | ||
|
||
.PHONY: bootstrap eutherpe tests update |