Quellcode durchsuchen

providing single-file releases of last 50 commits automatically via gh-pages

Stasik0 vor 10 Jahren
Ursprung
Commit
d95d48b5d7
4 geänderte Dateien mit 62 neuen und 21 gelöschten Zeilen
  1. 1 1
      .travis.yml
  2. 2 0
      README.md
  3. 0 20
      tools/.deployDoxygen.sh
  4. 59 0
      tools/.deployGH.sh

+ 1 - 1
.travis.yml

@@ -91,7 +91,7 @@ script:
 - coveralls --gcov /usr/bin/gcov-4.8 -E '.*\.h' -E '.*CMakeCXXCompilerId\.cpp' -E '.*CMakeCCompilerId\.c' -r ../
 - cd .. 
 after_success:
-- ./tools/.deployDoxygen.sh
+- ./tools/.deployGH.sh
 - ./tools/.coverity.sh
 before_deploy:
 - rm build -rf && mkdir -p build && cd build

+ 2 - 0
README.md

@@ -19,6 +19,8 @@ For discussion and help, you can use
 - our [IRC channel](http://webchat.freenode.net/?channels=%23open62541)
 - the [bugtracker](https://github.com/acplt/open62541/issues)
 
+Auomated builds of 50 last single-file distributions are available [here](http://open62541.org/releases)
+
 ### Contribute to open62541
 As an open source project, we invite new contributors to help improving open62541. If you are a developer, your bugfixes and new features are very welcome. Note that there are ways to contribute even without deep knowledge of the project or the UA standard:
 - [Report bugs](https://github.com/acplt/open62541/issues)

+ 0 - 20
tools/.deployDoxygen.sh

@@ -1,20 +0,0 @@
-#!/bin/bash
-
-#
-# This script is run by travis-ci and pushes generated
-# Doxygen docs to open62541-www
-#
-
-git fetch origin coverity_scan
-git clone --depth=5 -b gh-pages https://$GITAUTH@github.com/acplt/open62541-www
-cd open62541-www
-git rm -rf doc
-cp -r ../doc ./
-git add -A doc/*
-git config --global user.email "open62541-travis-ci@users.noreply.github.com"
-git config --global user.name "Open62541 travis-ci"
-git config --global push.default simple
-git commit -am "doxygen updated by travis-ci"
-git push https://$GITAUTH@github.com/acplt/open62541-www
-cd ..
-rm -rf open62541-www

+ 59 - 0
tools/.deployGH.sh

@@ -0,0 +1,59 @@
+#!/bin/bash
+
+#
+# This script is run by travis-ci and pushes generated
+# Doxygen docs and single-source distributions to open62541-www
+#
+TAGSTOSAVE=50
+
+#current tag info
+TAG="$(git rev-parse --short=10 HEAD)"
+BRANCH="$(git log --pretty=format:"%d" --date=iso --abbrev=10 --all -1)"
+DATE="$(git log --pretty=format:"%ad" --date=iso --abbrev=10 --all -1)"
+COMMENT="$(git log --pretty=format:"%s" --date=iso --abbrev=10 --all -1)"
+
+git fetch origin coverity_scan
+git clone --depth=5 -b gh-pages https://$GITAUTH@github.com/acplt/open62541-www
+cd open62541-www
+#hanndle releases
+cd releases
+if [ ! -e "$TAG.zip" ]; then
+#add the first line
+echo "<tr><td><a href='./$TAG.zip'>$TAG</a></td><td>$BRANCH</td><td>$DATE</td><td>$COMMENT</td></tr>" | cat - rawtable.txt > temp && mv temp rawtable.txt
+
+#keep top lines only
+head "-$TAGSTOSAVE" rawtable.txt > temp && mv temp rawtable.txt
+
+#compose the index file
+cat head.txt rawtable.txt foot.txt > index.html
+
+#create a zip for single-file release and copy the files
+cp ../../open62541.c .
+cp ../../open62541.h .
+zip -r "$TAG.zip" open62541.c open62541.h
+rm open62541.c
+rm open62541.h
+git add "$TAG.zip"
+
+echo "$TAG.zip" | cat - raw.txt > temp && mv temp raw.txt
+
+LINETOSTART=$((TAGSTOSAVE+1))
+#remove obsolete zips
+tail -n +"$LINETOSTART" raw.txt | xargs git rm
+
+#remove obsolete zips from list
+head "-$TAGSTOSAVE" raw.txt > temp && mv temp raw.txt
+fi
+cd ..
+
+#handle doc
+git rm -r -f doc
+cp -r ../doc ./
+git add -A doc/*
+git config --global user.email "open62541-travis-ci@users.noreply.github.com"
+git config --global user.name "Open62541 travis-ci"
+git config --global push.default simple
+git commit -am "gh-pages updated by travis-ci"
+git push https://$GITAUTH@github.com/acplt/open62541-www
+cd ..
+rm -rf open62541-www