Hello,
When writing automated tasks procedures, it is very convenient to be
able to:
- drive a server such as fossology from remote
- query the same server for results which can be in turn consumed
by automated tasks.
Since there is not yet a REST API to the Fossology server, driving it
from remote can not be done
using just HTTP(S). Nevertheless, it is possible to query or drive the
server from remote if one accepts
to use SSH.
I wrote a few scripts to perform remote operations.
There are available at:
https://heliosplatform.svn.sourceforge.net/svnroot/heliosplatform/fossology-access/trunk/lib
These scripts were developped for the Helios project: http://www.helios-platform.org/
Usage examples
-
Create upload from SVN repository & run analysis on
fossology server provided that:
- there is a SVN repo available via an URL (e.g. svn ls
https://forge/svn/helios/WP4/trunk/foss-access)
- there is an account "fossy" on fossology server (able to
create uploads) we can reach via SSH without password (public key
access)
- there is an upload area on fossology server where to store tree
to analyse
- kernel of machine running foss_create_upload.pl has sshfs
(fuse) enabled and user running the procedure is declared in /etc/group
fuse group.
#
# --ssh: SSH account able to launch job on fossology server
# --upload: upload area where to upload stuff to analyse on fossology
server
# --svnu: SVN user; --svnp: password SVN
# --svn: URL of SVN repo
# --upload-name: unique name of analysis entry in fossology server
(used to retrieve results)
# --rev=1234: target SVN version 1234
# upload_name
./foss_create_upload.pl --ssh=fo...@santos \
--upload=/udir/fossology-upload-area \
--svnu=phil --svnp=xxxx \
--svn_url=https://forge/svn/helios/WP4/trunk/hudson-access \
--rev=1234
helios-v12
Notes:
2- can be done from your account if you have sudo priv (since fossology
account "fossy" is not a login account).
my_account # ssh-keygen -t dsa # to generate public key, answer
return to all questions
my_account # sudo root
root # cat ~my_account/.ssh/id_dsa.pub >>
~fossy/.ssh/authorized_keys
-
Get results of the analysis regarding upload xxx
#
# --ssh: SSH account able to launch job on fossology server
# --foss_url: URL of fossology server (do not forget trailing /)
# --upload-name: unique name of analysis entry in fossology server
# Text output
=-=-=-=-=-=-=
./foss_get_res.pl --ssh=fo...@santos \
--foss_url=http://santos/repo/ --foss_pass=xxxx foss-access-v0
Upload name: foss-access-v0
Analysis URL:
http://santos/repo//?mod=license&show=detail&upload=19&item=165340
2 x 'GNU Free Documentation License v1.2'-style
2 x Apache Software License v2.0
1 x Artistic v1.0
# RDF output
=-=-=-=-=-=-=
./foss_get_res.pl -r --ssh=fo...@santos \
--foss_url=http://santos/repo/ --foss_pass=xxxx foss-access-v0
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:foss="http://helios-platform.org/rdf/foss">
<rdf:Description
rdf:about="foss:results#foss-access-v0">
<foss:analysis>"http://integration/repo//?mod=license&show=detail&upload=19&item=165340"</foss:analysis>
<foss:license foss:count="2">'GNU Free Documentation License
v1.2'-style</foss:license>
<foss:license foss:count="2">Apache Software License
v2.0</foss:license>
<foss:license foss:count="1">Artistic v1.0</foss:license>
</rdf:Description>
</rdf:RDF>
-- Phil
|
_______________________________________________
fossology mailing list
fossology@fossology.org
http://fossology.org/mailman/listinfo/fossology