Skip to content

Commit

Permalink
add edge-ui 3.0.0
Browse files Browse the repository at this point in the history
Signed-off-by: yzewei <[email protected]>
  • Loading branch information
yzewei committed Apr 10, 2024
1 parent 813f13e commit 46d0a00
Show file tree
Hide file tree
Showing 2 changed files with 117 additions and 0 deletions.
83 changes: 83 additions & 0 deletions edgexfoundry/edgex-ui/3.0.0/0001-add-loong64-support-abi2.0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
From 1ea81aced10321f32b47bccf4a9c7fabcc317cd3 Mon Sep 17 00:00:00 2001
From: yzewei <[email protected]>
Date: Wed, 10 Apr 2024 09:02:42 +0800
Subject: [PATCH] add loong64 support (abi2.0)

Signed-off-by: yzewei <[email protected]>
---
Dockerfile | 8 ++------
Makefile | 4 +++-
version.go | 2 +-
3 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index 9ddd1e5..a31e483 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -15,7 +15,7 @@
# limitations under the License.
#

-ARG BASE=golang:1.20-alpine3.17
+ARG BASE=lcr.loongnix.cn/library/golang:1.19-alpine
FROM ${BASE} AS builder

ARG MAKE="make cmd/edgex-ui-server/edgex-ui-server"
@@ -27,11 +27,7 @@ LABEL Name=edgex-ui-go
LABEL license='SPDX-License-Identifier: Apache-2.0' \
copyright='Copyright (c) 2018-2023: Intel'

-# Need the docker client for CI builds of the web components.
-COPY --from=docker:latest /usr/local/bin/docker /usr/local/bin/docker
-
RUN apk add --update --no-cache ${ALPINE_PKG_BASE} ${ALPINE_PKG_EXTRA}
-
ENV GO111MODULE=on
WORKDIR /go/src/github.com/edgexfoundry/edgex-ui-go

@@ -41,7 +37,7 @@ RUN [ ! -d "vendor" ] && go mod download all || echo "skipping..."
COPY . .
RUN ${MAKE}

-FROM alpine:3.17
+FROM lcr.loongnix.cn/library/alpine:3.19

EXPOSE 4000

diff --git a/Makefile b/Makefile
index d5cc7da..a9850e7 100644
--- a/Makefile
+++ b/Makefile
@@ -20,7 +20,6 @@

GO=CGO_ENABLED=0 GO111MODULE=on go
GOCGO=CGO_ENABLED=1 GO111MODULE=on go
-
MICROSERVICES=cmd/edgex-ui-server/edgex-ui-server
.PHONY: $(MICROSERVICES)

@@ -76,8 +75,11 @@ docker: $(DOCKERS)

docker_edgex_ui_go:
docker build --label "git_sha=$(GIT_SHA)" \
+ --build-arg https_proxy=$(https_proxy) \
+ --build-arg http_proxy=$(http_proxy) \
-t edgexfoundry/edgex-ui:$(GIT_SHA) \
-t edgexfoundry/edgex-ui:$(VERSION)-dev \
+ -t lcr.loongnix.cn/edgexfoundry/edgex-ui:$(VERSION) \
.

vendor:
diff --git a/version.go b/version.go
index 65ec37d..0a3596e 100644
--- a/version.go
+++ b/version.go
@@ -7,4 +7,4 @@
package edgex

// Global version for edgex-go
-var Version string = "master"
+var Version string = "3.0.0"
--
2.41.0

34 changes: 34 additions & 0 deletions edgexfoundry/edgex-ui/3.0.0/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# This file is generated by the template.

REGISTRY?=lcr.loongnix.cn
ORGANIZATION?=edgexfoundry
REPOSITORY?=edgex-ui
TAG?=3.0.0
BRANCH:=v3.0.0-dev.1

IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG)

# SOURCE_URL is a url to download source, such as https://github.com/merore/merore.git.
# SOURCE is project sources, its located at src/$(SORUCE).
# PATCH is a patch that supports loong64 to $(SOURCE).
# Be sure to fill in the follows!!!
SOURCE_URL=https://github.com/edgexfoundry/edgex-ui-go.git
SOURCE=$(shell echo $(SOURCE_URL) | awk -F '/' '{print $$NF}' | awk -F '.' '{print $$1}')
PATCH=0001-add-loong64-support-abi2.0.patch

default: image

image: src/$(SOURCE)
# Commands for building.
$(MAKE) -C src/$(SOURCE) docker_edgex_ui_go

src/$(SOURCE):
git clone -b v$(TAG) --depth=1 $(SOURCE_URL) $@
cd $@ && \
git apply ../../$(PATCH)

push:
docker push $(IMAGE)

clean:
rm -rf src

0 comments on commit 46d0a00

Please sign in to comment.