Skip to content

Commit 9e25440

Browse files
committed
add swagger-editor-dist deploy code
1 parent 4d05eab commit 9e25440

File tree

7 files changed

+66
-13
lines changed

7 files changed

+66
-13
lines changed

.travis.yml

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,29 @@ branches:
77
only:
88
- master
99
- /^v\d+\.\d+(\.\d+)?(-\S*)?$/
10-
before_deploy: "npm run build-core"
10+
before_deploy:
11+
- "npm run build"
1112
env:
1213
- DOCKER_IMAGE_NAME=swaggerapi/swagger-editor
1314
deploy:
14-
provider: npm
15-
16-
skip_cleanup: true
17-
api_key:
18-
secure: "jFzdukXjNKiESkh/61VUNIYHavpovSKAoVHg4ConrpnYimkrjB13mTB2ZMWXdEbNyUxfI48dYBIlnKRZfwaJ5jZ/rtyQONKslE/SDV1EgEXaL1KPv1rB2mbC3U2YiXV/QuusnmNLdxu8iAqnVcJwuCUMAb11Toq9p2KmAc2Ty8g="
19-
on:
20-
tags: true
21-
repo: swagger-api/swagger-editor
22-
node: '6.9'
15+
- provider: npm
16+
17+
skip_cleanup: true
18+
api_key:
19+
secure: "jFzdukXjNKiESkh/61VUNIYHavpovSKAoVHg4ConrpnYimkrjB13mTB2ZMWXdEbNyUxfI48dYBIlnKRZfwaJ5jZ/rtyQONKslE/SDV1EgEXaL1KPv1rB2mbC3U2YiXV/QuusnmNLdxu8iAqnVcJwuCUMAb11Toq9p2KmAc2Ty8g="
20+
on:
21+
tags: true
22+
repo: swagger-api/swagger-editor
23+
node: '6.9'
24+
- provider: script
25+
skip_cleanup: true
26+
script: swagger-editor-dist-package/deploy.sh
27+
on:
28+
tags: true
29+
repo: swagger-api/swagger-editor
30+
node: '6.9'
2331
after_success:
24-
- if [ $DOCKER_HUB_USERNAME ]; then
32+
- if [ $DOCKER_HUB_USERNAME ]; then
2533
docker login --email=$DOCKER_HUB_EMAIL --username=$DOCKER_HUB_USERNAME --password=$DOCKER_HUB_PASSWORD;
2634

2735
if [ ! -z "$TRAVIS_TAG" ]; then
@@ -39,4 +47,4 @@ after_success:
3947
docker tag $DOCKER_IMAGE_NAME $DOCKER_IMAGE_NAME:$DOCKER_IMAGE_TAG;
4048
docker push $DOCKER_IMAGE_NAME:$DOCKER_IMAGE_TAG;
4149
fi;
42-
fi;
50+
fi;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"react-file-download": "^0.3.2",
5252
"react-redux": "^4.x.x",
5353
"redux": "^3.x.x",
54-
"swagger-ui": "^3.0.6"
54+
"swagger-ui": "^3.0.7"
5555
},
5656
"devDependencies": {
5757
"autoprefixer": "6.6.1",
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
README.md
2+
deploy.sh

swagger-editor-dist-package/.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
//registry.npmjs.org/:_authToken=${NPM_TOKEN}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
This module exposes [Swagger-Editor](https://github.com/swagger-api/swagger-editor)'s entire `dist` folder as a dependency-free npm module.
2+
3+
Use `swagger-editor` instead if you'd like to have npm install dependencies for you.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Deploy `swagger-editor-dist` to npm.
2+
3+
# Parameter Expansion: http://stackoverflow.com/questions/6393551/what-is-the-meaning-of-0-in-a-bash-script
4+
cd "${0%/*}"
5+
6+
# Get UI version
7+
EDITOR_VERSION=$(node -p "require('../package.json').version")
8+
9+
# Replace our version placeholder with UI's version
10+
sed -i "s|\$\$VERSION|$EDITOR_VERSION|g" package.json
11+
12+
# Copy Editor's dist files to our directory
13+
cp ../dist/* .
14+
15+
if [ "$PUBLISH_DIST" = "true" ] || [ "$TRAVIS" = "true" ] ; then
16+
npm publish .
17+
else
18+
npm pack .
19+
fi
20+
21+
find . -not -name .npmignore -not -name .npmrc -not -name deploy.sh -not -name package.json -not -name README.md -not -name *.tgz -delete
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"name": "swagger-editor-dist",
3+
"version": "$$VERSION",
4+
"main": "dist/swagger-editor.js",
5+
"repository": "[email protected]:swagger-api/swagger-editor.git",
6+
"contributors": [
7+
"(in alphabetical order)",
8+
"Anna Bodnia <[email protected]>",
9+
"Buu Nguyen <[email protected]>",
10+
"Josh Ponelat <[email protected]>",
11+
"Kyle Shockey <[email protected]>",
12+
"Robert Barnwell <[email protected]>",
13+
"Sahar Jafari <[email protected]>"
14+
],
15+
"license": "Apache-2.0",
16+
"dependencies": {},
17+
"devDependencies": {}
18+
}

0 commit comments

Comments
 (0)