Skip to content

Commit

Permalink
chore: update build script
Browse files Browse the repository at this point in the history
  • Loading branch information
gitsang committed Jun 22, 2022
1 parent 42f65b9 commit 207f968
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
TARGET_PATH=build
DOCKER_REPO=gitsang
VERSION=${{ steps.get_version.outputs.VERSION }}
LD_FLAGS="-ldflags -X ddns/pkg/config.Version=${VERSION}"
mkdir -p ${TARGET_PATH} ${TARGET_PATH}/bin ${TARGET_PATH}/conf ${TARGET_PATH}/log
go build ${LD_FLAGS} -o ${TARGET_PATH}/bin/${SERVICE_NAME} cmd/${SERVICE_NAME}.go
Expand Down
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,14 @@ pull: ## pull latest published docker

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

install: docker ## build docker and run
install: build ## install by systemd

cp $(TARGET_PATH)/bin/$(SERVICE_NAME) /usr/local/bin/
cp configs/ddns.service /etc/systemd/system/
cp configs/template.yml /usr/local/etc/ddns/ddns.yml
mkdir -p /var/log/ddns/

docker-install: docker ## build docker and run

mkdir -p /data/ddns/conf /data/ddns/log
docker rm -f ddns
Expand Down
2 changes: 1 addition & 1 deletion pkg/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func UpdateDns() {
recordValue := *record.Value
logFields = append(logFields, zap.String("recordId", recordId), zap.String("recordValue", recordValue))
if recordValue == ip {
log.Info("record not change, skip", logFields...)
log.Debug("record not change, skip", logFields...)
continue
}

Expand Down

0 comments on commit 207f968

Please sign in to comment.