Skip to content
This repository has been archived by the owner on Sep 13, 2022. It is now read-only.

Commit

Permalink
Add initial JenkinsFile for redux (#528)
Browse files Browse the repository at this point in the history
* Add initial JenkinsFile for redux

* add .eslintignore

* update jenkinsFile

* set master branch to run the test with live server
  • Loading branch information
cpanato committed Jun 18, 2018
1 parent 0adf0eb commit 1d4ec99
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .eslintignore
@@ -0,0 +1,6 @@
**/build/
**/dist/
webpack.config.*.js
webpack.config.js
node_modules
config/
63 changes: 63 additions & 0 deletions build/Jenkinsfile
@@ -0,0 +1,63 @@
#!/usr/bin/env groovy

node {
stage('Checkout') {
checkout scm
}

stage('Setup Redux') {
sh """
npm install --ignore-scripts || exit 1
touch .npminstall
"""
}

stage('Check style') {
sh "npm run check || exit 1"
}

stage('Run tests with mock server') {
dir('mattermost-redux') {
sh "npm run test || exit 1"
}
}

stage('Setup') {
when {
branch 'master'
}
environment {
MM_SQLSETTINGS_DATASOURCE="mmuser:mostest@tcp(localhost:3306)/mattermost_test?charset=utf8mb4,utf8|root:passwd@tcp(localhost:3306)/"+ ${BUILD_TAG} + "?charset=utf8mb4,utf8"
MM_TEAMSETTINGS_ENABLEOPENSERVER=true
MM_SERVICESETTINGS_ENABLECUSTOMEMOJI=true
MM_SERVICESETTINGS_ENABLELINKPREVIEWS=true
MM_SERVICESETTINGS_ENABLEOAUTHSERVICEPROVIDER=true
MM_SERVICESETTINGS_ENABLEONLYADMININTEGRATIONS=true
}
sh "docker exec mattermost-mysql-57 mysql --user=root --password=passwd -e 'create database `'$BUILD_TAG'`;'"
echo 'Created database for mysql'

sh """
# Download and configure Mattermost
wget https://releases.mattermost.com/mattermost-platform/master/mattermost-enterprise-linux-amd64.tar.gz
tar -zxf mattermost-enterprise-linux-amd64.tar.gz
cd mattermost
echo mattermost version
bin/mattermost version
# Run Mattermost
bin/mattermost &
"""
echo 'Started Mattermost server'
}

stage('Run tests with real server') {
when {
branch 'master'
}

sh "npm run test-no-mock || exit 1"
sh "docker exec mattermost-mysql-57 mysql --user=root --password=passwd -e 'drop database `'${BUILD_TAG}'`;'"
}
}

0 comments on commit 1d4ec99

Please sign in to comment.