blob: 46acf1f2dafd0479722712e6b6e93db988153761 [file] [log] [blame]
Zsolt Haraszti56700cd2016-06-01 16:02:05 -07001/*
Zsolt Harasztid5fa9ed2016-06-01 16:07:16 -07002 * Copyright 2012 the original author or authors.
Zsolt Haraszti56700cd2016-06-01 16:02:05 -07003 *
Zsolt Harasztid5fa9ed2016-06-01 16:07:16 -07004 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
Zsolt Haraszti56700cd2016-06-01 16:02:05 -070015 */
16
Zsolt Harasztid5fa9ed2016-06-01 16:07:16 -070017ext {
Zsolt Haraszti56700cd2016-06-01 16:02:05 -070018
Zsolt Harasztid5fa9ed2016-06-01 16:07:16 -070019 // Target registry to be used to publish docker images needed for deployment
20 targetReg = project.hasProperty('targetReg') ? project.getProperty('targetReg') : 'localhost:5000'
21
22 // The tag used to tag the docker images push to the target registry
23 targetTag = project.hasProperty('targetTag') ? project.getProperty('targetTag') : 'candidate'
24
ChetanGaonker5979e212016-06-03 09:30:49 -070025 cordTesterPath = project.hasProperty('cordTesterPath') ? project.getProperty('cordTesterPath') : './src/test/setup'
26
27 dockerPath = project.hasProperty('dockerPath') ? project.getProperty('dockerPath') : '/usr/bin'
Zsolt Haraszti56700cd2016-06-01 16:02:05 -070028}
29
Zsolt Harasztid5fa9ed2016-06-01 16:07:16 -070030// ~~~~~~~~~~~~~~~~~~~ Global tasks ~~~~~~~~~~~~~~~~~~~~~~~
Zsolt Haraszti56700cd2016-06-01 16:02:05 -070031
Zsolt Harasztid5fa9ed2016-06-01 16:07:16 -070032// To be used to fetch upstream binaries, clone repos, etc.
ChetanGaonker5979e212016-06-03 09:30:49 -070033task fetch (type: Exec) {
Zsolt Harasztid5fa9ed2016-06-01 16:07:16 -070034 // this is where we fetch upstream artifacts that we do not need internet for the build phase"
35 // ...
ChetanGaonker5979e212016-06-03 09:30:49 -070036 commandLine "$cordTesterPath/onos_pull.sh", 'latest'
Zsolt Haraszti56700cd2016-06-01 16:02:05 -070037}
Zsolt Harasztid5fa9ed2016-06-01 16:07:16 -070038
39// To be used to generate all needed binaries that need to be present on the target
40// as docker images in the local docker runner.
ChetanGaonker5979e212016-06-03 09:30:49 -070041task buildImages (type: Exec) {
Zsolt Harasztid5fa9ed2016-06-01 16:07:16 -070042 // ...
ChetanGaonker5979e212016-06-03 09:30:49 -070043 commandLine "$cordTesterPath/cord-test.py", 'build', 'all'
Zsolt Harasztid5fa9ed2016-06-01 16:07:16 -070044}
45
46// Publish image(s) built during the build step into targetReg registry using the targetTag
47// tag. See maas subproject for examples on how to do this.
48task publish {
49 println "$targetTag"
50}
51