[mapserver-dev] Automated publication of MapServer code coverage

Even Rouault even.rouault at mines-paris.org
Wed Jul 10 07:37:24 PDT 2013


Le mardi 09 juillet 2013 00:08:51, Even Rouault a écrit :
> Le lundi 08 juillet 2013 20:08:18, Jeff McKenna a écrit :
> > Let me know if you need help with the .org part....to be honest I'm not
> > fully understanding how we would do all this yet...but it could be
> > linked somehow from http://www.mapserver.org/development/

ok, some update.

I've changed the script to upload the result in a github repository : 

https://github.com/rouault/msautotest-coverage-results

The HTML pages can be seen at :

http://rawgithub.com/rouault/msautotest-coverage-
results/master/mapserver_coverage_html/home/travis/build/rouault/mapserver/index.html

Compared to the FTP repository, the advantage is that you gain revision on the 
coverage itself (not sure that it will be of much use, but who knows)...

The step of that update is in line with what I described previously :

1) generate a specific ssh key :
ssk-keygen -t rsa -f ~/.ssh/id_rsa-msautotest-coverage-results \
-C https://github.com/rouault/msautotest-coverage-results
2) create the github repository
3) attach a *deploy key* to it : paste the content of the public key generated 
(~/.ssh/id_rsa-msautotest-coverage-results.pub) in the "settings" page of the 
repository (not the account)
4) base64-encode the private key :
base64 ~/.ssh/id_rsa-msautotest-coverage-results ~/.ssh/id_rsa-msautotest-
coverage-results_base64
5) create secured environmenet variables (one per line in id_rsa-msautotest-
coverage-results_base64) with the following python script :

import os
f = open('/home/even/.ssh/id_rsa-msautotest-coverage-results_base64')
i = 0
for l in f.readlines():
    l = l.strip()
    #print(l)
    # indicate with -r the Travis account that will run
    os.system('sh -c "travis encrypt -r rouault/mapserver id_rsa_%02d=%s > 
out.txt 2>/dev/null"' % (i, l))
    f2 = open('out.txt')
    secured = f2.read().strip()
    print('     - secure: %s' % secured)
    f2.close()
    i = i + 1
f.close()

6) copy & paste the output of the script in .travis.yml

Here it is. The 
https://github.com/rouault/mapserver/blob/9ace305a115fe698475c68887052042af7517a1f/run_code_coverage_upload.sh 
script will then reconstruct the private ssh key from the secured 
environmenent variables and then do a git push in the msautotest-coverage-
results repository with the update of the coverage HTML pages. (the commit 
message will link to the mapserver commit that triggered the build)

I believe that such a setup is quite secure. If the ssh key got compromised, 
the impact would be limited to commits in the msautotest-coverage-results 
repository, but shouldn't propagate elsewhere.

Even

-- 
Geospatial professional services
http://even.rouault.free.fr/services.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-dev/attachments/20130710/86283ebd/attachment.html>


More information about the mapserver-dev mailing list