Permalink
Browse files

Docs: Add Travis CI + Azure Web App integration

Ref #1037
Close #1238
  • Loading branch information...
molant authored and alrra committed Aug 15, 2018
1 parent 289a172 commit 47f0829b0582943b0df996bd8da24f218a3ed812
@@ -0,0 +1,21 @@
# Development flow integration
`webhint` can be used at different steps of the development flow. The
following are guides that illustrate some of these scenarios and how they
can be achieved. If you have another scenario that is not in here, please
open an issue [in the `webhint`'s GitHub repo][webhint github], so we can
investigate how to support it:
* [Local server][local server]: Test a local instance of your website.
* [Travis CI and Azure Web App][travis azure]: Publish to a staging
environment and automatically deploy to production if there are no issues.
The recommended way to install `webhint` for all these scenarios is as a
`devDependency` (`npm install hint --save-dev`) and that's what it's
assumed in the guides.
<!-- Link labels: -->
[local server]: ./local-server.md
[travis azure]: ./travis-and-azure.md
[webhint github]: https://github.com/webhintio/hint/issues/new
@@ -1,16 +1,4 @@
# Development flow integration
`webhint` can be used at different steps of the development flow. The
following is a guide that ilustrates some of this scenarios and how can
they be achieved. If you have another scenario that is not in here, please
open an issue [on webhint's GitHub repo][webhint github] so we can
investigate how to support it.
The recommended way to install `webhint` for these scenarios is as a
`devDependency` (`npm install hint --save-dev`) and that's what it's
assumed here.
## Test a local server
# Test a local server
In this scenario you want to run `webhint` against a local server that
is running the code you want to test. Usually the tasks to perform can be
@@ -23,7 +11,7 @@ A solution to automate this is via `npm scripts` and the `test` task.
The biggest concern is how to start both tasks and kill the other when
one ends in a multiplatform environment. For example, the following will
not work because `npm start` will start the server, it will not stop
(it's waiting for incoming requests), and thus never executing
(it'll be waiting for incoming requests), and thus never executing
`hint http://localhost:8080`:
```json
@@ -41,8 +29,8 @@ not work because `npm start` will start the server, it will not stop
While there are some solutions like using just `&` or `|`, these don't
work in all platforms (nor is recommended to pipe the output). To solve
this issue you will need to use a package that can start multiple `npm`
tasks simulatenous and coordinate them. [`npm-run-all`][npm-run-all] is
this issue, you will need to use a package that can start multiple `npm`
tasks simultaneously and coordinate them. [`npm-run-all`][npm-run-all] is
one of those.
As an example, the following [`npm script`][npm scripts] will build the
@@ -56,7 +44,7 @@ and once it ends, kill the server started by `http-server`:
"scripts": {
...
"start": "http-server dist -s -g",
"webhint": "^1.0.0",
"hint": "hint http://localhost:8080",
"test": "npm build && npm-run-all -r -p http-server hint",
...
}
@@ -72,3 +60,6 @@ and once it ends, kill the server started by `http-server`:
[npm scripts]: https://docs.npmjs.com/misc/scripts
[npm-run-all]: https://www.npmjs.com/package/npm-run-all
[webhint github]: https://github.com/webhintio/hint/issues/new
[webhint repo]: https://github.com/webhintio/hint/
[webhint.io]: https://webhint.io
[webhintio repo]: https://github.com/webhintio/webhint.io/
Oops, something went wrong.

0 comments on commit 47f0829

Please sign in to comment.