Spring boot Project deploy

通过在Vm参数中加: -Dspring.profiles.active=dev 来指定当前环境的配置文件

idea 详细配置过程见 构建教程.mp4

1
2

mvn clen install -Dspring.profiles.active=dev

阅读全文

zsh Tips

ZSH使用技巧

1. ‘cd’命令的自动补全
1
cd <TAB>

阅读全文

GitLab-CI之Maven

Maven 项目通过GitLab-Ci做自动构建和自动发布的配置如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# This file is a template, and might need editing before it works on your project.
---
# Build JAVA applications using Apache Maven (http://maven.apache.org)
# For docker image tags see https://hub.docker.com/_/maven/
#
# For general lifecycle information see https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html
#
# This template will build and test your projects as well as create the documentation.
#
# * Caches downloaded dependencies and plugins between invocation.
# * Does only verify merge requests but deploy built artifacts of the
# master branch.
# * Shows how to use multiple jobs in test stage for verifying functionality
# with multiple JDKs.
# * Uses site:stage to collect the documentation for multi-module projects.
# * Publishes the documentation for `master` branch.

variables:
# This will supress any download for dependencies and plugins or upload messages which would clutter the console log.
# `showDateTime` will show the passed time in milliseconds. You need to specify `--batch-mode` to make this work.
MAVEN_OPTS: "-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true"
# As of Maven 3.3.0 instead of this you may define these options in `.mvn/maven.config` so the same config is used
# when running from the command line.
# `installAtEnd` and `deployAtEnd`are only effective with recent version of the corresponding plugins.
MAVEN_CLI_OPTS: "--batch-mode --errors --fail-at-end --show-version -B"
JAVA_HOME: "/usr/local/java8"

# Cache downloaded dependencies and plugins between builds.
#cache:
# paths:
# - /home/gitlab-runner/.m2/repository/

stages:
- build
- deployJar
- deploy

# 快照版构建和部署测试
snapshoot-build:
stage: build
only:
- develop
- release/*
tags:
- "development environment 252"
script:
'mvn $MAVEN_CLI_OPTS clean install -Dmaven.test.skip=true -Dspring.profiles.active=dev'
artifacts:
paths:
- xmx-base/target/*.jar

snapshoot-deploy-jar:
stage: deployJar
only:
- develop
- release/*
tags:
- "development environment 252"
script:
- 'mvn deploy -Dmaven.test.skip=true -Dspring.profiles.active=dev'

snapshoot-deploy:
stage: deploy
only:
- develop
- release/*
tags:
- "development environment 252"
script:
- 'sh /home/app-deploy-test.sh'

阅读全文

GitLab-CI 之 Nodejs

NodeJs 项目通过GitLab-Ci做自动构建和自动发布的配置如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# This file is a template, and might need editing before it works on your project.
---
# Build JAVA applications using Apache Maven (http://maven.apache.org)
# For docker image tags see https://hub.docker.com/_/maven/
#
# For general lifecycle information see https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html
#
# This template will build and test your projects as well as create the documentation.
#
# * Caches downloaded dependencies and plugins between invocation.
# * Does only verify merge requests but deploy built artifacts of the
# master branch.
# * Shows how to use multiple jobs in test stage for verifying functionality
# with multiple JDKs.
# * Uses site:stage to collect the documentation for multi-module projects.
# * Publishes the documentation for `master` branch.

variables:
# This will supress any download for dependencies and plugins or upload messages which would clutter the console log.
# `showDateTime` will show the passed time in milliseconds. You need to specify `--batch-mode` to make this work.
# NODE_PATH: "/usr/local/node"
# PATH: "$PATH:$NODE_PATH/bin"

# Cache downloaded dependencies and plugins between builds.
#cache:
# paths:
# - /home/gitlab-runner/.m2/repository/
# build stages
stages:
- eslint
- build
- deploy

before_script:
# - 'npm install --progress=false'
# - 'npm install -g cnpm --registry=https://registry.npm.taobao.org'
- 'cnpm install'
- echo "Start Build"

eslint-check:
stage: eslint
script:
- 'npm run lint'
only:
- develop
tags:
- "development environment 252"

build-site:
stage: build
only: # 指定那个分支
- develop
tags: # 指定 GitLab-CI runner 通过标签匹配
- "development environment 252"
script:
- 'npm run build:test'
artifacts:
expire_in: 1 week
paths:
- dist
deploy:
stage: deploy
only: # 指定那个分支
- develop
tags:
- "development environment 252"
script:
- 'sh /home/vote-deploy-test.sh'

阅读全文

I'm Huzi Blog

我以前的踪迹: 网易博客-{‘coding’: ‘life’} ,oschina博客

阅读全文

Mac 情

11年开始在linux(debian)下开发,因为喜欢linux, 之后也一直在linux下开发。13年开始花了血本买了mac,

给自己的理由就是要学iOS开发,但是买了mac和iphon之后,也没有写过一行OC的代码,在买mac之前,还尝试过黑苹果,把小黑装上mac系统,但是实在是卡的不行。
mac继承了unix的血统,又有非常好的图形化界面,对于习惯了linux的人来说,是非常向往的,mac上有很多好用的工具和软件也非常爽。
接下来慢慢整理自己使用过的软件和工具。

阅读全文

Postgresql generate_series 函数应用

PostgreSQL 中有一个很有用处的内置函数generate_series,可以按不同的规则产生一系列的填充数据,具体语法见:官方文档

阅读全文

关于spring-boot的一切都在这里

关于spring-boot的一切都在这里,很早就想写这个题目,只是一直没写,今天是周六很热没有去公司,加上需要做团队分享,然后就在家整理整理spring-boot相关的技术分享,也顺便发一篇博客。
Spring Boot是由Pivotal团队提供的全新框架,其设计目的是用来简化新Spring应用的初始搭建以及开发过程。该框架使用了特定的方式来进行配置,从而使开发人员不再需要定义样板化的配置。spring 使用过程中,基本上是少不了xml的配置,但在Spring Boot中 没有任何xml的配置,这并不是说Spring Boot不需要配置,而是他将配置集中化 通一个 propertes或者ymal文件完成。
开始Spring Boot 要深刻知道 Spring Boot 并不是全新的框架,他只是将Spring系列组件进行整合,简化开发。就像Rails这类框架一样,可以快速开始一个项目,好了,接下来让我们 以maven为基础使用Spring Boot开始一个java web项目。

阅读全文

spring cloud相关资料

Spring Cloud 主要是针对Netflex微服务相关组件进行了封装,所以在使用Spring Cloud 开发微服务会特别方便,以下主要整理相关资料。

源码解读
http://www.idouba.net/topics/microservice/

阅读全文

基于 spring 做oauth2 认证服务

阅读全文