Skip to content

Commit

Permalink
Merge pull request #25 from zanata/clean-jenkinsfile
Browse files Browse the repository at this point in the history
doc: fix typp in readme.md
  • Loading branch information
Alex Eng authored Jul 1, 2017
2 parents b8a1b98 + 7dd457b commit 0020ba8
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 21 deletions.
12 changes: 9 additions & 3 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,15 @@ timestamps {
[[$class : 'UsernamePasswordMultiBinding', credentialsId: 'zanata-jenkins',
usernameVariable: 'GIT_USERNAME', passwordVariable: 'GITHUB_OAUTH2_TOKEN']]) {
sh "git push https://$GIT_USERNAME:$GITHUB_OAUTH2_TOKEN@$MT_GIT_URL $tag"

def apiJson="{\"tag_name\": \"$tag\",\"target_commitish\": \"master\",\"name\": \"$tag\",\"body\": \"Release of version $tag\",\"draft\": false,\"prerelease\": false}"
echo "Create github release: $apiJson"
sh "curl --data '$apiJson' https://api.github.com/repos/zanata/zanata-mt/releases?access_token=$GITHUB_OAUTH2_TOKEN"
}
} else {
currentBuild.result = 'FAILURE'
error('Build failure.')
}

}
stage('Stash') {
stash name: 'generated-files',
Expand Down Expand Up @@ -207,6 +210,9 @@ void dockerBuildAndDeploy(String dockerImage) {

echo "Docker logout.."
sh "docker logout $MT_DOCKER_REGISTRY_URL"

echo "Remove local docker image $dockerImage:$version"
sh "docker rmi $dockerImage:$version"
}
}

Expand Down Expand Up @@ -254,14 +260,14 @@ void deployToStage(String dockerImage) {
}

/**
* Pending permission to deploy to production. 10 days before timeout
* Pending permission to deploy to production. 5 days before timeout
*
* @param dockerImage
*/
void deployToProduction(String dockerImage) {
node (defaultNodeLabel) {
try {
timeout(time: 10, unit: 'DAYS') {
timeout(time: 5, unit: 'DAYS') {
def deployToProd = input(message: 'Deploy docker image to production?',
parameters: [[$class : 'BooleanParameterDefinition', defaultValue: false,
description: '', name: 'Deploy to production?']])
Expand Down
32 changes: 14 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
[![GitHub release](https://img.shields.io/github/release/zanata/zanata-mt.svg?maxAge=3600)](https://github.com/zanata/zanata-mt/releases)
[![Codecov](https://img.shields.io/codecov/c/github/zanata/zanata-mt.svg?maxAge=3600)](https://codecov.io/gh/zanata/zanata-mt)
# Machine translations [![GitHub release](https://img.shields.io/github/release/zanata/zanata-mt.svg?maxAge=3600)](https://github.com/zanata/zanata-mt/releases)

[![Build Status](https://travis-ci.org/zanata/zanata-mt.svg?branch=master)](https://travis-ci.org/zanata/zanata-mt)
[![Codecov](https://img.shields.io/codecov/c/github/zanata/zanata-mt.svg?maxAge=3600)](https://codecov.io/gh/zanata/zanata-mt)

[![jira](https://img.shields.io/badge/issues-Jira-yellow.svg?maxAge=3600)](https://zanata.atlassian.net/projects/ZNTAMT/issues)
[![api](https://img.shields.io/badge/docs-API-brightgreen.svg?maxAge=3600)](http://zanata.org/zanata-mt/apidocs/)
[![license](https://img.shields.io/github/license/zanata/zanata-mt.svg?maxAge=3600)](https://github.com/zanata/zanata-mt/blob/master/LICENSE)

# Build and run
----

## Build and run

Run:
- Package: `mvn clean package` (build and package war file)
- Go to `server` directory
- Docker build: run `mvn docker:build -DskipTests` (build docker image named zanataMT)
- Start docker: `mvn docker:start` (This will start docker **zanataMT** and postgresql **zanataMTDB**)
- Logs: `mvn docker:logs -Ddocker.follow`
- To stop and remove: `mvn docker:stop` (This still stop and remove both containers)
1. Package: `mvn clean package` (build and package war file)
2. Go to `server` directory
3. Docker build: run `mvn docker:build -DskipTests` (build docker image named zanataMT)
4. Start docker: `mvn docker:start` (This will start docker **zanataMT** and postgresql **zanataMTDB**)
5. Logs: `mvn docker:logs -Ddocker.follow`
6. To stop and remove: `mvn docker:stop` (This will stop and remove both containers)

## DEV mode
### DEV mode

DEV mode is enabled when **ZANATA_MT_AZURE_KEY** is not present in environment variable. The service will not use MS backend in this mode but will return wrapped string: 'translated[𠾴 string 𠾴]'.

Expand All @@ -24,13 +27,6 @@ DEV mode is enabled when **ZANATA_MT_AZURE_KEY** is not present in environment v

----

# Documentations

## API

See [here](http://zanata.org/zanata-mt/apidocs) for more information.


## Environment Variables

List of Environment variables that are used in the application.
Expand Down

0 comments on commit 0020ba8

Please sign in to comment.