- refactored User service from IceWhaleTech/CasaOS as first modularized service
This commit is contained in:
Tiger Wang (王豫)
2022-08-04 19:14:53 -04:00
committed by GitHub
parent a71dd10757
commit e2b617e510
23 changed files with 1870 additions and 1 deletions
+31
View File
@@ -0,0 +1,31 @@
APP_NAME = casaos-user-service
APP_NAME_SHORT = user-service
TARGET_DIR = target
BUILD_DIR = $(TARGET_DIR)/build
INSTALL_ROOT = /
all: $(TARGET_DIR)
$(BUILD_DIR): clean
mkdir -pv $(BUILD_DIR)/usr/bin
$(APP_NAME): $(BUILD_DIR)
go build -v -o $(BUILD_DIR)/usr/bin/$(APP_NAME)
$(TARGET_DIR): $(APP_NAME)
cp -rv build $(TARGET_DIR)
clean:
rm -rfv $(TARGET_DIR)
install:
cp -rv $(BUILD_DIR)/* $(INSTALL_ROOT)
systemctl enable --now $(APP_NAME).service
uninstall:
systemctl disable --now $(APP_NAME).service
rm -v $(INSTALL_ROOT)/etc/casaos/$(APP_NAME_SHORT).conf
rm -v $(INSTALL_ROOT)/usr/bin/$(APP_NAME)
rm -v $(INSTALL_ROOT)/usr/lib/systemd/system/$(APP_NAME).service