3 # Read configuration files
4 ARTIFACTS_VERSION=$(cat /opt/config/artifacts_version.txt)
5 DNS_IP_ADDR=$(cat /opt/config/dns_ip_addr.txt)
6 CLOUD_ENV=$(cat /opt/config/cloud_env.txt)
7 GERRIT_BRANCH=$(cat /opt/config/gerrit_branch.txt)
8 MTU=$(/sbin/ifconfig | grep MTU | sed 's/.*MTU://' | sed 's/ .*//' | sort -n | head -1)
9 CODE_REPO=$(cat /opt/config/remote_repo.txt)
10 HTTP_PROXY=$(cat /opt/config/http_proxy.txt)
11 HTTPS_PROXY=$(cat /opt/config/https_proxy.txt)
13 if [ $HTTP_PROXY != "no_proxy" ]
15 export http_proxy=$HTTP_PROXY
16 export https_proxy=$HTTPS_PROXY
20 # Add host name to /etc/host to avoid warnings in openstack images
21 if [[ $CLOUD_ENV != "rackspace" ]]
23 echo 127.0.0.1 $(hostname) >> /etc/hosts
25 # Allow remote login as root
26 mv /root/.ssh/authorized_keys /root/.ssh/authorized_keys.bk
27 cp /home/ubuntu/.ssh/authorized_keys /root/.ssh
30 # Download dependencies
31 echo "deb http://ppa.launchpad.net/openjdk-r/ppa/ubuntu $(lsb_release -c -s) main" >> /etc/apt/sources.list.d/java.list
32 echo "deb-src http://ppa.launchpad.net/openjdk-r/ppa/ubuntu $(lsb_release -c -s) main" >> /etc/apt/sources.list.d/java.list
34 apt-get install --allow-unauthenticated -y apt-transport-https ca-certificates wget openjdk-8-jdk git ntp ntpdate make maven
36 # Download scripts from Nexus
37 unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip aaf_vm_init.sh > /opt/aaf_vm_init.sh
38 unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip serv.sh > /opt/aaf_serv.sh
39 unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip imagetest.sh > /opt/imagetest.sh
40 chmod +x /opt/imagetest.sh
41 chmod +x /opt/aaf_vm_init.sh
42 chmod +x /opt/aaf_serv.sh
43 sed -i "s|cmd=\"\"|cmd=\"./aaf_vm_init.sh\"|g" /opt/aaf_serv.sh
44 mv /opt/aaf_serv.sh /etc/init.d
45 update-rc.d aaf_serv.sh defaults
47 # Download and install docker-engine and docker-compose
48 echo "deb https://apt.dockerproject.org/repo ubuntu-$(lsb_release -cs) main" | tee /etc/apt/sources.list.d/docker.list
50 apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual
51 apt-get install -y --allow-unauthenticated docker-engine
54 curl -L https://github.com/docker/compose/releases/download/1.9.0/docker-compose-`uname -s`-`uname -m` > /opt/docker/docker-compose
55 chmod +x /opt/docker/docker-compose
57 # Set the MTU size of docker containers to the minimum MTU size supported by vNICs. OpenStack deployments may need to know the external DNS IP
59 if [ -s /opt/config/dns_ip_addr.txt ]
61 DNS_FLAG=$DNS_FLAG"--dns $(cat /opt/config/dns_ip_addr.txt) "
63 if [ -s /opt/config/external_dns.txt ]
65 DNS_FLAG=$DNS_FLAG"--dns $(cat /opt/config/external_dns.txt) "
67 echo "DOCKER_OPTS=\"$DNS_FLAG--mtu=$MTU\"" >> /etc/default/docker
69 cp /lib/systemd/system/docker.service /etc/systemd/system
70 sed -i "/ExecStart/s/$/ --mtu=$MTU/g" /etc/systemd/system/docker.service
71 if [ $HTTP_PROXY != "no_proxy" ]
76 service docker restart
78 # DNS IP address configuration
79 echo "nameserver "$DNS_IP_ADDR >> /etc/resolvconf/resolv.conf.d/head
82 # Clone Gerrit repository and run docker containers
84 git clone -b $GERRIT_BRANCH --single-branch $CODE_REPO
85 chmod +x /opt/authz/auth/auth-cass/docker/dinstall.sh
86 chmod +x /opt/authz/auth/auth-cass/docker/backup/backup.sh
87 chmod +x /opt/authz/auth/docker/dbuild.sh
88 chmod +x /opt/authz/auth/docker/drun.sh
89 chmod +x /opt/authz/auth/docker/dstart.sh
90 chmod +x /opt/authz/auth/docker/dstop.sh
92 #Update maven settings
93 cat > /usr/share/maven/conf/settings.xml << EOF
94 <?xml version="1.0" encoding="UTF-8"?>
97 Licensed to the Apache Software Foundation (ASF) under one
98 or more contributor license agreements. See the NOTICE file
99 distributed with this work for additional information
100 regarding copyright ownership. The ASF licenses this file
101 to you under the Apache License, Version 2.0 (the
102 "License"); you may not use this file except in compliance
103 with the License. You may obtain a copy of the License at
105 http://www.apache.org/licenses/LICENSE-2.0
107 Unless required by applicable law or agreed to in writing,
108 software distributed under the License is distributed on an
109 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
110 KIND, either express or implied. See the License for the
111 specific language governing permissions and limitations
116 | This is the configuration file for Maven. It can be specified at two levels:
118 | 1. User Level. This settings.xml file provides configuration for a single user,
119 | and is normally provided in \${user.home}/.m2/settings.xml.
121 | NOTE: This location can be overridden with the CLI option:
123 | -s /path/to/user/settings.xml
125 | 2. Global Level. This settings.xml file provides configuration for all Maven
126 | users on a machine (assuming they're all using the same Maven
127 | installation). It's normally provided in
128 | \${maven.home}/conf/settings.xml.
130 | NOTE: This location can be overridden with the CLI option:
132 | -gs /path/to/global/settings.xml
134 | The sections in this sample file are intended to give you a running start at
135 | getting the most out of your Maven installation. Where appropriate, the default
136 | values (values used when the setting is not specified) are provided.
139 <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
140 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
141 xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
143 | The path to the local repository maven will use to store artifacts.
145 | Default: \${user.home}/.m2/repository
146 <localRepository>/path/to/local/repo</localRepository>
150 | This will determine whether maven prompts you when it needs input. If set to false,
151 | maven will use a sensible default value, perhaps based on some other setting, for
152 | the parameter in question.
155 <interactiveMode>true</interactiveMode>
159 | Determines whether maven should attempt to connect to the network when executing a build.
160 | This will have an effect on artifact downloads, artifact deployment, and others.
163 <offline>false</offline>
167 | This is a list of additional group identifiers that will be searched when resolving plugins by their prefix, i.e.
168 | when invoking a command line like "mvn prefix:goal". Maven will automatically add the group identifiers
169 | "org.apache.maven.plugins" and "org.codehaus.mojo" if these are not already contained in the list.
173 | Specifies a further group identifier to use for plugin lookup.
174 <pluginGroup>com.your.plugins</pluginGroup>
179 | This is a list of proxies which can be used on this machine to connect to the network.
180 | Unless otherwise specified (by system property or command-line switch), the first proxy
181 | specification in this list marked as active will be used.
186 <active>true</active>
187 <protocol>http</protocol>
188 <username>proxyuser</username>
189 <password>proxypass</password>
190 <host>$(cat /opt/config/http_proxy.txt | cut -d ':' -f1)</host>
191 <port>$(cat /opt/config/http_proxy.txt | cut -d ':' -f2)</port>
192 <nonProxyHosts>local.net|some.host.com</nonProxyHosts>
196 <active>true</active>
197 <protocol>https</protocol>
198 <username>proxyuser</username>
199 <password>proxypass</password>
200 <host>$(cat /opt/config/https_proxy.txt | cut -d ':' -f1)</host>
201 <port>$(cat /opt/config/https_proxy.txt | cut -d ':' -f2)</port>
202 <nonProxyHosts>local.net|some.host.com</nonProxyHosts>
208 | This is a list of authentication profiles, keyed by the server-id used within the system.
209 | Authentication profiles can be used whenever maven must make a connection to a remote server.
213 | Specifies the authentication information to use when connecting to a particular server, identified by
214 | a unique name within the system (referred to by the 'id' attribute below).
216 | NOTE: You should either specify username/password OR privateKey/passphrase, since these pairings are
220 <id>deploymentRepo</id>
221 <username>repouser</username>
222 <password>repopwd</password>
226 <!-- Another sample, using keys to authenticate.
229 <privateKey>/path/to/private/key</privateKey>
230 <passphrase>optional; leave empty if not used.</passphrase>
236 | This is a list of mirrors to be used in downloading artifacts from remote repositories.
238 | It works like this: a POM may declare a repository to use in resolving certain artifacts.
239 | However, this repository may have problems with heavy traffic at times, so people have mirrored
240 | it to several places.
242 | That repository definition will have a unique id, so we can create a mirror reference for that
243 | repository, to be used as an alternate download site. The mirror site will be the preferred
244 | server for that repository.
248 | This is a list of profiles which can be activated in a variety of ways, and which can modify
249 | the build process. Profiles provided in the settings.xml are intended to provide local machine-
250 | specific paths and repository locations which allow the build to work in the local environment.
252 | For example, if you have an integration testing plugin - like cactus - that needs to know where
253 | your Tomcat instance is installed, you can provide a variable here such that the variable is
254 | dereferenced during the build process to configure the cactus plugin.
256 | As noted above, profiles can be activated in a variety of ways. One way - the activeProfiles
257 | section of this document (settings.xml) - will be discussed later. Another way essentially
258 | relies on the detection of a system property, either matching a particular value for the property,
259 | or merely testing its existence. Profiles can also be activated by JDK version prefix, where a
260 | value of '1.4' might activate a profile when the build is executed on a JDK version of '1.4.2_07'.
261 | Finally, the list of active profiles can be specified directly from the command line.
263 | NOTE: For profiles defined in the settings.xml, you are restricted to specifying only artifact
264 | repositories, plugin repositories, and free-form properties to be used as configuration
265 | variables for plugins in the POM.
277 <!--Enable snapshots for the built in central repo to direct -->
278 <!--all requests to nexus via the mirror -->
282 <url>http://repo.maven.apache.org/maven2/</url>
283 <releases><enabled>true</enabled></releases>
284 <snapshots><enabled>true</enabled></snapshots>
291 <url>http://repo.maven.apache.org/maven2/</url>
292 <releases><enabled>true</enabled></releases>
293 <snapshots><enabled>true</enabled></snapshots>
295 </pluginRepositories>
299 <id>20_openecomp-public</id>
302 <id>20_openecomp-public</id>
303 <name>20_openecomp-public</name>
304 <url>https://nexus.onap.org/content/repositories/public/</url>
306 <enabled>true</enabled>
307 <updatePolicy>daily</updatePolicy>
310 <enabled>false</enabled>
316 <id>20_openecomp-public</id>
317 <name>20_openecomp-public</name>
318 <url>https://nexus.onap.org/content/repositories/public/</url>
320 <enabled>true</enabled>
321 <updatePolicy>daily</updatePolicy>
324 <enabled>false</enabled>
327 </pluginRepositories>
330 <id>30_openecomp-staging</id>
333 <id>30_openecomp-staging</id>
334 <name>30_openecomp-staging</name>
335 <url>https://nexus.onap.org/content/repositories/staging/</url>
337 <enabled>true</enabled>
338 <updatePolicy>daily</updatePolicy>
341 <enabled>false</enabled>
347 <id>30_openecomp-staging</id>
348 <name>30_openecomp-staging</name>
349 <url>https://nexus.onap.org/content/repositories/staging/</url>
351 <enabled>true</enabled>
352 <updatePolicy>daily</updatePolicy>
355 <enabled>false</enabled>
358 </pluginRepositories>
361 <id>40_openecomp-release</id>
364 <id>40_openecomp-release</id>
365 <name>40_openecomp-release</name>
366 <url>https://nexus.onap.org/content/repositories/releases/</url>
368 <enabled>true</enabled>
369 <updatePolicy>daily</updatePolicy>
372 <enabled>false</enabled>
378 <id>40_openecomp-release</id>
379 <name>40_openecomp-release</name>
380 <url>https://nexus.onap.org/content/repositories/releases/</url>
382 <enabled>true</enabled>
383 <updatePolicy>daily</updatePolicy>
386 <enabled>false</enabled>
389 </pluginRepositories>
393 <id>50_openecomp-snapshots</id>
396 <id>50_openecomp-snapshot</id>
397 <name>50_openecomp-snapshot</name>
398 <url>https://nexus.onap.org/content/repositories/snapshots/</url>
400 <enabled>false</enabled>
403 <enabled>true</enabled>
409 <id>50_openecomp-snapshot</id>
410 <name>50_openecomp-snapshot</name>
411 <url>https://nexus.onap.org/content/repositories/snapshots/</url>
413 <enabled>false</enabled>
416 <enabled>true</enabled>
419 </pluginRepositories>
422 <id>60_opendaylight-release</id>
425 <id>60_opendaylight-mirror</id>
426 <name>60_opendaylight-mirror</name>
427 <url>https://nexus.opendaylight.org/content/repositories/public/</url>
429 <enabled>true</enabled>
430 <updatePolicy>daily</updatePolicy>
433 <enabled>false</enabled>
439 <id>60_opendaylight-mirror</id>
440 <name>60_opendaylight-mirror</name>
441 <url>https://nexus.opendaylight.org/content/repositories/public/</url>
443 <enabled>true</enabled>
444 <updatePolicy>daily</updatePolicy>
447 <enabled>false</enabled>
450 </pluginRepositories>
454 <id>70_opendaylight-snapshots</id>
457 <id>70_opendaylight-snapshot</id>
458 <name>70_opendaylight-snapshot</name>
459 <url>https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/</url>
461 <enabled>false</enabled>
464 <enabled>true</enabled>
470 <id>70_opendaylight-snapshot</id>
471 <name>70_opendaylight-snapshot</name>
472 <url>https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/</url>
474 <enabled>false</enabled>
477 <enabled>true</enabled>
480 </pluginRepositories>
485 <activeProfile>10_nexus</activeProfile>
486 <activeProfile>20_openecomp-public</activeProfile>
487 <activeProfile>30_openecomp-staging</activeProfile>
488 <activeProfile>40_openecomp-release</activeProfile>
489 <activeProfile>50_openecomp-snapshots</activeProfile>
490 <activeProfile>60_opendaylight-release</activeProfile>
491 <activeProfile>70_opendaylight-snapshots</activeProfile>
499 mvn install -Dmaven.test.skip=true