Skip to content

Commit

Permalink
windows兼容处理
Browse files Browse the repository at this point in the history
  • Loading branch information
liushaobo committed Jul 22, 2021
1 parent 1180a86 commit dade19d
Show file tree
Hide file tree
Showing 17 changed files with 1,006 additions and 518 deletions.
57 changes: 57 additions & 0 deletions .gitlab-ci.yml.rej
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
diff a/.gitlab-ci.yml b/.gitlab-ci.yml (rejected hunks)
@@ -23,29 +23,29 @@ stages:
# tags:
# - cloudcare-ft

-build-testing:
- stage: deploy
- only:
- - testing
- script:
- # building && publish testing
- - make ci_notify
- - make testing
- - make pub_testing
- - make pub_testing_img
- - make test_notify
- tags:
- - cloudcare-ft
-
-build-release:
- stage: deploy
- only:
- - master
- script:
- - make ci_notify
- - make release
- - make pub_release
- - make pub_release_img
- - make release_notify
- tags:
- - cloudcare-ft
+#build-testing:
+# stage: deploy
+# only:
+# - testing
+# script:
+# # building && publish testing
+# - make ci_notify
+# - make testing
+# - make pub_testing
+# - make pub_testing_img
+# - make test_notify
+# tags:
+# - cloudcare-ft
+#
+#build-release:
+# stage: deploy
+# only:
+# - master
+# script:
+# - make ci_notify
+# - make release
+# - make pub_release
+# - make pub_release_img
+# - make release_notify
+# tags:
+# - cloudcare-ft
39 changes: 39 additions & 0 deletions Dockerfile_win
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
FROM mcr.microsoft.com/windows/servercore:ltsc2019

ARG exe="dist/datakit-windows-amd64"
ARG target="C:/Program Files/datakit/"

RUN mkdir ${target}

COPY ${exe} ${target}

# download data files required by datakit
ADD https://zhuyun-static-files-production.oss-cn-hangzhou.aliyuncs.com/datakit/data.tar.gz data.tar.gz
RUN tar -zxvf data.tar.gz -C ${target}
RUN del "data.tar.gz"

ARG dataway=""
ARG loglevel=""
ARG global_tags=""
ARG hostname=""
ARG name=""
ARG http_listen=""
ARG rum_origin_ip_header=""
ARG enable_pprof=""
ARG disable_protect_mode=""
ARG default_enabled_inputs=""
ARG enable_election=""

ENV ENV_DATAWAY=$dataway \
ENV_LOG_LEVEL=$loglevel \
ENV_GLOBAL_TAGS=$global_tags \
ENV_NAME=$name \
ENV_HTTP_LISTEN=$http_listen \
ENV_RUM_ORIGIN_IP_HEADER=$rum_origin_ip_header \
ENV_ENABLE_PPROF=$enable_pprof \
ENV_DISABLE_PROTECT_MODE=$=$disable_protect_mode \
ENV_DEFAULT_ENABLED_INPUTS=$default_enabled_inputs \
ENV_ENABLE_ELECTION=$enable_election \
ENV_HOSTNAME=$hostname

CMD ["C:\\Program Files\\datakit\\datakit", "--docker"]
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,25 @@ pub_testing:
pub_testing_mac:
$(call pub,test,$(TEST_DOWNLOAD_ADDR),$(MAC_ARCHS))

pub_testing_win_img:
@mkdir -p embed/windows-amd64
@wget --quiet -O - "https://$(TEST_DOWNLOAD_ADDR)/iploc/iploc.tar.gz" | tar -xz -C .
@sudo docker build -t registry.jiagouyun.com/datakit/datakit-win:$(GIT_VERSION) -f ./Dockerfile_win .
@sudo docker push registry.jiagouyun.com/datakit/datakit-win:$(GIT_VERSION)

pub_testing_img:
@mkdir -p embed/linux-amd64
@wget --quiet -O - "https://$(TEST_DOWNLOAD_ADDR)/iploc/iploc.tar.gz" | tar -xz -C .
@sudo docker build -t registry.jiagouyun.com/datakit/datakit:$(GIT_VERSION) .
@sudo docker push registry.jiagouyun.com/datakit/datakit:$(GIT_VERSION)

pub_release_win_img:
# release to pub hub
@mkdir -p embed/windows-amd64
@wget --quiet -O - "https://$(RELEASE_DOWNLOAD_ADDR)/iploc/iploc.tar.gz" | tar -xz -C .
@sudo docker build -t pubrepo.jiagouyun.com/datakit/datakit-win:$(GIT_VERSION) -f ./Dockerfile_win .
@sudo docker push pubrepo.jiagouyun.com/datakit/datakit-win:$(GIT_VERSION)

pub_release_img:
# release to pub hub
@mkdir -p embed/linux-amd64
Expand Down
2 changes: 1 addition & 1 deletion config/load.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func LoadCfg(c *Config, mcp string) error {

if datakit.Docker { // only accept configs from ENV under docker(or daemon-set) mode

if runtime.GOOS != "linux" {
if runtime.GOOS != "linux" && runtime.GOOS != "windows" {
return fmt.Errorf("docker mode not supported under %s", runtime.GOOS)
}

Expand Down
11 changes: 11 additions & 0 deletions man/manuals/jvm.md.rej
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
diff a/man/manuals/jvm.md b/man/manuals/jvm.md (rejected hunks)
@@ -97,9 +97,6 @@ java -javaagent:dd-java-agent.jar \
-Ddd.jmxfetch.check-period=1000 \
-Ddd.jmxfetch.statsd.host=127.0.0.1 \
-Ddd.jmxfetch.statsd.port=8125 \
- -Ddd.trace.health.metrics.enabled=true \
- -Ddd.trace.health.metrics.statsd.host=127.0.0.1 \
- -Ddd.trace.health.metrics.statsd.port=8125 \
-Ddd.version=1.0 \
-jar your-app.jar
```
Loading

0 comments on commit dade19d

Please sign in to comment.