Revert "Update automated project templates"
[releng/builder.git] / jjb / include-raw-generate-p2pom.sh
1 #!/bin/bash
2 # @License EPL-1.0 <http://spdx.org/licenses/EPL-1.0>
3 ##############################################################################
4 # Copyright (c) 2016 The Linux Foundation and others.
5 #
6 # All rights reserved. This program and the accompanying materials
7 # are made available under the terms of the Eclipse Public License v1.0
8 # which accompanies this distribution, and is available at
9 # http://www.eclipse.org/legal/epl-v10.html
10 ##############################################################################
11
12 FILE_NAME=`echo $P2ZIP_URL | awk -F'/' '{ print $NF }'`
13 VERSION=`echo $P2ZIP_URL | awk -F'/' '{ print $(NF-1) }'`
14
15 wget $P2ZIP_URL -O $FILE_NAME
16
17 cat > ${WORKSPACE}/pom.xml <<EOF
18 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
19   <modelVersion>4.0.0</modelVersion>
20   <groupId>org.opendaylight.$PROJECT</groupId>
21   <artifactId>p2repo</artifactId>
22   <version>1.0.0-SNAPSHOT</version>
23   <packaging>pom</packaging>
24
25   <build>
26     <plugins>
27       <plugin>
28         <groupId>org.apache.maven.plugins</groupId>
29         <artifactId>maven-deploy-plugin</artifactId>
30         <version>2.8.2</version>
31         <configuration>
32           <skip>true</skip>
33         </configuration>
34       </plugin>
35       <plugin>
36         <groupId>org.sonatype.plugins</groupId>
37         <artifactId>maven-upload-plugin</artifactId>
38         <version>0.0.1</version>
39         <executions>
40           <execution>
41             <id>publish-site</id>
42             <phase>deploy</phase>
43             <goals>
44               <goal>upload-file</goal>
45             </goals>
46             <configuration>
47               <serverId>opendaylight-p2</serverId>
48               <repositoryUrl>https://nexus.opendaylight.org/service/local/repositories/p2repos/content-compressed</repositoryUrl>
49               <file>$FILE_NAME</file>
50               <repositoryPath>org.opendaylight.$PROJECT/$VERSION</repositoryPath>
51             </configuration>
52           </execution>
53         </executions>
54       </plugin>
55     </plugins>
56   </build>
57 </project>
58 EOF