Use CI to update documentation
MODIFY
.travis.yml
.travis.yml
@@ -24,11 +24,34 @@ jobs:
script: npm run test && npm run e2e-test
node_js: "8"
- stage:
- os: linux
+ os: osx
+ if: branch = master
env:
# this is just to indicate in the Travis job list that this is generating docs
- - GENERATE_DOCS=true
- script: npm run generate-docs
+ - GENERATE_DOCS=true GITHUB_TOKEN=$TRIAGER_BOT_TOKEN
+ before_script:
+ - brew install hub
+ - hub --version
+ - git remote set-url origin https://triager:$TRIAGER_BOT_TOKEN@github.com/appium/appium
+ - git reset --hard origin/master
+ - git checkout -b generate-docs-$TRAVIS_COMMIT
+ - npm install
+
+ script:
+ # Generate the docs
+ - npm run generate-docs
+
+ # If no docs were generated, don't do anything
+ - |
+ if [[ -z $(git status -s) ]]; then
+ exit 0
+ fi
+
+ # Make a PR to update the docs
+ - git commit -a -n -m 'Update generated docs [ci skip]'
+ - git push origin generate-docs-$TRAVIS_COMMIT
+ - hub pull-request -b "appium:master" -h "appium:generate-docs-$TRAVIS_COMMIT" -m "Update auto-generated docs"
+
- stage: BinTray Bundle Build and Upload
# only want to run this on the main master branch
if: branch = master AND type != pull_request
@@ -55,3 +78,24 @@ jobs:
# Remove the dev depenedencies
- npm prune
script: npm run zip-and-upload
+ - stage: Update Documentation
+ if: tag
+ os: osx
+ env:
+ - HUB_VERBOSE=true GITHUB_TOKEN=$TRIAGER_BOT_TOKEN
+ before_script:
+ - brew install hub
+ - pip install mkdocs==0.16.3
+
+ # Checkout appium.io repository
+ - git clone https://triager:$TRIAGER_BOT_TOKEN@github.com/appium/appium.io.git --branch=gh-pages && cd appium.io/
+ - git checkout -b docs-$TRAVIS_TAG
+ - bundle install
+ - npm install
+
+ script:
+ # Build the docs and make a PR to get them on appium.io
+ - npm run build:docs
+ - git commit -a -n -m 'Updated docs for latest Appium version'
+ - git push origin docs-$TRAVIS_TAG
+ - hub pull-request -b "appium:gh-pages" -h "appium:docs-$TRAVIS_TAG" -m "Update documentation for latest version" | exit 0 # The PR command works but always returns non-negative

DELETE
docs/en/commands/example.md
-[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/example.yml)
-
-# Template
-
-Brief description
-## Example Usage
-
-```java
-// Java
-MobileElement el = driver.findElementByAccessibilityId("SomeId");
-el.click();
-
-```
-
-```python
-# Python
-el = self.driver.find_element_by_accessibility_id('SomeId')
-el.click();
-
-```
-
-```javascript
-// Javascript
-// webdriver.io example
-await driver.status();
-
-
-
-// wd example
-await driver.status();
-
-```
-
-```ruby
-# Ruby
-# ruby_lib example
-# Ruby Code in ruby_lib here
-
-
-# ruby_lib_core example
-# Ruby Code in ruby_lib_core here
-
-```
-
-```php
-# PHP
-// PHP Code here
-
-```
-
-```csharp
-// C#
-driver.FindElementById("elementId").Click();
-
-```
-
-
-## Description
-
-An indepth description of what this command does
-
-
-## Support
-
-### Appium Server
-
-|Platform|Driver|Platform Versions|Appium Version|Driver Version|
-|--------|----------------|------|--------------|--------------|
-| iOS | [XCUITest](/docs/en/drivers/ios-xcuitest.md) | 1.2 to 9.3 | 1.7 to 1.9 | 1.1 to 9.9 |
-| | [UIAutomation](/docs/en/drivers/ios-uiautomation.md) | 1.0 to 9.3 | All | All |
-| Android | [UiAutomator2](/docs/en/drivers/android-uiautomator2.md) | 8.0+ | 1.6.0+ | All |
-| | [UiAutomator](/docs/en/drivers/android-uiautomator.md) | 4.2+ | All | All |
-| Mac | [Mac](/docs/en/drivers/mac.md) | ?+ | 1.6.4+ | All |
-
-### Appium Clients
-
-|Language|Support|Documentation|
-|--------|-------|-------------|
-|[Java](https://github.com/appium/java-client/releases/latest)| All | [seleniumhq.github.io](https://seleniumhq.github.io/selenium/docs/api/java/org/openqa/selenium/WebElement.html#click--) |
-|[Python](https://github.com/appium/python-client/releases/latest)| All | [Android](https://github.com/appium/python-client/android-command) [iOS](https://github.com/appium/python-client/ios-command) |
-|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| None | |
-|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| None | [github.com](https://github.com/admc/wd/releases) |
-|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [github.com](https://github.com/appium/ruby_lib/releases/latest) |
-|[PHP](https://github.com/appium/php-client/releases/latest)| None | [github.com](https://github.com/appium/php-client/releases/latest-) |
-|[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| None | [github.com](https://github.com/appium/appium) |
-
-## HTTP API Specifications
-
-### Endpoint
-
-`POST /wd/hub/session/:session_id/element/:element_id/click`
-
-### URL Parameters
-
-|name|description|
-|----|-----------|
-|session_id|ID of the session|
-|element_id|ID of the element to blah blah blah|
-
-### JSON Parameters
-
-|name|type|description|
-|----|----|-----------|
-| item | `Object` | Description of Item |
-| item.1 | `String` | Item One description |
-
-### Response
-
-A generic release label (i.e. "2.0rc3") (`string`)
-
-## See Also
-
-* [W3C Specification](https://www.w3.org/TR/webdriver/#element-click)
-* [JSONWP Specification](https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidelementidclick)
-* [Google](http://www.google.com)

Use CI to update documentation (#11731)