Skip to content

Commit 0e7590d

Browse files
author
wilhelmguo
authored
Merge pull request #168 from wilhelmguo/feature/update_release_version
Update release version before release
2 parents bc3db59 + 302009a commit 0e7590d

File tree

6 files changed

+25
-12
lines changed

6 files changed

+25
-12
lines changed

Makefile

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,17 @@
22

33
MAKEFLAGS += --warn-undefined-variables
44

5-
# Runtime/Dev variables (used in src/backend/conf/app.conf)
6-
-include .env
7-
export
8-
95
# Build variables
6+
REGISTRY_URI :=360cloud
107
RELEASE_VERSION :=$(shell git describe --always --tags)
118
UI_BUILD_VERSION :=v1.0.0
129
SERVER_BUILD_VERSION :=v1.0.0
1310

1411

15-
release: build-release-image push-image
12+
release: update-version build-release-image push-image
1613

14+
update-version:
15+
./hack/updateversion.sh
1716

1817
# run module
1918
run-backend:
@@ -45,18 +44,18 @@ swagger-openapi:
4544
# release, requiring Docker 17.05 or higher on the daemon and client
4645
build-release-image:
4746
@echo "version: $(RELEASE_VERSION)"
48-
docker build --no-cache --build-arg RAVEN_DSN=$(RAVEN_DSN) -t 360cloud/wayne:$(RELEASE_VERSION) .
47+
docker build --no-cache --build-arg RAVEN_DSN=$(RAVEN_DSN) -t $(REGISTRY_URI)/wayne:$(RELEASE_VERSION) .
4948

5049
push-image:
51-
docker push 360cloud/wayne:$(RELEASE_VERSION)
50+
docker push $(REGISTRY_URI)/wayne:$(RELEASE_VERSION)
5251

5352

5453
## server builder image
5554
build-server-image:
5655
cd hack/build/server && docker build --no-cache \
57-
-t 360cloud/wayne-server-builder:$(SERVER_BUILD_VERSION) .
56+
-t $(REGISTRY_URI)/wayne-server-builder:$(SERVER_BUILD_VERSION) .
5857

5958
## ui builder image
6059
build-ui-image:
61-
docker build -f hack/build/ui/Dockerfile -t 360cloud/wayne-ui-builder:$(UI_BUILD_VERSION) .
60+
docker build -f hack/build/ui/Dockerfile -t $(REGISTRY_URI)/wayne-ui-builder:$(UI_BUILD_VERSION) .
6261

File renamed without changes.

hack/updateversion.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/sh
2+
3+
GO_MAIN=src/backend/main.go
4+
PACKAGE_JSON=src/frontend/package.json
5+
SWAGGER_VERSION_GO=src/backend/controllers/openapi/openapi.go
6+
7+
VERSION=(`grep -Eo "v[0-9]+\.[0-9]+\.[0-9]+[a-z0-9\-]*" ${GO_MAIN}`)
8+
NEXT_VERSION=$(git describe --always --tags)
9+
10+
echo "Project current version: [$VERSION], next_version:[$NEXT_VERSION] "
11+
12+
sed -i "s/$VERSION/$NEXT_VERSION/" ${GO_MAIN}
13+
sed -i 's/\("version": "\)'$VERSION'/\1'$NEXT_VERSION'/' $PACKAGE_JSON
14+
sed -i 's/\(Version: \)'$VERSION'/\1'$NEXT_VERSION'/' $SWAGGER_VERSION_GO

src/backend/controllers/openapi/openapi.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
// Schemes: https
1515
// Host: localhost
1616
// BasePath: /openapi/v1/gateway/action
17-
// Version: 1.1.0
17+
// Version: v1.1.0
1818
//
1919
// Consumes:
2020
// - application/json

src/backend/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"github.com/Qihoo360/wayne/src/backend/cmd"
55
)
66

7-
var Version string = "1.1.0"
7+
const Version = "v1.1.0"
88

99
func main() {
1010
cmd.Version = Version

src/frontend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "frontend",
3-
"version": "1.1.0",
3+
"version": "v1.1.0",
44
"license": "MIT",
55
"scripts": {
66
"ng": "ng",

0 commit comments

Comments
 (0)