You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by ke...@apache.org on 2021/09/23 13:14:05 UTC
[skywalking-cli] 01/01: Publish Docker snapshot images to ghcr
This is an automated email from the ASF dual-hosted git repository.
kezhenxu94 pushed a commit to branch docker/snapshot
in repository https://gitbox.apache.org/repos/asf/skywalking-cli.git
commit 37433fd53a11f880b484733e0280de68e867cf9e
Author: kezhenxu94 <ke...@apache.org>
AuthorDate: Thu Sep 23 21:13:55 2021 +0800
Publish Docker snapshot images to ghcr
---
.github/workflows/publish-docker.yaml | 50 +++++++++++++++++++++++++++++++++++
Dockerfile | 2 ++
Makefile | 8 ++++--
3 files changed, 58 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/publish-docker.yaml b/.github/workflows/publish-docker.yaml
new file mode 100644
index 0000000..bcd5f33
--- /dev/null
+++ b/.github/workflows/publish-docker.yaml
@@ -0,0 +1,50 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+name: publish-docker
+
+on:
+ push:
+ branches:
+ - master
+ - docker/snapshot
+
+env:
+ SKIP_TEST: true
+ HUB: ghcr.io/apache/skywalking-cli
+
+jobs:
+ build:
+ if: github.repository == 'apache/skywalking-cli'
+ runs-on: ubuntu-latest
+ permissions:
+ contents: read
+ packages: write
+ timeout-minutes: 30
+ env:
+ TAG: ${{ github.sha }}
+ steps:
+ - uses: actions/checkout@v2
+ with:
+ submodules: true
+ - name: Log in to the Container registry
+ uses: docker/login-action@v1.10.0
+ with:
+ registry: ${{ env.HUB }}
+ username: ${{ github.actor }}
+ password: ${{ secrets.GITHUB_TOKEN }}
+ - name: Build docker image
+ run: make docker.push || make docker.push
diff --git a/Dockerfile b/Dockerfile
index 264a581..5f9f4a4 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -13,6 +13,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+ARG VERSION
+
FROM golang:1.14 AS builder
ENV CGO_ENABLED=0
diff --git a/Makefile b/Makefile
index bd19b36..a31fde4 100644
--- a/Makefile
+++ b/Makefile
@@ -69,7 +69,7 @@ assets: tools
&& cd ..
.PHONY: $(PLATFORMS)
-$(PLATFORMS):
+$(PLATFORMS): clean
mkdir -p $(OUT_DIR)
GOOS=$(os) GOARCH=$(ARCH) $(GO_BUILD) $(GO_BUILD_FLAGS) -ldflags "$(GO_BUILD_LDFLAGS)" -o $(OUT_DIR)/$(BINARY)-$(VERSION)-$(os)-$(ARCH) cmd/swctl/main.go
@@ -150,7 +150,11 @@ check-codegen:
.PHONY: docker
docker:
- docker build . -t $(HUB)/$(APP_NAME):$(VERSION)
+ docker build --build-arg VERSION=$(VERSION) . -t $(HUB)/$(APP_NAME):$(VERSION)
+
+.PHONY: docker.push
+docker.push: docker
+ docker push $(HUB)/$(APP_NAME):$(VERSION)
.PHONY: test-commands
test-commands: