Skip to content

Commit 5db817a

Browse files
committed
1.10.0: Merge branch 'dev'
2 parents 75a2cd0 + a429163 commit 5db817a

File tree

140 files changed

+9866
-1951
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

140 files changed

+9866
-1951
lines changed

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
11
.pioenvs
22
.piolibdeps
3+
.pio
34
.clang_complete
45
.gcc-flags.json
6+
.sconsign.dblite
57
/web/node_modules
68
/web/build
9+
/web/package-lock.json
710
/dist/*.bin
11+
/dist/docs
812
.vscode/
913
.vscode/.browse.c_cpp.db*
1014
.vscode/c_cpp_properties.json
1115
.vscode/launch.json
16+
/test/remote/settings.json
17+
/test/remote/espmh.env
18+
19+
web/package-lock\.json

.prepare_docs

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
#!/usr/bin/env bash
2+
3+
# This script sets up API documentation bundles for deployment to Github Pages.
4+
# It expects the following structure:
5+
#
6+
# In development branches:
7+
#
8+
# * ./docs/openapi.yaml - OpenAPI spec in
9+
# * ./docs/gh-pages - Any assets that should be copied to gh-pages root
10+
#
11+
# In Github Pages, it will generate:
12+
#
13+
# * ./ - Files from ./docs/gh-pages will be copied
14+
# * ./branches/<branch>/... - Deployment bundles including an index.html
15+
# and a snapshot of the Open API spec.
16+
17+
set -eo pipefail
18+
19+
prepare_docs_log() {
20+
echo "[prepare docs release] -- $@"
21+
}
22+
23+
# Only run for tagged commits
24+
if [ -z "$(git tag -l --points-at HEAD)" ]; then
25+
prepare_docs_log "Skipping non-tagged commit."
26+
exit 0
27+
fi
28+
29+
DOCS_DIR="./docs"
30+
DIST_DIR="./dist/docs"
31+
BRANCHES_DIR="${DIST_DIR}/branches"
32+
API_SPEC_FILE="${DOCS_DIR}/openapi.yaml"
33+
34+
rm -rf "${DIST_DIR}"
35+
36+
redoc_bundle_file=$(mktemp)
37+
git_ref_version=$(git describe --always)
38+
branch_docs_dir="${BRANCHES_DIR}/${git_ref_version}"
39+
40+
# Build Redoc bundle (a single HTML file)
41+
redoc-cli bundle ${API_SPEC_FILE} -o ${redoc_bundle_file} --title 'Milight Hub API Documentation'
42+
43+
# Check out current stuff from gh-pages (we'll append to it)
44+
git fetch origin 'refs/heads/gh-pages:refs/heads/gh-pages'
45+
git checkout gh-pages -- branches || prepare_docs_log "Failed to checkout branches from gh-pages, skipping..."
46+
47+
if [ -e "./branches" ]; then
48+
mkdir -p "${DIST_DIR}"
49+
mv "./branches" "${BRANCHES_DIR}"
50+
else
51+
mkdir -p "${BRANCHES_DIR}"
52+
fi
53+
54+
if [ -e "${DOCS_DIR}/gh-pages" ]; then
55+
cp -r ${DOCS_DIR}/gh-pages/* "${DIST_DIR}"
56+
else
57+
prepare_docs_log "Skipping copy of gh-pages dir, doesn't exist"
58+
fi
59+
60+
# Create the docs bundle for our ref. This will be the redoc bundle + a
61+
# snapshot of the OpenAPI spec
62+
mkdir -p "${branch_docs_dir}"
63+
cp "${API_SPEC_FILE}" "${branch_docs_dir}"
64+
cp "${redoc_bundle_file}" "${branch_docs_dir}/index.html"
65+
66+
# Update `latest` symlink to this branch
67+
rm -rf "${BRANCHES_DIR}/latest"
68+
ln -s "${git_ref_version}" "${BRANCHES_DIR}/latest"
69+
70+
# Create a JSON file containing a list of all branches with docs (we'll
71+
# have an index page that renders the list).
72+
ls "${BRANCHES_DIR}" | jq -Rc '.' | jq -sc '.' > "${DIST_DIR}/branches.json"

.prepare_release

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ prepare_log() {
66
echo "[prepare release] -- $@"
77
}
88

9-
if ! git describe --exact-match HEAD 2>/dev/null; then
9+
if [ -z "$(git tag -l --points-at HEAD)" ]; then
1010
prepare_log "Skipping non-tagged commit."
1111
exit 0
1212
fi
@@ -17,7 +17,13 @@ prepare_log "Preparing release for tagged version: $VERSION"
1717

1818
mkdir -p dist
1919

20-
for file in $(ls .pioenvs/**/firmware.bin); do
20+
if [ -d .pio/build ]; then
21+
firmware_prefix=".pio/build"
22+
else
23+
firmware_prefix=".pioenvs"
24+
fi
25+
26+
for file in $(ls ${firmware_prefix}/**/firmware.bin); do
2127
env_dir=$(dirname "$file")
2228
env=$(basename "$env_dir")
2329

