Commit 9ba1c685 authored by Matija Obreza's avatar Matija Obreza
Browse files

Merge branch '10-release-1-0' into 'master'

Resolve "Release 1.0"

Closes #10

See merge request !8
parents 2c07ba15 6f6023bd
variables:
PRODUCT_VERSION: "1.0-SNAPSHOT"
PRODUCT_VERSION: "1.1"
DOCKER_HOST: "genesys1.swarm.genesys-pgr.org"
stages:
......@@ -14,6 +14,7 @@ run tests in branches:
- MAVEN_OPTS="${MAVEN_OPTS} -Dorg.slf4j.simpleLogger.defaultLogLevel=warn" mvn test -B -U
except:
- master
- /^validator\-web\-/
build:
stage: compile
......@@ -22,6 +23,7 @@ build:
- MAVEN_OPTS="${MAVEN_OPTS} -Dorg.slf4j.simpleLogger.defaultLogLevel=warn" mvn package -B -U
only:
- master
- /^validator\-web\-/
artifacts:
name: "${CI_PROJECT_NAME}-${CI_COMMIT_REF_NAME}"
expire_in: 1 day
......@@ -46,9 +48,9 @@ build:
# Actions
- cp target/*.war docker
- cd docker
- ${DOCKER_CMD} build -t ${CI_REGISTRY_IMAGE}:${PRODUCT_VERSION} .
- ${DOCKER_CMD} build -t ${CI_REGISTRY_IMAGE}:${PRODUCT_VERSION}-${CI_COMMIT_REF_SLUG} .
- ${DOCKER_CMD} login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- ${DOCKER_CMD} push ${CI_REGISTRY_IMAGE}:${PRODUCT_VERSION}
- ${DOCKER_CMD} push ${CI_REGISTRY_IMAGE}:${PRODUCT_VERSION}-${CI_COMMIT_REF_SLUG}
- ${DOCKER_CMD} logout $CI_REGISTRY
dockerize web app:
......@@ -58,16 +60,45 @@ dockerize web app:
- build
only:
- master
- /^validator\-web\-/
deploy on server:
deploy on sandbox:
stage: deploy
image: docker:latest
only:
- master
- /^validator\-web\-/
variables:
GIT_STRATEGY: none
before_script:
# Address the swarm
- export DOCKER_HOST=swarm.genesys-pgr.org
# Configuration
- TLS_PATH=~/.docker/${DOCKER_HOST}/certs && mkdir -p ${TLS_PATH}
- echo "${DOCKER_TLS_CA}" > ${TLS_PATH}/ca.pem
- echo "${DOCKER_TLS_KEY}" > ${TLS_PATH}/key.pem
- echo "${DOCKER_TLS_CERT}" > ${TLS_PATH}/cert.pem
- export DOCKER_TLS_VERIFY=1
- export DOCKER_CERT_PATH=${TLS_PATH}
- DOCKER_CMD=docker
script:
- echo Deploying to server
# Actions
- ${DOCKER_CMD} service update --image ${CI_REGISTRY_IMAGE}:${PRODUCT_VERSION}-${CI_COMMIT_REF_SLUG} validator_sandbox
environment:
name: sandbox
url: https://sandbox.genesys-pgr.org/validator/
deploy on production:
stage: deploy
image: docker:latest
only:
- /^validator\-web\-/
when: manual
variables:
GIT_STRATEGY: none
before_script:
# Address the swarm
- export DOCKER_HOST=swarm.genesys-pgr.org
# Configuration
......@@ -78,8 +109,10 @@ deploy on server:
- export DOCKER_TLS_VERIFY=1
- export DOCKER_CERT_PATH=${TLS_PATH}
- DOCKER_CMD=docker
script:
- echo Deploying to production
# Actions
- ${DOCKER_CMD} service update --image ${CI_REGISTRY_IMAGE}:${PRODUCT_VERSION} validator_server
- ${DOCKER_CMD} service update --image ${CI_REGISTRY_IMAGE}:${PRODUCT_VERSION}-${CI_COMMIT_REF_SLUG} validator_production
environment:
name: validator
url: https://sandbox.genesys-pgr.org/validator/
name: production
url: https://www.genesys-pgr.org/validator/
......@@ -6,7 +6,7 @@
<packaging>war</packaging>
<artifactId>validator-web</artifactId>
<name>The Validator</name>
<version>1.0-SNAPSHOT</version>
<version>1.1-SNAPSHOT</version>
<properties>
<jstl.version>1.2</jstl.version>
......@@ -17,8 +17,8 @@
<jdk.target>1.8</jdk.target>
<jdk.source>1.8</jdk.source>
<commons-lang3.version>3.3.2</commons-lang3.version>
<genesys-geotools.version>1.0-SNAPSHOT</genesys-geotools.version>
<taxonomy-tools.version>1.1-SNAPSHOT</taxonomy-tools.version>
<genesys-geotools.version>1.1-SNAPSHOT</genesys-geotools.version>
<taxonomy-tools.version>1.2-SNAPSHOT</taxonomy-tools.version>
</properties>
<licenses>
......@@ -47,11 +47,17 @@
</developers>
<scm>
<connection>git@gitlab.croptrust.org:genesys-pgr/validator.git</connection>
<developerConnection>scm:git@gitlab.croptrust.org:genesys-pgr/validator.git</developerConnection>
<url>https://gitlab.croptrust.org/genesys-pgr/validator</url>
<connection>https://gitlab.croptrust.org/genesys-pgr/validator.git</connection>
<developerConnection>scm:git:git@gitlab.croptrust.org:genesys-pgr/validator.git</developerConnection>
<url>scm:git:git@gitlab.croptrust.org:genesys-pgr/validator.git</url>
<tag>HEAD</tag>
</scm>
<issueManagement>
<url>https://gitlab.croptrust.org/genesys-pgr/validator/issues</url>
<system>Gitlab</system>
</issueManagement>
<build>
<plugins>
<!--maven-compiler-plugin-->
......@@ -88,6 +94,14 @@
<jvmArgs>-Djava.awt.headless=true -server</jvmArgs>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.3</version>
<configuration>
<pushChanges>false</pushChanges>
</configuration>
</plugin>
</plugins>
<resources>
......@@ -136,8 +150,6 @@
<version>${commons-lang3.version}</version>
</dependency>
<!--spring-->
<dependency>
<groupId>org.springframework</groupId>
......@@ -181,7 +193,6 @@
</dependency>
</dependencies>
<repositories>
<repository>
<id>central</id>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment