From e0cc920fa6cb44c5fa2251a791a07ddcad8a9a51 Mon Sep 17 00:00:00 2001 From: Thanh Nguyen Date: Wed, 22 Jan 2020 00:25:24 +0700 Subject: [PATCH] Release template-v0.1.0 --- README.md | 2 +- RELEASE-NOTES.md | 2 +- src/main/g8/.gitlab-ci.yml | 158 +++++++++++++++++++-- src/main/g8/be-api/src/gvabe/bootstrap.go | 2 +- src/main/g8/fe-gui/src/utils/api_client.js | 2 +- 5 files changed, 150 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 365d405..a046004 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Giter8 template to develop `Admin Control Panel` in Go with VueJS-based frontend. -Latest release: [template-v0.4.r1](RELEASE-NOTES.md). +Latest release: [template-v0.1.0](RELEASE-NOTES.md). ## Features diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index fb05c95..69e3afe 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -1,6 +1,6 @@ # govueadmin.g8 Release Notes -## 2020-01-20: template-v0.4.r1 +## 2020-01-21: template-v0.1.0 - Frontend using [CoreUI for Vue.js](https://coreui.io/vue/) `v3.0.0-beta.3`. - Backend using [Echo](https://echo.labstack.com) `v4.1.x`. diff --git a/src/main/g8/.gitlab-ci.yml b/src/main/g8/.gitlab-ci.yml index e4fba39..8f5b005 100644 --- a/src/main/g8/.gitlab-ci.yml +++ b/src/main/g8/.gitlab-ci.yml @@ -36,18 +36,48 @@ stages: - docker-build - docker-release -build: +build-fe: stage: build script: - whoami && pwd && date - - cd $APP_ROOT && go build -o main + - cd $APP_ROOT/fe-gui && npm install && npm run build + tags: + ## Define tags if needed + #- gitlabci-build + #- node + +test-fe: + stage: test + script: + - whoami && pwd && date + #- cd $APP_ROOT/fe-gui && npm install && npm run test + tags: + ## Define tags if needed + #- gitlabci-build + #- node + +build-be: + stage: build + script: + - whoami && pwd && date + - cd $APP_ROOT/be-api && go build -o main tags: ## Define tags if needed #- gitlabci-build #- golang -test: +test-be: stage: test + script: + - whoami && pwd && date + #- cd $APP_ROOT/be-api && go test -v -count=1 + tags: + ## Define tags if needed + #- gitlabci-build + #- golang + +build docker image frontend: + stage: docker-build only: # Run ony if commit has tag release-x.y.z.t or staging-x.y.z.t or test-x.y.z.t - /^release-.*$/ @@ -55,13 +85,32 @@ test: - /^test-.*$/ script: - whoami && pwd && date - #- cd $APP_ROOT && go test -v -count=1 + ## Remove --squash if docker's experimental features are not enabled + - cd $APP_ROOT/fe-gui && docker build --force-rm --squash -t $DOCKER_REGISTRY_SERVER/$CI_PROJECT_NAME-fe:$CI_PROJECT_VERSION . + - docker rmi $(docker images -f "dangling=true" -q) + tags: + ## Define tags if needed + #- gitlabci-build + #- node + +build docker image backend: + stage: docker-build + only: + # Run ony if commit has tag release-x.y.z.t or staging-x.y.z.t or test-x.y.z.t + - /^release-.*$/ + - /^staging-.*$/ + - /^test-.*$/ + script: + - whoami && pwd && date + ## Remove --squash if docker's experimental features are not enabled + - cd $APP_ROOT/be-api && docker build --force-rm --squash -t $DOCKER_REGISTRY_SERVER/$CI_PROJECT_NAME-be:$CI_PROJECT_VERSION . + - docker rmi $(docker images -f "dangling=true" -q) tags: ## Define tags if needed #- gitlabci-build #- golang -build docker image: +build docker image all-in-one: stage: docker-build only: # Run ony if commit has tag release-x.y.z.t or staging-x.y.z.t or test-x.y.z.t @@ -70,16 +119,43 @@ build docker image: - /^test-.*$/ script: - whoami && pwd && date - - cd $APP_ROOT && go build -o main ## Remove --squash if docker's experimental features are not enabled - cd $APP_ROOT && docker build --force-rm --squash -t $DOCKER_REGISTRY_SERVER/$CI_PROJECT_NAME:$CI_PROJECT_VERSION . - docker rmi $(docker images -f "dangling=true" -q) + tags: + ## Define tags if needed + #- gitlabci-build + #- golang + +push test frontend to docker registry: + stage: docker-release + only: + - /^test-.*$/ + script: + - whoami && pwd && date + - docker login -u $DOCKER_REGISTRY_USER -p $DOCKER_REGISTRY_PASSWORD $DOCKER_REGISTRY_SERVER + - docker tag ${DOCKER_REGISTRY_SERVER}${DOCKER_REGISTRY_NAMESPACE}/$CI_PROJECT_NAME-fe:$CI_PROJECT_VERSION ${DOCKER_REGISTRY_SERVER}${DOCKER_REGISTRY_NAMESPACE}/$CI_PROJECT_NAME-fe:$CI_PROJECT_VERSION-test + - docker push ${DOCKER_REGISTRY_SERVER}${DOCKER_REGISTRY_NAMESPACE}/$CI_PROJECT_NAME-fe:$CI_PROJECT_VERSION-test tags: ## Define tags if needed #- gitlabci-build - #- golang + when: manual -push test to docker registry: +push test backend to docker registry: + stage: docker-release + only: + - /^test-.*$/ + script: + - whoami && pwd && date + - docker login -u $DOCKER_REGISTRY_USER -p $DOCKER_REGISTRY_PASSWORD $DOCKER_REGISTRY_SERVER + - docker tag ${DOCKER_REGISTRY_SERVER}${DOCKER_REGISTRY_NAMESPACE}/$CI_PROJECT_NAME-be:$CI_PROJECT_VERSION ${DOCKER_REGISTRY_SERVER}${DOCKER_REGISTRY_NAMESPACE}/$CI_PROJECT_NAME-be:$CI_PROJECT_VERSION-test + - docker push ${DOCKER_REGISTRY_SERVER}${DOCKER_REGISTRY_NAMESPACE}/$CI_PROJECT_NAME-be:$CI_PROJECT_VERSION-test + tags: + ## Define tags if needed + #- gitlabci-build + when: manual + +push test all-in-one to docker registry: stage: docker-release only: - /^test-.*$/ @@ -88,12 +164,40 @@ push test to docker registry: - docker login -u $DOCKER_REGISTRY_USER -p $DOCKER_REGISTRY_PASSWORD $DOCKER_REGISTRY_SERVER - docker tag ${DOCKER_REGISTRY_SERVER}${DOCKER_REGISTRY_NAMESPACE}/$CI_PROJECT_NAME:$CI_PROJECT_VERSION ${DOCKER_REGISTRY_SERVER}${DOCKER_REGISTRY_NAMESPACE}/$CI_PROJECT_NAME:$CI_PROJECT_VERSION-test - docker push ${DOCKER_REGISTRY_SERVER}${DOCKER_REGISTRY_NAMESPACE}/$CI_PROJECT_NAME:$CI_PROJECT_VERSION-test + tags: + ## Define tags if needed + #- gitlabci-build + when: manual + +push staging frontend to docker registry: + stage: docker-release + only: + - /^staging-.*$/ + script: + - whoami && pwd && date + - docker login -u $DOCKER_REGISTRY_USER -p $DOCKER_REGISTRY_PASSWORD $DOCKER_REGISTRY_SERVER + - docker tag ${DOCKER_REGISTRY_SERVER}${DOCKER_REGISTRY_NAMESPACE}/$CI_PROJECT_NAME-fe:$CI_PROJECT_VERSION ${DOCKER_REGISTRY_SERVER}${DOCKER_REGISTRY_NAMESPACE}/$CI_PROJECT_NAME-fe:$CI_PROJECT_VERSION-staging + - docker push ${DOCKER_REGISTRY_SERVER}${DOCKER_REGISTRY_NAMESPACE}/$CI_PROJECT_NAME-fe:$CI_PROJECT_VERSION-staging tags: ## Define tags if needed #- gitlabci-build when: manual -push staging to docker registry: +push staging backend to docker registry: + stage: docker-release + only: + - /^staging-.*$/ + script: + - whoami && pwd && date + - docker login -u $DOCKER_REGISTRY_USER -p $DOCKER_REGISTRY_PASSWORD $DOCKER_REGISTRY_SERVER + - docker tag ${DOCKER_REGISTRY_SERVER}${DOCKER_REGISTRY_NAMESPACE}/$CI_PROJECT_NAME-be:$CI_PROJECT_VERSION ${DOCKER_REGISTRY_SERVER}${DOCKER_REGISTRY_NAMESPACE}/$CI_PROJECT_NAME-be:$CI_PROJECT_VERSION-staging + - docker push ${DOCKER_REGISTRY_SERVER}${DOCKER_REGISTRY_NAMESPACE}/$CI_PROJECT_NAME-be:$CI_PROJECT_VERSION-staging + tags: + ## Define tags if needed + #- gitlabci-build + when: manual + +push staging all-in-one to docker registry: stage: docker-release only: - /^staging-.*$/ @@ -102,12 +206,42 @@ push staging to docker registry: - docker login -u $DOCKER_REGISTRY_USER -p $DOCKER_REGISTRY_PASSWORD $DOCKER_REGISTRY_SERVER - docker tag ${DOCKER_REGISTRY_SERVER}${DOCKER_REGISTRY_NAMESPACE}/$CI_PROJECT_NAME:$CI_PROJECT_VERSION ${DOCKER_REGISTRY_SERVER}${DOCKER_REGISTRY_NAMESPACE}/$CI_PROJECT_NAME:$CI_PROJECT_VERSION-staging - docker push ${DOCKER_REGISTRY_SERVER}${DOCKER_REGISTRY_NAMESPACE}/$CI_PROJECT_NAME:$CI_PROJECT_VERSION-staging + tags: + ## Define tags if needed + #- gitlabci-build + when: manual + +push release frontend to docker registry: + stage: docker-release + only: + - /^release-.*$/ + script: + - whoami && pwd && date + - docker login -u $DOCKER_REGISTRY_USER -p $DOCKER_REGISTRY_PASSWORD $DOCKER_REGISTRY_SERVER + - docker tag ${DOCKER_REGISTRY_SERVER}${DOCKER_REGISTRY_NAMESPACE}/$CI_PROJECT_NAME-fe:$CI_PROJECT_VERSION ${DOCKER_REGISTRY_SERVER}${DOCKER_REGISTRY_NAMESPACE}/$CI_PROJECT_NAME-fe:latest + - docker push ${DOCKER_REGISTRY_SERVER}${DOCKER_REGISTRY_NAMESPACE}/$CI_PROJECT_NAME-fe:$CI_PROJECT_VERSION + - docker push ${DOCKER_REGISTRY_SERVER}${DOCKER_REGISTRY_NAMESPACE}/$CI_PROJECT_NAME-fe:latest tags: ## Define tags if needed #- gitlabci-build when: manual -push release to docker registry: +push release backend to docker registry: + stage: docker-release + only: + - /^release-.*$/ + script: + - whoami && pwd && date + - docker login -u $DOCKER_REGISTRY_USER -p $DOCKER_REGISTRY_PASSWORD $DOCKER_REGISTRY_SERVER + - docker tag ${DOCKER_REGISTRY_SERVER}${DOCKER_REGISTRY_NAMESPACE}/$CI_PROJECT_NAME-be:$CI_PROJECT_VERSION ${DOCKER_REGISTRY_SERVER}${DOCKER_REGISTRY_NAMESPACE}/$CI_PROJECT_NAME-be:latest + - docker push ${DOCKER_REGISTRY_SERVER}${DOCKER_REGISTRY_NAMESPACE}/$CI_PROJECT_NAME-be:$CI_PROJECT_VERSION + - docker push ${DOCKER_REGISTRY_SERVER}${DOCKER_REGISTRY_NAMESPACE}/$CI_PROJECT_NAME-be:latest + tags: + ## Define tags if needed + #- gitlabci-build + when: manual + +push release all-in-one to docker registry: stage: docker-release only: - /^release-.*$/ @@ -118,6 +252,6 @@ push release to docker registry: - docker push ${DOCKER_REGISTRY_SERVER}${DOCKER_REGISTRY_NAMESPACE}/$CI_PROJECT_NAME:$CI_PROJECT_VERSION - docker push ${DOCKER_REGISTRY_SERVER}${DOCKER_REGISTRY_NAMESPACE}/$CI_PROJECT_NAME:latest tags: - ## Define tags if needed - #- gitlabci-build + ## Define tags if needed + #- gitlabci-build when: manual diff --git a/src/main/g8/be-api/src/gvabe/bootstrap.go b/src/main/g8/be-api/src/gvabe/bootstrap.go index 5a0cd11..ee330c0 100644 --- a/src/main/g8/be-api/src/gvabe/bootstrap.go +++ b/src/main/g8/be-api/src/gvabe/bootstrap.go @@ -2,7 +2,7 @@ Package gvabe provides backend API for GoVueAdmin Frontend. @author Thanh Nguyen -@since template-v0.4.r1 +@since template-v0.1.0 */ package gvabe diff --git a/src/main/g8/fe-gui/src/utils/api_client.js b/src/main/g8/fe-gui/src/utils/api_client.js index 00a55bd..9d445b1 100644 --- a/src/main/g8/fe-gui/src/utils/api_client.js +++ b/src/main/g8/fe-gui/src/utils/api_client.js @@ -2,7 +2,7 @@ Client to make call to API server using Axios. @author Thanh Nguyen -@since template-v0.4.r1 +@since template-v0.1.0 */ import Axios from "axios" import APP_CONFIG from "./app_config"