Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
backend: update make release
  • Loading branch information
wilhelmguo committed Dec 21, 2018
commit 939c99df72973460c620993d7c4d8347b7c85f85
4 changes: 1 addition & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ SERVER_BUILD_VERSION :=v1.0.0
release: update-version build-release-image push-image

update-version:
@sed -i "s/__version__/${RELEASE_VERSION}/g" src/backend/main.go
@sed -i "s/__version__/${RELEASE_VERSION}/g" src/frontend/package.json
@sed -i "s/__version__/${RELEASE_VERSION}/g" src/backend/controllers/openapi/openapi.go
./hack/updateversion.sh

# run module
run-backend:
Expand Down
File renamed without changes.
14 changes: 14 additions & 0 deletions hack/updateversion.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh

GO_MAIN=src/backend/main.go
PACKAGE_JSON=src/frontend/package.json
SWAGGER_VERSION_GO=src/backend/controllers/openapi/openapi.go

VERSION=(`grep -Eo "v[0-9]+\.[0-9]+\.[0-9]+[a-z0-9\-]*" ${GO_MAIN}`)
NEXT_VERSION=$(git describe --always --tags)

echo "Project current version: [$VERSION], next_version:[$NEXT_VERSION] "

sed -i "s/$VERSION/$NEXT_VERSION/" ${GO_MAIN}
sed -i 's/\("version": "\)'$VERSION'/\1'$NEXT_VERSION'/' $PACKAGE_JSON
sed -i 's/\(Version: \)'$VERSION'/\1'$NEXT_VERSION'/' $SWAGGER_VERSION_GO