|
2 | 2 |
|
3 | 3 | # Deploy repository documentation |
4 | 4 |
|
5 | | -# Variables |
6 | | -doc_path="doc" |
7 | | -project_path=${doc_path}/.. |
8 | | -clone_folder=/tmp/update-repos |
9 | | - |
10 | | -repository_name="ping-python" |
11 | | -repository_githash=$(git -C ${project_path} rev-parse HEAD) |
12 | | - |
13 | | -# Functions |
14 | 5 | source ci/ci-functions.sh |
15 | 6 |
|
16 | | -echob "Check git configuration." |
17 | | -if [ "${TRAVIS}" = "true" ] || ! git config --list | grep -q "user.name"; then |
18 | | - # Config for auto-building |
19 | | - echo "- Git configuration does not exist, a new one will be configured." |
20 | | - git config --global user.email "support@bluerobotics.com" |
21 | | - git config --global user.name "BlueRobotics-CI" |
22 | | -else |
23 | | - echo "- Git configuration already exist." |
24 | | -fi |
| 7 | +doc_path="doc" |
| 8 | + |
| 9 | +echob "generating message api..." |
| 10 | +test pip install jinja2 |
| 11 | +test generate/generate-python.py --output-dir=brping |
25 | 12 |
|
26 | 13 | echob "Build doxygen documentation." |
27 | 14 | test cd $doc_path |
28 | 15 | test doxygen Doxyfile |
29 | 16 |
|
30 | 17 | echo "- Check files" |
31 | 18 | ls -A "html/" |
32 | | - |
33 | | -repo_path=${clone_folder}/${repository_name} |
34 | | -echo "- Clone ${repository_name}" |
35 | | -rm -rf ${repo_path} |
36 | | -git clone https://${GITHUB_TOKEN}@github.com/bluerobotics/${repository_name} ${repo_path} |
37 | | -echo "- Checkout gh-pages" |
38 | | -git -C ${clone_folder}/${repository_name} checkout gh-pages |
39 | | - |
40 | | -echob "Update gh-pages" |
41 | | -mv html/* ${repo_path} |
42 | | - |
43 | | -echo "- Check ${repository_name}" |
44 | | -if [[ $(git -C ${repo_path} diff) ]]; then |
45 | | - echo "- Something is different, a commit will be done." |
46 | | - git -C ${repo_path} add --all |
47 | | - COMMIT_MESSAGE="Update autogenerated files |
48 | | -From https://github.com/bluerobotics/ping-protocol/tree/"$repository_githash |
49 | | - git -C ${repo_path} commit -sm "${COMMIT_MESSAGE}" |
50 | | - |
51 | | - echob "Check build type." |
52 | | - # Do not build pull requests |
53 | | - if [ ${TRAVIS_PULL_REQUEST} != "false" ]; then |
54 | | - echo "- Do not deploy PRs." |
55 | | - exit 0 |
56 | | - fi |
57 | | - |
58 | | - echob "Check branch." |
59 | | - # Do only build master branch |
60 | | - if [ ${TRAVIS_BRANCH} != "master" ]; then |
61 | | - echo "- Only master branch will be deployed." |
62 | | - exit 0 |
63 | | - fi |
64 | | - |
65 | | - git -C ${repo_path} push origin gh-pages |
66 | | -else |
67 | | - echo "- Ok." |
68 | | -fi |
0 commit comments