Skip to content

Commit a01b593

Browse files
committed
added wraith for travis.
1 parent e909490 commit a01b593

File tree

3 files changed

+76
-26
lines changed

3 files changed

+76
-26
lines changed

.travis.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ php:
66
- "5.4"
77
- "5.3"
88
- "5.2"
9+
matrix:
10+
include:
11+
- php: "7.0"
12+
before_install: chmod +x bin/wraith.sh
13+
install: true
14+
before_script:
15+
env: TEST_SUITE=Wraith_Visual_Regression_Testing WRAITH_FAIL=5
16+
script: ./bin/wraith.sh
917
sudo: false
1018
branches:
1119
except:

bin/wraith.sh

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/bin/bash
2+
WRAITH_SLUG=$(node -pe "require('./package.json').wraithSlug")
3+
WRAITH_FAIL=${WRAITH_FAIL:-5}
4+
body="{
5+
'request': {
6+
'travis_event_type': '$TRAVIS_EVENT_TYPE',
7+
'travis_pull_request': '$TRAVIS_PULL_REQUEST',
8+
'travis_pull_request_branch': '$TRAVIS_PULL_REQUEST_BRANCH',
9+
'travis_pull_request_slug': '$TRAVIS_PULL_REQUEST_SLUG',
10+
'travis_repo_slug': '$TRAVIS_PULL_REQUEST_SLUG',
11+
'travis_branch': '$TRAVIS_PULL_REQUEST_BRANCH',
12+
'wraithSlug': $WRAITH_SLUG,
13+
'wraithFail': $WRAITH_FAIL
14+
}
15+
}"
16+
17+
echo "Triggering build of $TRAVIS_REPO_SLUG branch $TRAVIS_BRANCH on Travis. Calling Wraith API ..."
18+
19+
output=$(curl -sw "%{http_code}" -X POST \
20+
-H "Content-Type: application/json" \
21+
-H "Accept: application/json" \
22+
-H "Travis-API-Version: 3" \
23+
-d "${body//\'/\"}" \
24+
'http://wraith.themeisle.com?api&travis')
25+
26+
http_code="${output:${#output}-3}"
27+
if [ ${#output} -eq 3 ]; then
28+
body=""
29+
else
30+
body="${output:0:${#output}-3}"
31+
fi
32+
33+
if [ $http_code != 200 ]; then
34+
echo "$output";
35+
exit 1
36+
else
37+
echo "$output";
38+
exit 0
39+
fi

package.json

Lines changed: 29 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,31 @@
11
{
2-
"name": "visualizer",
3-
"version": "2.0.4",
4-
"description": "Visualizer Lite",
5-
"repository": {
6-
"type": "git",
7-
"url": "git+https://github.com/Codeinwp/visualizer.git"
8-
},
9-
"keywords": [
10-
"wordpress-plugin"
11-
],
12-
"textdomain": "visualizer",
13-
"category": "plugins",
14-
"author": "ThemeIsle <[email protected]>",
15-
"license": "GPL-2.0+",
16-
"bugs": {
17-
"url": "https://github.com/Codeinwp/visualizer/issues"
18-
},
19-
"pot": {
20-
"reportmsgidbugsto": "https://github.com/Codeinwp/visualizer/issues",
21-
"languageteam": "Themeisle Translate <[email protected]>",
22-
"lasttranslator": "Themeisle Translate Team <[email protected]>"
23-
},
24-
"devDependencies": {
25-
"grunt-plugin-fleet": "codeinwp/grunt-plugin-fleet",
26-
"load-project-config": "~0.2.0"
27-
}
2+
"name": "visualizer",
3+
"version": "2.0.4",
4+
"description": "Visualizer Lite",
5+
"repository": {
6+
"type": "git",
7+
"url": "git+https://github.com/Codeinwp/visualizer.git"
8+
},
9+
"keywords": [
10+
"wordpress-plugin"
11+
],
12+
"textdomain": "visualizer",
13+
"category": "plugins",
14+
"author": "ThemeIsle <[email protected]>",
15+
"license": "GPL-2.0+",
16+
"bugs": {
17+
"url": "https://github.com/Codeinwp/visualizer/issues"
18+
},
19+
"pot": {
20+
"reportmsgidbugsto": "https://github.com/Codeinwp/visualizer/issues",
21+
"languageteam": "Themeisle Translate <[email protected]>",
22+
"lasttranslator": "Themeisle Translate Team <[email protected]>"
23+
},
24+
"devDependencies": {
25+
"grunt-plugin-fleet": "codeinwp/grunt-plugin-fleet",
26+
"load-project-config": "~0.2.0"
27+
},
28+
"wraithSlug": [
29+
"visualizer"
30+
]
2831
}

0 commit comments

Comments
 (0)