This repository has been archived by the owner on Dec 1, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest-data.sh
192 lines (128 loc) · 13.5 KB
/
test-data.sh
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
############################################################################
#
# (C) Copyright IBM Corp. 2018
#
# This program and the accompanying materials are made available
# under the terms of the Apache License v2.0 which accompanies
# this distribution.
#
# The Apache License v2.0 is available at
# http://www.opensource.org/licenses/apache2.0.php
#
# Contributors:
# Multiple authors (IBM Corp.) - initial implementation and documentation
############################################################################
export TOKEN=$(node fetch-token.js);
# This is done by node initialise.js
# curl -X POST --header 'Content-Type: application/json' --header "Authorization: ${TOKEN}" \
# -d '{"arch": "x64"}' "http://${HOST}/api/Architectures"
# curl -X POST --header 'Content-Type: application/json' --header "Authorization: ${TOKEN}" \
# -d '{"distro": "ubuntu-16.04"}' "http://${HOST}/api/Distributions"
# curl -X POST --header 'Content-Type: application/json' --header "Authorization: ${TOKEN}" \
# -d '{"os": "linux"}' "http://${HOST}/api/OperatingSystems"
# curl -X POST --header 'Content-Type: application/json' --header "Authorization: ${TOKEN}" \
# -d '{"os": "linux","arch": "x64","distro": "ubuntu-16.04"}' "http://${HOST}/api/ValidPlatforms"
# curl -X POST --header 'Content-Type: application/json' --header "Authorization: ${TOKEN}" \
# -d '{"node_version": "v6.14.3","lts_version_id": 1}' "http://${HOST}/api/NodeVersions"
# curl -X POST --header 'Content-Type: application/json' --header "Authorization: ${TOKEN}" \
# -d '{"node_version": "v8.11.3","lts_version_id": 2}' "http://${HOST}/api/NodeVersions"
# curl -X POST --header 'Content-Type: application/json' --header "Authorization: ${TOKEN}" \
# -d '{"lts_version": 6}' "http://${HOST}/api/LTSVersions"
# curl -X POST --header 'Content-Type: application/json' --header "Authorization: ${TOKEN}" \
# -d '{"lts_version": 8}' "http://${HOST}/api/LTSVersions"
echo "#------------------------------- New Node Versions -------------------------------\n"
curl -X POST --header 'Content-Type: application/json' --header "Authorization: ${TOKEN}" \
-d '{"node_version": "v6.14.4","lts_version_id": 1}' "http://${HOST}/api/NodeVersions"
curl -X POST --header 'Content-Type: application/json' --header "Authorization: ${TOKEN}" \
-d '{"node_version": "v8.12.0","lts_version_id": 2}' "http://${HOST}/api/NodeVersions"
echo "\n\nAdded New Node Versions"
echo "#------------------------------- @Cloudant/cloudant -------------------------------\n"
curl -X POST --header 'Content-Type: application/json' -H "Authorization: ${TOKEN}" \
-d '{"name":"@cloudant/cloudant","stability":"LTS Adopted","commercial_support":["IBM"]}' "http://${HOST}/api/Modules"
curl -X POST --header 'Content-Type: application/json' --header "Authorization: ${TOKEN}" \
-d '{"module": "@cloudant/cloudant","module_major_version": "2.x","module_version": "2.4.0","license": "Apache-2.0","deps_ids": "string","deps_licenses": "string","deps_licenses_count": 0,"timestamp": "2018-08-22T12:43:53.871Z"}' "http://${HOST}/api/ModuleVersions"
curl -X POST --header 'Content-Type: application/json' --header "Authorization: ${TOKEN}" \
-d '{"module": "@cloudant/cloudant","module_major_version": "2.x","module_version": "2.3.0","license": "Apache-2.0","deps_ids": "string","deps_licenses": "string","deps_licenses_count": 0,"timestamp": "2018-08-22T12:43:53.871Z"}' "http://${HOST}/api/ModuleVersions"
curl -X POST --header 'Content-Type: application/json' --header "Authorization: ${TOKEN}" \
-d '{"arch_id": 1,"distro_id": 2,"os_id": 2,"node_version_id": 3,"module": "@cloudant/cloudant","module_version": "2.4.0","code_coverage": 92,"passed": false}' "http://${HOST}/api/ModuleVersionTests"
curl -X POST --header 'Content-Type: application/json' --header "Authorization: ${TOKEN}" \
-d '{"arch_id": 3,"distro_id": 1,"os_id": 1,"node_version_id": 3,"module": "@cloudant/cloudant","module_version": "2.4.0","code_coverage": 92,"passed": false}' "http://${HOST}/api/ModuleVersionTests"
curl -X POST --header 'Content-Type: application/json' --header "Authorization: ${TOKEN}" \
-d '{"arch_id": 2,"distro_id": 1,"os_id": 1,"node_version_id": 3,"module": "@cloudant/cloudant","module_version": "2.4.0","code_coverage": 92,"passed": false}' "http://${HOST}/api/ModuleVersionTests"
curl -X POST --header 'Content-Type: application/json' --header "Authorization: ${TOKEN}" \
-d '{"arch_id": 1,"distro_id": 1,"os_id": 1,"node_version_id": 3,"module": "@cloudant/cloudant","module_version": "2.4.0","code_coverage": 92,"passed": false}' "http://${HOST}/api/ModuleVersionTests"
curl -X POST --header 'Content-Type: application/json' --header "Authorization: ${TOKEN}" \
-d '{"arch_id": 1,"distro_id": 1,"os_id": 1,"node_version_id": 4,"module": "@cloudant/cloudant","module_version": "2.4.0","code_coverage": 92,"passed": true}' "http://${HOST}/api/ModuleVersionTests"
curl -X POST --header 'Content-Type: application/json' --header "Authorization: ${TOKEN}" \
-d '{"arch_id": 1,"distro_id": 2,"os_id": 2,"node_version_id": 3,"module": "@cloudant/cloudant","module_version": "2.3.0","code_coverage": 92,"passed": false}' "http://${HOST}/api/ModuleVersionTests"
curl -X POST --header 'Content-Type: application/json' --header "Authorization: ${TOKEN}" \
-d '{"lts_version_id": 1,"module": "@cloudant/cloudant","recommended_version": "2.x"}' "http://${HOST}/api/ModuleRecommendedLTSs"
curl -X POST --header 'Content-Type: application/json' --header "Authorization: ${TOKEN}" \
-d '{"lts_version_id": 2,"module": "@cloudant/cloudant","recommended_version": "2.x"}' "http://${HOST}/api/ModuleRecommendedLTSs"
echo "\n\nAdded @cloudant/cloudant"
echo "#------------------------------- Appmetrics -------------------------------\n"
curl -X POST --header 'Content-Type: application/json' -H "Authorization: ${TOKEN}" \
-d '{"name":"appmetrics","stability":"LTS Adopted","commercial_support":["IBM"]}' "http://${HOST}/api/Modules"
curl -X POST --header 'Content-Type: application/json' --header "Authorization: ${TOKEN}" \
-d '{"module": "appmetrics","module_major_version": "4.x","module_version": "4.0.0","license": "Apache-2.0","deps_ids": "string","deps_licenses": "string","deps_licenses_count": 0,"timestamp": "2018-08-22T12:43:53.871Z"}' "http://${HOST}/api/ModuleVersions"
curl -X POST --header 'Content-Type: application/json' --header "Authorization: ${TOKEN}" \
-d '{"arch_id": 1,"distro_id": 1,"os_id": 1,"node_version_id": 3,"module": "appmetrics","module_version": "4.0.0","code_coverage": 50,"passed": true}' "http://${HOST}/api/ModuleVersionTests"
curl -X POST --header 'Content-Type: application/json' --header "Authorization: ${TOKEN}" \
-d '{"arch_id": 1,"distro_id": 1,"os_id": 1,"node_version_id": 4,"module": "appmetrics","module_version": "4.0.0","code_coverage": 50,"passed": true}' "http://${HOST}/api/ModuleVersionTests"
curl -X POST --header 'Content-Type: application/json' --header "Authorization: ${TOKEN}" \
-d '{"arch_id": 2,"distro_id": 1,"os_id": 1,"node_version_id": 3,"module": "appmetrics","module_version": "4.0.0","code_coverage": 50,"passed": true}' "http://${HOST}/api/ModuleVersionTests"
curl -X POST --header 'Content-Type: application/json' --header "Authorization: ${TOKEN}" \
-d '{"arch_id": 2,"distro_id": 1,"os_id": 1,"node_version_id": 4,"module": "appmetrics","module_version": "4.0.0","code_coverage": 50,"passed": true}' "http://${HOST}/api/ModuleVersionTests"
curl -X POST --header 'Content-Type: application/json' --header "Authorization: ${TOKEN}" \
-d '{"lts_version_id": 1,"module": "appmetrics","recommended_version": "4.x"}' "http://${HOST}/api/ModuleRecommendedLTSs"
curl -X POST --header 'Content-Type: application/json' --header "Authorization: ${TOKEN}" \
-d '{"lts_version_id": 2,"module": "appmetrics","recommended_version": "4.x"}' "http://${HOST}/api/ModuleRecommendedLTSs"
echo "\n\nAdded Appmetrics"
echo "# ------------------------------- Commander -------------------------------\n"
curl -X POST --header 'Content-Type: application/json' -H "Authorization: ${TOKEN}" \
-d '{"name":"commander","stability":"","commercial_support":"[]"}' "http://${HOST}/api/Modules"
curl -X POST --header 'Content-Type: application/json' --header "Authorization: ${TOKEN}" \
-d '{"module": "commander","module_major_version": "2.x","module_version": "2.16.0","license": "MIT","deps_ids": "string","deps_licenses": "string","deps_licenses_count": 0,"timestamp": "2018-08-22T12:43:53.871Z"}' "http://${HOST}/api/ModuleVersions"
curl -X POST --header 'Content-Type: application/json' --header "Authorization: ${TOKEN}" \
-d '{"module": "commander","module_major_version": "2.x","module_version": "2.17.1","license": "MIT","deps_ids": "string","deps_licenses": "string","deps_licenses_count": 0,"timestamp": "2018-08-22T12:43:53.871Z"}' "http://${HOST}/api/ModuleVersions"
curl -X POST --header 'Content-Type: application/json' --header "Authorization: ${TOKEN}" \
-d '{"arch_id": 1,"distro_id": 1,"os_id": 1,"node_version_id": 3,"module": "commander","module_version": "2.16.0","code_coverage": 94,"passed": true}' "http://${HOST}/api/ModuleVersionTests"
curl -X POST --header 'Content-Type: application/json' --header "Authorization: ${TOKEN}" \
-d '{"arch_id": 1,"distro_id": 1,"os_id": 1,"node_version_id": 4,"module": "commander","module_version": "2.16.0","code_coverage": 94,"passed": true}' "http://${HOST}/api/ModuleVersionTests"
curl -X POST --header 'Content-Type: application/json' --header "Authorization: ${TOKEN}" \
-d '{"arch_id": 3,"distro_id": 1,"os_id": 1,"node_version_id": 3,"module": "commander","module_version": "2.17.1","code_coverage": 87,"passed": true}' "http://${HOST}/api/ModuleVersionTests"
curl -X POST --header 'Content-Type: application/json' --header "Authorization: ${TOKEN}" \
-d '{"arch_id": 3,"distro_id": 1,"os_id": 1,"node_version_id": 4,"module": "commander","module_version": "2.17.1","code_coverage": 87,"passed": true}' "http://${HOST}/api/ModuleVersionTests"
curl -X POST --header 'Content-Type: application/json' --header "Authorization: ${TOKEN}" \
-d '{"lts_version_id": 1,"module": "commander","recommended_version": "2.x"}' "http://${HOST}/api/ModuleRecommendedLTSs"
curl -X POST --header 'Content-Type: application/json' --header "Authorization: ${TOKEN}" \
-d '{"lts_version_id": 2,"module": "commander","recommended_version": "2.x"}' "http://${HOST}/api/ModuleRecommendedLTSs"
echo "\n\nAdded Commander"
echo "#------------------------------- Bluebird -------------------------------\n"
curl -X POST --header 'Content-Type: application/json' -H "Authorization: ${TOKEN}" \
-d '{"name":"bluebird","stability":"","commercial_support":"[]"}' "http://${HOST}/api/Modules"
curl -X POST --header 'Content-Type: application/json' --header "Authorization: ${TOKEN}" \
-d '{"module": "bluebird","module_major_version": "3.x","module_version": "3.5.1","license": "MIT","deps_ids": "string","deps_licenses": "string","deps_licenses_count": 0,"timestamp": "2018-08-22T12:43:53.871Z"}' "http://${HOST}/api/ModuleVersions"
curl -X POST --header 'Content-Type: application/json' --header "Authorization: ${TOKEN}" \
-d '{"arch_id": 1,"distro_id": 1,"os_id": 1,"node_version_id": 3,"module": "bluebird","module_version": "3.5.1","code_coverage": 25,"passed": false}' "http://${HOST}/api/ModuleVersionTests"
curl -X POST --header 'Content-Type: application/json' --header "Authorization: ${TOKEN}" \
-d '{"arch_id": 1,"distro_id": 1,"os_id": 1,"node_version_id": 4,"module": "bluebird","module_version": "3.5.1","code_coverage": 25,"passed": false}' "http://${HOST}/api/ModuleVersionTests"
curl -X POST --header 'Content-Type: application/json' --header "Authorization: ${TOKEN}" \
-d '{"lts_version_id": 1,"module": "bluebird","recommended_version": "3.x"}' "http://${HOST}/api/ModuleRecommendedLTSs"
curl -X POST --header 'Content-Type: application/json' --header "Authorization: ${TOKEN}" \
-d '{"lts_version_id": 2,"module": "bluebird","recommended_version": "3.x"}' "http://${HOST}/api/ModuleRecommendedLTSs"
echo "\n\nAdded Bluebird"
echo "#------------------------------- Async -------------------------------\n"
curl -X POST --header 'Content-Type: application/json' -H "Authorization: ${TOKEN}" \
-d '{"name":"async","stability":"","commercial_support":"[]"}' "http://${HOST}/api/Modules"
curl -X POST --header 'Content-Type: application/json' --header "Authorization: ${TOKEN}" \
-d '{"module": "async","module_major_version": "2.x","module_version": "2.6.1","license": "MIT","deps_ids": "string","deps_licenses": "string","deps_licenses_count": 0,"timestamp": "2018-08-22T12:43:53.871Z"}' "http://${HOST}/api/ModuleVersions"
curl -X POST --header 'Content-Type: application/json' --header "Authorization: ${TOKEN}" \
-d '{"arch_id": 1,"distro_id": 1,"os_id": 1,"node_version_id": 3,"module": "async","module_version": "2.6.1","code_coverage": 98,"passed": true}' "http://${HOST}/api/ModuleVersionTests"
curl -X POST --header 'Content-Type: application/json' --header "Authorization: ${TOKEN}" \
-d '{"arch_id": 1,"distro_id": 1,"os_id": 1,"node_version_id": 4,"module": "async","module_version": "2.6.1","code_coverage": 98,"passed": true}' "http://${HOST}/api/ModuleVersionTests"
curl -X POST --header 'Content-Type: application/json' --header "Authorization: ${TOKEN}" \
-d '{"lts_version_id": 1,"module": "async","recommended_version": "2.x"}' "http://${HOST}/api/ModuleRecommendedLTSs"
curl -X POST --header 'Content-Type: application/json' --header "Authorization: ${TOKEN}" \
-d '{"lts_version_id": 2,"module": "async","recommended_version": "2.x"}' "http://${HOST}/api/ModuleRecommendedLTSs"
echo "\n\nAdded Async"