Skip to content

Commit 207f968

Browse files
committed
chore: update build script
1 parent 42f65b9 commit 207f968

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ jobs:
3030
TARGET_PATH=build
3131
DOCKER_REPO=gitsang
3232
VERSION=${{ steps.get_version.outputs.VERSION }}
33+
LD_FLAGS="-ldflags -X ddns/pkg/config.Version=${VERSION}"
3334
3435
mkdir -p ${TARGET_PATH} ${TARGET_PATH}/bin ${TARGET_PATH}/conf ${TARGET_PATH}/log
3536
go build ${LD_FLAGS} -o ${TARGET_PATH}/bin/${SERVICE_NAME} cmd/${SERVICE_NAME}.go

Makefile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,14 @@ pull: ## pull latest published docker
3838

3939
docker pull $(DOCKER_REPO)/$(SERVICE_NAME):latest
4040

41-
install: docker ## build docker and run
41+
install: build ## install by systemd
42+
43+
cp $(TARGET_PATH)/bin/$(SERVICE_NAME) /usr/local/bin/
44+
cp configs/ddns.service /etc/systemd/system/
45+
cp configs/template.yml /usr/local/etc/ddns/ddns.yml
46+
mkdir -p /var/log/ddns/
47+
48+
docker-install: docker ## build docker and run
4249

4350
mkdir -p /data/ddns/conf /data/ddns/log
4451
docker rm -f ddns

pkg/service/service.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ func UpdateDns() {
5353
recordValue := *record.Value
5454
logFields = append(logFields, zap.String("recordId", recordId), zap.String("recordValue", recordValue))
5555
if recordValue == ip {
56-
log.Info("record not change, skip", logFields...)
56+
log.Debug("record not change, skip", logFields...)
5757
continue
5858
}
5959

0 commit comments

Comments
 (0)