From 407aba52b4e860ec3c725e292891ea03bac91f08 Mon Sep 17 00:00:00 2001 From: kaichao Date: Wed, 8 Nov 2023 22:26:36 +0800 Subject: [PATCH] add pull action in Makefile. --- dockerfiles/Makefile | 5 +++++ dockerfiles/cluster-dir-list/Dockerfile | 4 ++-- dockerfiles/cluster-dir-list/Makefile | 3 +++ dockerfiles/cluster-file-copy/Makefile | 3 +++ dockerfiles/cron/Makefile | 3 +++ dockerfiles/data-grouping-2d/Makefile | 9 ++++++--- dockerfiles/dir-list/Dockerfile | 2 +- dockerfiles/dir-list/Makefile | 3 +++ dockerfiles/ftp-copy/Dockerfile | 2 +- dockerfiles/ftp-copy/Makefile | 3 +++ dockerfiles/rsync-copy/Dockerfile | 2 +- dockerfiles/rsync-copy/Makefile | 3 +++ dockerfiles/rsyncd/Dockerfile | 3 +-- dockerfiles/rsyncd/Makefile | 4 ++++ server/Makefile | 4 ++-- 15 files changed, 41 insertions(+), 12 deletions(-) diff --git a/dockerfiles/Makefile b/dockerfiles/Makefile index 3cbd911..1e1ae04 100644 --- a/dockerfiles/Makefile +++ b/dockerfiles/Makefile @@ -10,6 +10,11 @@ push: $(MAKE) -C $$dir push; \ done +pull: + @for dir in $(dirs); do \ + $(MAKE) -C $$dir pull; \ + done + clean: @for dir in $(dirs); do \ $(MAKE) -C $$dir clean; \ diff --git a/dockerfiles/cluster-dir-list/Dockerfile b/dockerfiles/cluster-dir-list/Dockerfile index 4356211..1df73a7 100644 --- a/dockerfiles/cluster-dir-list/Dockerfile +++ b/dockerfiles/cluster-dir-list/Dockerfile @@ -22,9 +22,9 @@ ENV SOURCE_CLUSTER= \ COPY run.sh /app/bin/ COPY list-files.sh /usr/local/bin/ -COPY --from=hub.cstcloud.cn/scalebox/base /usr/local/sbin/ /usr/local/sbin/ -COPY --from=hub.cstcloud.cn/scalebox/list-dir /usr/local/bin/get_2d_meta /usr/local/bin/ +COPY --from=hub.cstcloud.cn/scalebox/dir-list /usr/local/bin/get_2d_meta /usr/local/bin/ +COPY --from=hub.cstcloud.cn/scalebox/base /usr/local/sbin/ /usr/local/sbin/ RUN mkdir -p /work/.scalebox /app/bin && echo "PATH=/app/bin:\${PATH}" >> /root/.bashrc WORKDIR /work ENTRYPOINT [ "goagent" ] diff --git a/dockerfiles/cluster-dir-list/Makefile b/dockerfiles/cluster-dir-list/Makefile index 4ffd614..7108f99 100644 --- a/dockerfiles/cluster-dir-list/Makefile +++ b/dockerfiles/cluster-dir-list/Makefile @@ -6,6 +6,9 @@ build: push: docker push $(IMAGE_NAME) +pull: + docker pull $(IMAGE_NAME) + clean: docker rmi $(IMAGE_NAME) diff --git a/dockerfiles/cluster-file-copy/Makefile b/dockerfiles/cluster-file-copy/Makefile index 8d0bc7d..e1a4e67 100644 --- a/dockerfiles/cluster-file-copy/Makefile +++ b/dockerfiles/cluster-file-copy/Makefile @@ -6,6 +6,9 @@ build: push: docker push $(IMAGE_NAME) +pull: + docker pull $(IMAGE_NAME) + clean: docker rmi $(IMAGE_NAME) diff --git a/dockerfiles/cron/Makefile b/dockerfiles/cron/Makefile index caecf67..37f6917 100644 --- a/dockerfiles/cron/Makefile +++ b/dockerfiles/cron/Makefile @@ -6,6 +6,9 @@ build: push: docker push $(IMAGE_NAME) +pull: + docker pull $(IMAGE_NAME) + clean: docker rmi $(IMAGE_NAME) diff --git a/dockerfiles/data-grouping-2d/Makefile b/dockerfiles/data-grouping-2d/Makefile index 420ebc0..da0bf8b 100644 --- a/dockerfiles/data-grouping-2d/Makefile +++ b/dockerfiles/data-grouping-2d/Makefile @@ -3,11 +3,14 @@ IMAGE_NAME:=hub.cstcloud.cn/scalebox/data-grouping-2d build: DOCKER_BUILDKIT=1 docker build --network=host -t $(IMAGE_NAME) . -dist: - docker save $(IMAGE_NAME) | zstdmt | pv | ssh c0 'zstd -d | docker load' - push: docker push $(IMAGE_NAME) +pull: + docker pull $(IMAGE_NAME) + clean: docker rmi $(IMAGE_NAME) + +dist: + docker save $(IMAGE_NAME) | zstdmt | pv | ssh c0 'zstd -d | docker load' diff --git a/dockerfiles/dir-list/Dockerfile b/dockerfiles/dir-list/Dockerfile index 030a3ad..a0dccd2 100644 --- a/dockerfiles/dir-list/Dockerfile +++ b/dockerfiles/dir-list/Dockerfile @@ -53,6 +53,6 @@ COPY run.sh /app/bin/ COPY list-files.sh /usr/local/bin/ COPY --from=hub.cstcloud.cn/scalebox/base /usr/local/sbin/ /usr/local/sbin/ -RUN mkdir -p /work /app/bin && echo "PATH=/app/bin:\${PATH}" >> /root/.bashrc +RUN mkdir -p /work/.scalebox /app/bin && echo "PATH=/app/bin:\${PATH}" >> /root/.bashrc WORKDIR /work ENTRYPOINT [ "goagent" ] diff --git a/dockerfiles/dir-list/Makefile b/dockerfiles/dir-list/Makefile index 5206927..4cc972a 100644 --- a/dockerfiles/dir-list/Makefile +++ b/dockerfiles/dir-list/Makefile @@ -6,6 +6,9 @@ build: push: docker push $(IMAGE_NAME) +pull: + docker pull $(IMAGE_NAME) + clean: docker rmi $(IMAGE_NAME) diff --git a/dockerfiles/ftp-copy/Dockerfile b/dockerfiles/ftp-copy/Dockerfile index f256a64..8584f19 100644 --- a/dockerfiles/ftp-copy/Dockerfile +++ b/dockerfiles/ftp-copy/Dockerfile @@ -21,6 +21,6 @@ ENV SOURCE_URL= \ ENABLE_LOCAL_RELAY=no COPY --from=hub.cstcloud.cn/scalebox/base /usr/local/sbin/ /usr/local/sbin/ -RUN mkdir -p /work /app/bin && echo "PATH=/app/bin:\${PATH}" >> /root/.bashrc +RUN mkdir -p /work/.scalebox /app/bin && echo "PATH=/app/bin:\${PATH}" >> /root/.bashrc WORKDIR /work ENTRYPOINT [ "goagent" ] diff --git a/dockerfiles/ftp-copy/Makefile b/dockerfiles/ftp-copy/Makefile index c469c78..c0c785c 100644 --- a/dockerfiles/ftp-copy/Makefile +++ b/dockerfiles/ftp-copy/Makefile @@ -6,5 +6,8 @@ build: push: docker push $(IMAGE_NAME) +pull: + docker pull $(IMAGE_NAME) + clean: docker rmi $(IMAGE_NAME) diff --git a/dockerfiles/rsync-copy/Dockerfile b/dockerfiles/rsync-copy/Dockerfile index 846777d..884304a 100644 --- a/dockerfiles/rsync-copy/Dockerfile +++ b/dockerfiles/rsync-copy/Dockerfile @@ -26,6 +26,6 @@ ENV SOURCE_URL= \ COPY *.sh /app/bin/ COPY --from=hub.cstcloud.cn/scalebox/base /usr/local/sbin/ /usr/local/sbin/ -RUN mkdir -p /work /app/bin && echo "PATH=/app/bin:\${PATH}" >> /root/.bashrc +RUN mkdir -p /work/.scalebox /app/bin && echo "PATH=/app/bin:\${PATH}" >> /root/.bashrc WORKDIR /work ENTRYPOINT [ "goagent" ] diff --git a/dockerfiles/rsync-copy/Makefile b/dockerfiles/rsync-copy/Makefile index 909e558..dc19dcb 100644 --- a/dockerfiles/rsync-copy/Makefile +++ b/dockerfiles/rsync-copy/Makefile @@ -7,6 +7,9 @@ build: push: docker push $(IMAGE_NAME) +pull: + docker pull $(IMAGE_NAME) + clean: docker rmi $(IMAGE_NAME) diff --git a/dockerfiles/rsyncd/Dockerfile b/dockerfiles/rsyncd/Dockerfile index 4603ca9..6978db6 100644 --- a/dockerfiles/rsyncd/Dockerfile +++ b/dockerfiles/rsyncd/Dockerfile @@ -40,7 +40,6 @@ CMD run.sh FROM base COPY --from=hub.cstcloud.cn/scalebox/base /usr/local/sbin/ /usr/local/sbin/ -RUN mkdir -p /work /app/bin && echo "PATH=/app/bin:\${PATH}" >> /root/.bashrc +RUN mkdir -p /work/.scalebox /app/bin && echo "PATH=/app/bin:\${PATH}" >> /root/.bashrc WORKDIR /work -CMD ENTRYPOINT [ "goagent" ] diff --git a/dockerfiles/rsyncd/Makefile b/dockerfiles/rsyncd/Makefile index b1b51da..141e15a 100644 --- a/dockerfiles/rsyncd/Makefile +++ b/dockerfiles/rsyncd/Makefile @@ -9,6 +9,10 @@ push: docker push $(IMAGE_BASE) docker push $(IMAGE_AGENT) +pull: + docker pull $(IMAGE_BASE) + docker pull $(IMAGE_AGENT) + clean: docker rmi $(IMAGE_BASE) docker rmi $(IMAGE_AGENT) diff --git a/server/Makefile b/server/Makefile index b7ed83c..14a6ed1 100644 --- a/server/Makefile +++ b/server/Makefile @@ -70,8 +70,8 @@ list: # @ pdsh -w $(NODES) 'cat $(SHARED_DIR)/id_rsa.pub >> ${HOME}/.ssh/authorized_keys' | dshbak -c # @ rm -f $(SHARED_DIR)/id_rsa.pub -pull-all: - @ for i in database actuator controld agent base cli; do \ +pull-all: get-cli + @ for i in database actuator controld agent base; do \ echo $$i; \ docker pull hub.cstcloud.cn/scalebox/$$i; \ done