forked from mattermost/mattermost-redux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add initial JenkinsFile for redux (mattermost#528)
* Add initial JenkinsFile for redux * add .eslintignore * update jenkinsFile * set master branch to run the test with live server
- Loading branch information
Showing
2 changed files
with
69 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
**/build/ | ||
**/dist/ | ||
webpack.config.*.js | ||
webpack.config.js | ||
node_modules | ||
config/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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}'`;'" | ||
} | ||
} |