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

kezhenxu94 pushed a commit to branch docker
in repository https://gitbox.apache.org/repos/asf/skywalking-infra-e2e.git

commit 2e7a616c55580c0beac77f6ff15a2ab50e869b52
Author: kezhenxu94 <[email protected]>
AuthorDate: Thu Aug 12 18:44:49 2021 +0800

    Add Dockerfile and use Docker image in GHA
---
 Dockerfile  | 35 +++++++++++++++++++++++++++++++++++
 Makefile    |  5 +++++
 action.yaml |  4 ++--
 3 files changed, 42 insertions(+), 2 deletions(-)

diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..4218998
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,35 @@
+# Licensed to 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. Apache Software Foundation (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.
+#
+
+FROM golang:1.16-alpine AS build
+
+WORKDIR /e2e
+
+COPY . .
+
+RUN apk add --no-cache make curl docker docker-compose && make linux
+
+FROM alpine:3 AS bin
+
+RUN apk add --no-cache docker docker-compose
+
+COPY --from=build /e2e/bin/linux/e2e /bin/e2e
+
+WORKDIR /github/workspace/
+
+ENTRYPOINT ["/bin/e2e", "-v", "debug"]
diff --git a/Makefile b/Makefile
index e0f675b..e48f340 100644
--- a/Makefile
+++ b/Makefile
@@ -21,6 +21,7 @@ VERSION ?= latest
 OUT_DIR = bin
 ARCH := $(shell uname)
 OSNAME := $(if $(findstring Darwin,$(ARCH)),darwin,linux)
+HUB ?= docker.io/apache
 
 GO := GO111MODULE=on go
 GO_PATH = $(shell $(GO) env GOPATH)
@@ -70,6 +71,10 @@ clean:
 .PHONY: verify
 verify: clean lint test
 
+.PHONY: docker
+docker:
+       docker build --no-cache . -t $(HUB)/$(PROJECT):$(VERSION)
+
 release-src: clean
        -mkdir $(RELEASE_SRC)
        -cp ../NOTICE $(RELEASE_SRC)
diff --git a/action.yaml b/action.yaml
index b6549e4..e42a489 100644
--- a/action.yaml
+++ b/action.yaml
@@ -31,7 +31,7 @@ runs:
     - shell: bash
       run: |
         cd "$GITHUB_ACTION_PATH"
-        go mod download && make linux && mv bin/linux/e2e 
/tmp/skywalking-infra-e2e/bin/e2e
+        make docker
     - shell: bash
       run: |
         cd /tmp/skywalking-infra-e2e
@@ -42,4 +42,4 @@ runs:
     - shell: bash
       run: |
         export PATH="$PATH:/tmp/skywalking-infra-e2e/bin"
-        e2e run -c "${{ inputs.e2e-file }}"
\ No newline at end of file
+        docker run -v $(pwd):/github/workspace -v 
/var/run/docker.sock:/var/run/docker.sock docker.io/apache/e2e:latest run -c 
"${{ inputs.e2e-file }}"

Reply via email to