aboutsummaryrefslogtreecommitdiff
path: root/README.txt
blob: d2231af05adf155df765a8fc1c57566f219d34a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
jenkins-plugin-linaro-pubapi is Jenkins plugin to integrate with Linaro
Publishing API (which is integral part of linaro-license-publishing,
https://git.linaro.org/infrastructure/linaro-license-protection.git).

Integration handled by the plugin is the minimal required to keep
publishing secure, namely requesting a "one-time" publishing token from
the service in a secure manner, actual publishing is handled as a
part of build process using linaro-cp command-line tool
(https://git.linaro.org/ci/publishing-api.git), which allows great
flexibility and easy ways to debug.


Installation and basic testing
------------------------------

1. Install "Linaro Publishing API Token Plugin" - done by Ansible on
production Jenkins hosts, you may need to build plugin and/or install it
manually otherwise.
2. Login to https://snapshots.linaro.org/login/
3. Go to https://snapshots.linaro.org/admin/
4. Browse "Api key stores" table for a key for ci.linaro.org, or create
it (create as "Public")
5. https://ci.linaro.org/configure : search for "Linaro Publishing"
6. Set "Secret key" to value generated in snapshots/admin above.
7. Check values of "not valid before" & "not valid after". For testing
below, you'll need to set "not valid before" to 0.
8. Create a test job, say "newpub-test" (prefix with your username)
9. As first build step, add "Linaro Publish API Token"
10. As 2nd step, add "Execute shell" with script:

echo $PUBLISH_TOKEN

11. Run job, make sure it builds, non-empty value is printed
12. Now replace script content with:

mkdir -p out
echo foo >out/result.txt
wget https://git.linaro.org/ci/publishing-api.git/blob_plain/HEAD:/linaro-cp.py -O linaro-cp.py
python linaro-cp.py out /tmp/$JOB_NAME/$BUILD_NUMBER

(adjust destination path as needed)

13. Run job, make sure it succeeds and files are available on publishing server.
If you get "token no longer valid", adjust "token not valid before" setting in global
config (see above).


Hacking
-------

Use this a reference:
https://wiki.jenkins-ci.org/display/JENKINS/Create+a+new+Plugin+with+a+custom+build+Step

To build project, run:

mvn package

The result is *.hpi file in the target/ directory.