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

Add initial JenkinsFile for redux #528

Merged
merged 4 commits into from Jun 18, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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}'`;'"
}
}