-
Notifications
You must be signed in to change notification settings - Fork 138
/
post.pir
50 lines (47 loc) · 1.39 KB
/
post.pir
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
#!parrot
# Copyright (C) 2010, Parrot Foundation.
.include 'iglobals.pasm'
.sub 'send_archive_to_smolder' :main
.local pmc config
$P0 = getinterp
config = $P0[.IGLOBALS_CONFIG_HASH]
.local pmc contents
contents = new 'ResizablePMCArray' # by couple
push contents, 'architecture'
$S0 = config['cpuarch']
push contents, $S0
push contents, 'platform'
$S0 = config['osname']
push contents, $S0
push contents, 'revision'
$S0 = config['revision']
push contents, $S0
push contents, 'username'
push contents, 'parrot-autobot'
push contents, 'password'
push contents, 'qa_rocks'
push contents, 'comments'
push contents, "EXPERIMENTAL LWP.pir"
push contents, 'report_file'
$P0 = new 'FixedStringArray'
set $P0, 1
$P0[0] = 't/archive/parrot_test_run.tar.gz'
push contents, $P0
load_bytecode 'LWP/UserAgent.pir'
.const string url = 'http://smolder.parrot.org/app/projects/process_add_report/1'
.local pmc ua, response
ua = new ['LWP';'UserAgent']
ua.'env_proxy'()
ua.'show_progress'(1)
response = ua.'post'(url, contents :flat, 'form-data' :named('Content-Type'), 'close' :named('Connection'))
$I0 = response.'code'()
unless $I0 == 302 goto L1
$S0 = response.'content'()
say $S0
L1:
.end
# Local Variables:
# mode: pir
# fill-column: 100
# End:
# vim: expandtab shiftwidth=4 ft=pir: