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:30:10 UTC

[skywalking-cli] branch docker/snapshot updated (6140a8d -> a80dc01)

This is an automated email from the ASF dual-hosted git repository.

kezhenxu94 pushed a change to branch docker/snapshot
in repository https://gitbox.apache.org/repos/asf/skywalking-cli.git.


 discard 6140a8d  Publish Docker snapshot images to ghcr
     new a80dc01  Publish Docker snapshot images to ghcr

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (6140a8d)
            \
             N -- N -- N   refs/heads/docker/snapshot (a80dc01)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .github/workflows/publish-docker.yaml | 1 -
 1 file changed, 1 deletion(-)

[skywalking-cli] 01/01: Publish Docker snapshot images to ghcr

Posted by ke...@apache.org.
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 a80dc01461abb7426a5f38d75ef863e25eb94530
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 | 53 +++++++++++++++++++++++++++++++++++
 Dockerfile                            |  2 ++
 Makefile                              |  8 ++++--
 README.md                             | 14 +++++++++
 docs/How-to-release.md                | 11 ++++++--
 5 files changed, 83 insertions(+), 5 deletions(-)

diff --git a/.github/workflows/publish-docker.yaml b/.github/workflows/publish-docker.yaml
new file mode 100644
index 0000000..a987c85
--- /dev/null
+++ b/.github/workflows/publish-docker.yaml
@@ -0,0 +1,53 @@
+# 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
+
+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:
+      VERSION: ${{ github.sha }}
+      APP_NAME: skywalking-cli
+    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
+          docker tag $HUB/$APP_NAME:{$VERSION,latest}
+          docker push $HUB/$APP_NAME:latest
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:
diff --git a/README.md b/README.md
index c6cef7e..9e6cb67 100644
--- a/README.md
+++ b/README.md
@@ -49,6 +49,20 @@ Then copy the `./bin/swctl-latest-(darwin|linux|windows)-amd64` to your `PATH` d
 
 You can also copy it to any directory you like, then add that directory to `PATH`. **We recommend you to rename the `swctl-latest-(darwin|linux|windows)-amd64` to `swctl`.**
 
+### Run from Docker image
+
+If you prefer to use Docker, skywalking-cli also provides Docker images for convenient usages since 0.9.0.
+We also push the snapshot Docker images to GitHub registry for developers who want to test the latest features,
+note that this is not Apache releases, and it's for test only, **DO NOT** use it in your production environment.
+
+```shell
+docker run -it --rm apache/skywalking-cli service ls
+
+# Or to use the snapshot Docker image
+
+docker run -it --rm ghcr.io/apache/skywalking-cli/skywalking-cli  service ls
+```
+
 ## Autocompletion
 
 `swctl` provides auto-completion support for bash and powershell, which can save you a lot of typing.
diff --git a/docs/How-to-release.md b/docs/How-to-release.md
index 127e42a..bb42c55 100644
--- a/docs/How-to-release.md
+++ b/docs/How-to-release.md
@@ -185,10 +185,15 @@ Vote result should follow these:
 1. Move source codes tar balls and distributions to `https://dist.apache.org/repos/dist/release/skywalking/`, **you can do this only if you are a PMC member**.
 
     ```shell
-    export SVN_EDITOR=vim
-    svn mv https://dist.apache.org/repos/dist/dev/skywalking/cli/$VERSION https://dist.apache.org/repos/dist/release/skywalking/cli
+    svn mv https://dist.apache.org/repos/dist/dev/skywalking/cli/$VERSION https://dist.apache.org/repos/dist/release/skywalking/cli -m"Release SkyWalking CLI $VERSION"
     ```
-    
+
+1. Push Docker images.
+
+```shell
+make docker.push
+```
+
 1. Refer to the previous [PR](https://github.com/apache/skywalking-website/pull/212), update the event and download links on the website.
 
 1. Update [Github release page](https://github.com/apache/skywalking-cli/releases), follow the previous convention.