3 # Read configuration files
4 GERRIT_BRANCH=$(cat /opt/config/gerrit_branch.txt)
5 CODE_REPO=$(cat /opt/config/remote_repo.txt)
6 HTTP_PROXY=$(cat /opt/config/http_proxy.txt)
7 HTTPS_PROXY=$(cat /opt/config/https_proxy.txt)
9 if [ $HTTP_PROXY != "no_proxy" ]
11 export http_proxy=$HTTP_PROXY
12 export https_proxy=$HTTPS_PROXY
16 # Download dependencies
17 echo "deb http://ppa.launchpad.net/openjdk-r/ppa/ubuntu $(lsb_release -c -s) main" >> /etc/apt/sources.list.d/java.list
18 echo "deb-src http://ppa.launchpad.net/openjdk-r/ppa/ubuntu $(lsb_release -c -s) main" >> /etc/apt/sources.list.d/java.list
20 apt-get install --allow-unauthenticated -y openjdk-8-jdk maven
22 # Clone Gerrit repository and run docker containers
24 git clone -b $GERRIT_BRANCH --single-branch $CODE_REPO
25 chmod +x /opt/authz/auth/auth-cass/docker/dinstall.sh
26 chmod +x /opt/authz/auth/auth-cass/docker/backup/backup.sh
27 chmod +x /opt/authz/auth/docker/dbuild.sh
28 chmod +x /opt/authz/auth/docker/drun.sh
29 chmod +x /opt/authz/auth/docker/dstart.sh
30 chmod +x /opt/authz/auth/docker/dstop.sh
32 #Update maven settings
33 cat > /usr/share/maven/conf/settings.xml << EOF
34 <?xml version="1.0" encoding="UTF-8"?>
37 Licensed to the Apache Software Foundation (ASF) under one
38 or more contributor license agreements. See the NOTICE file
39 distributed with this work for additional information
40 regarding copyright ownership. The ASF licenses this file
41 to you under the Apache License, Version 2.0 (the
42 "License"); you may not use this file except in compliance
43 with the License. You may obtain a copy of the License at
45 http://www.apache.org/licenses/LICENSE-2.0
47 Unless required by applicable law or agreed to in writing,
48 software distributed under the License is distributed on an
49 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
50 KIND, either express or implied. See the License for the
51 specific language governing permissions and limitations
56 | This is the configuration file for Maven. It can be specified at two levels:
58 | 1. User Level. This settings.xml file provides configuration for a single user,
59 | and is normally provided in \${user.home}/.m2/settings.xml.
61 | NOTE: This location can be overridden with the CLI option:
63 | -s /path/to/user/settings.xml
65 | 2. Global Level. This settings.xml file provides configuration for all Maven
66 | users on a machine (assuming they're all using the same Maven
67 | installation). It's normally provided in
68 | \${maven.home}/conf/settings.xml.
70 | NOTE: This location can be overridden with the CLI option:
72 | -gs /path/to/global/settings.xml
74 | The sections in this sample file are intended to give you a running start at
75 | getting the most out of your Maven installation. Where appropriate, the default
76 | values (values used when the setting is not specified) are provided.
79 <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
80 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
81 xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
83 | The path to the local repository maven will use to store artifacts.
85 | Default: \${user.home}/.m2/repository
86 <localRepository>/path/to/local/repo</localRepository>
90 | This will determine whether maven prompts you when it needs input. If set to false,
91 | maven will use a sensible default value, perhaps based on some other setting, for
92 | the parameter in question.
95 <interactiveMode>true</interactiveMode>
99 | Determines whether maven should attempt to connect to the network when executing a build.
100 | This will have an effect on artifact downloads, artifact deployment, and others.
103 <offline>false</offline>
107 | This is a list of additional group identifiers that will be searched when resolving plugins by their prefix, i.e.
108 | when invoking a command line like "mvn prefix:goal". Maven will automatically add the group identifiers
109 | "org.apache.maven.plugins" and "org.codehaus.mojo" if these are not already contained in the list.
113 | Specifies a further group identifier to use for plugin lookup.
114 <pluginGroup>com.your.plugins</pluginGroup>
120 if [[ $(cat /opt/config/https_proxy.txt) != "no_proxy" ]]; then
121 HTTPS_PROXY_HOST=$(cat /opt/config/https_proxy.txt | cut -d ':' -f1)
122 HTTPS_PROXY_PORT=$(cat /opt/config/https_proxy.txt | cut -d ':' -f2)
124 cat >> settings.xml << EOF
126 | This is a list of proxies which can be used on this machine to connect to the network.
127 | Unless otherwise specified (by system property or command-line switch), the first proxy
128 | specification in this list marked as active will be used.
133 <active>true</active>
134 <protocol>http</protocol>
135 <username>proxyuser</username>
136 <password>proxypass</password>
137 <host>$HTTPS_PROXY_HOST</host>
138 <port>$HTTPS_PROXY_PORT</port>
139 <nonProxyHosts>local.net|some.host.com</nonProxyHosts>
143 <active>true</active>
144 <protocol>https</protocol>
145 <username>proxyuser</username>
146 <password>proxypass</password>
147 <host>$HTTPS_PROXY_HOST</host>
148 <port>$HTTPS_PROXY_PORT</port>
149 <nonProxyHosts>local.net|some.host.com</nonProxyHosts>
156 cat >> settings.xml << EOF
159 | This is a list of authentication profiles, keyed by the server-id used within the system.
160 | Authentication profiles can be used whenever maven must make a connection to a remote server.
164 | Specifies the authentication information to use when connecting to a particular server, identified by
165 | a unique name within the system (referred to by the 'id' attribute below).
167 | NOTE: You should either specify username/password OR privateKey/passphrase, since these pairings are
171 <id>deploymentRepo</id>
172 <username>repouser</username>
173 <password>repopwd</password>
177 <!-- Another sample, using keys to authenticate.
180 <privateKey>/path/to/private/key</privateKey>
181 <passphrase>optional; leave empty if not used.</passphrase>
187 | This is a list of mirrors to be used in downloading artifacts from remote repositories.
189 | It works like this: a POM may declare a repository to use in resolving certain artifacts.
190 | However, this repository may have problems with heavy traffic at times, so people have mirrored
191 | it to several places.
193 | That repository definition will have a unique id, so we can create a mirror reference for that
194 | repository, to be used as an alternate download site. The mirror site will be the preferred
195 | server for that repository.
199 | This is a list of profiles which can be activated in a variety of ways, and which can modify
200 | the build process. Profiles provided in the settings.xml are intended to provide local machine-
201 | specific paths and repository locations which allow the build to work in the local environment.
203 | For example, if you have an integration testing plugin - like cactus - that needs to know where
204 | your Tomcat instance is installed, you can provide a variable here such that the variable is
205 | dereferenced during the build process to configure the cactus plugin.
207 | As noted above, profiles can be activated in a variety of ways. One way - the activeProfiles
208 | section of this document (settings.xml) - will be discussed later. Another way essentially
209 | relies on the detection of a system property, either matching a particular value for the property,
210 | or merely testing its existence. Profiles can also be activated by JDK version prefix, where a
211 | value of '1.4' might activate a profile when the build is executed on a JDK version of '1.4.2_07'.
212 | Finally, the list of active profiles can be specified directly from the command line.
214 | NOTE: For profiles defined in the settings.xml, you are restricted to specifying only artifact
215 | repositories, plugin repositories, and free-form properties to be used as configuration
216 | variables for plugins in the POM.
228 <!--Enable snapshots for the built in central repo to direct -->
229 <!--all requests to nexus via the mirror -->
233 <url>http://repo.maven.apache.org/maven2/</url>
234 <releases><enabled>true</enabled></releases>
235 <snapshots><enabled>true</enabled></snapshots>
242 <url>http://repo.maven.apache.org/maven2/</url>
243 <releases><enabled>true</enabled></releases>
244 <snapshots><enabled>true</enabled></snapshots>
246 </pluginRepositories>
250 <id>20_openecomp-public</id>
253 <id>20_openecomp-public</id>
254 <name>20_openecomp-public</name>
255 <url>https://nexus.onap.org/content/repositories/public/</url>
257 <enabled>true</enabled>
258 <updatePolicy>daily</updatePolicy>
261 <enabled>false</enabled>
267 <id>20_openecomp-public</id>
268 <name>20_openecomp-public</name>
269 <url>https://nexus.onap.org/content/repositories/public/</url>
271 <enabled>true</enabled>
272 <updatePolicy>daily</updatePolicy>
275 <enabled>false</enabled>
278 </pluginRepositories>
281 <id>30_openecomp-staging</id>
284 <id>30_openecomp-staging</id>
285 <name>30_openecomp-staging</name>
286 <url>https://nexus.onap.org/content/repositories/staging/</url>
288 <enabled>true</enabled>
289 <updatePolicy>daily</updatePolicy>
292 <enabled>false</enabled>
298 <id>30_openecomp-staging</id>
299 <name>30_openecomp-staging</name>
300 <url>https://nexus.onap.org/content/repositories/staging/</url>
302 <enabled>true</enabled>
303 <updatePolicy>daily</updatePolicy>
306 <enabled>false</enabled>
309 </pluginRepositories>
312 <id>40_openecomp-release</id>
315 <id>40_openecomp-release</id>
316 <name>40_openecomp-release</name>
317 <url>https://nexus.onap.org/content/repositories/releases/</url>
319 <enabled>true</enabled>
320 <updatePolicy>daily</updatePolicy>
323 <enabled>false</enabled>
329 <id>40_openecomp-release</id>
330 <name>40_openecomp-release</name>
331 <url>https://nexus.onap.org/content/repositories/releases/</url>
333 <enabled>true</enabled>
334 <updatePolicy>daily</updatePolicy>
337 <enabled>false</enabled>
340 </pluginRepositories>
344 <id>50_openecomp-snapshots</id>
347 <id>50_openecomp-snapshot</id>
348 <name>50_openecomp-snapshot</name>
349 <url>https://nexus.onap.org/content/repositories/snapshots/</url>
351 <enabled>false</enabled>
354 <enabled>true</enabled>
360 <id>50_openecomp-snapshot</id>
361 <name>50_openecomp-snapshot</name>
362 <url>https://nexus.onap.org/content/repositories/snapshots/</url>
364 <enabled>false</enabled>
367 <enabled>true</enabled>
370 </pluginRepositories>
373 <id>60_opendaylight-release</id>
376 <id>60_opendaylight-mirror</id>
377 <name>60_opendaylight-mirror</name>
378 <url>https://nexus.opendaylight.org/content/repositories/public/</url>
380 <enabled>true</enabled>
381 <updatePolicy>daily</updatePolicy>
384 <enabled>false</enabled>
390 <id>60_opendaylight-mirror</id>
391 <name>60_opendaylight-mirror</name>
392 <url>https://nexus.opendaylight.org/content/repositories/public/</url>
394 <enabled>true</enabled>
395 <updatePolicy>daily</updatePolicy>
398 <enabled>false</enabled>
401 </pluginRepositories>
405 <id>70_opendaylight-snapshots</id>
408 <id>70_opendaylight-snapshot</id>
409 <name>70_opendaylight-snapshot</name>
410 <url>https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/</url>
412 <enabled>false</enabled>
415 <enabled>true</enabled>
421 <id>70_opendaylight-snapshot</id>
422 <name>70_opendaylight-snapshot</name>
423 <url>https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/</url>
425 <enabled>false</enabled>
428 <enabled>true</enabled>
431 </pluginRepositories>
436 <activeProfile>10_nexus</activeProfile>
437 <activeProfile>20_openecomp-public</activeProfile>
438 <activeProfile>30_openecomp-staging</activeProfile>
439 <activeProfile>40_openecomp-release</activeProfile>
440 <activeProfile>50_openecomp-snapshots</activeProfile>
441 <activeProfile>60_opendaylight-release</activeProfile>
442 <activeProfile>70_opendaylight-snapshots</activeProfile>
450 mvn install -Dmaven.test.skip=true