.travis.yml

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,36 @@ cache:
66
directories:
77
- "~/.platformio"
88
env:
9-
- NODE_VERSION="6"
9+
- NODE_VERSION="10"
1010
before_install:
1111
- nvm install $NODE_VERSION
1212
install:
13-
- pip install -U https://github.com/platformio/platformio-core/archive/develop.zip
13+
- pip install -U platformio
1414
- platformio lib install
1515
- cd web && npm install && cd ..
16+
- npm install -g swagger-cli redoc-cli
1617
script:
18+
- swagger-cli validate ./docs/openapi.yaml
1719
- platformio run
1820
before_deploy:
1921
- ./.prepare_release
22+
- ./.prepare_docs
2023
deploy:
21-
provider: releases
22-
prerelease: true
23-
api_key:
24-
secure: p1BjM1a/u20EES+pl0+w7B/9600pvpcVYTfMiZhyMOXB0MbNm+uZKYeqiG6Tf3A9duVqMtn0R+ROO+YqL5mlnrVSi74kHMxCIF2GGtK7DIReyEI5JeF5oSi5j9bEsXu8602+1Uez8tInWgzdu2uK2G0FJF/og1Ygnk/L3haYIldIo6kL+Yd6Anlu8L2zqiovC3j3r3eO8oB6Ig6sirN+tnK0ah3dn028k+nHQIMtcc/hE7dQjglp4cGOu+NumUolhdwLdFyW7vfAafxwf9z/SL6M14pg0N8qOmT4KEg4AZQDaKn0wT7VhAvPDHjt4CgPE7QsZhEKFmW7J9LGlcWN4X3ORMkBNPnmqrkVeZEE4Vlcm3CF5kvt59ks0qwEgjpvrqxdZZxa/h9ZLEBBEXMIekA4TSAzP/e/opfry11N1lvqXQ562Jc6oEKS+xWerWSALXyZI4K1T+fkgHTZCWGH4EI3weZY/zSCAZ6a7OpgFQWU9uHlJLMkaWrp78fSPqy6zcjxhXoJnBt8BT1BMRdmZum2YX91hfJ9aRvlEmhtxKgAcPgpJ0ITwB317lKh5VqAfMNZW7pXJEYdLCmUEKXv/beTvNmRIGgu1OjZ3BWchOgh/TwX46+Lrx1zL69sfE+6cBFbC+T2QIv4dxxSQNC1K0JnRVhbD1cOpSXz+amsLS0=
25-
file_glob: true
26-
skip_cleanup: true
27-
file: dist/*.bin
28-
on:
29-
repo: sidoh/esp8266_milight_hub
30-
tags: true
24+
- provider: releases
25+
prerelease: true
26+
api_key:
27+
secure: p1BjM1a/u20EES+pl0+w7B/9600pvpcVYTfMiZhyMOXB0MbNm+uZKYeqiG6Tf3A9duVqMtn0R+ROO+YqL5mlnrVSi74kHMxCIF2GGtK7DIReyEI5JeF5oSi5j9bEsXu8602+1Uez8tInWgzdu2uK2G0FJF/og1Ygnk/L3haYIldIo6kL+Yd6Anlu8L2zqiovC3j3r3eO8oB6Ig6sirN+tnK0ah3dn028k+nHQIMtcc/hE7dQjglp4cGOu+NumUolhdwLdFyW7vfAafxwf9z/SL6M14pg0N8qOmT4KEg4AZQDaKn0wT7VhAvPDHjt4CgPE7QsZhEKFmW7J9LGlcWN4X3ORMkBNPnmqrkVeZEE4Vlcm3CF5kvt59ks0qwEgjpvrqxdZZxa/h9ZLEBBEXMIekA4TSAzP/e/opfry11N1lvqXQ562Jc6oEKS+xWerWSALXyZI4K1T+fkgHTZCWGH4EI3weZY/zSCAZ6a7OpgFQWU9uHlJLMkaWrp78fSPqy6zcjxhXoJnBt8BT1BMRdmZum2YX91hfJ9aRvlEmhtxKgAcPgpJ0ITwB317lKh5VqAfMNZW7pXJEYdLCmUEKXv/beTvNmRIGgu1OjZ3BWchOgh/TwX46+Lrx1zL69sfE+6cBFbC+T2QIv4dxxSQNC1K0JnRVhbD1cOpSXz+amsLS0=
28+
file_glob: true
29+
skip_cleanup: true
30+
file: dist/*.bin
31+
on:
32+
repo: sidoh/esp8266_milight_hub
33+
tags: true
34+
- provider: pages
35+
skip_cleanup: true
36+
local_dir: dist/docs
37+
github_token: $GITHUB_TOKEN
38+
keep_history: true
39+
on:
40+
repo: sidoh/esp8266_milight_hub
41+
tags: true

0 commit comments

Comments
 (0)