Timoney, Daniel (dt5972) | 324ee36 | 2017-02-15 10:37:53 -0500 | [diff] [blame] | 1 | <?xml version="1.0" encoding="UTF-8"?> |
| 2 | <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 3 | xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> |
| 4 | |
| 5 | <parent> |
| 6 | <groupId>org.openecomp.sdnc.oam</groupId> |
| 7 | <artifactId>installation</artifactId> |
Dan Timoney | 139e1b5 | 2017-04-26 08:13:03 -0400 | [diff] [blame^] | 8 | <version>1.1.1-SNAPSHOT</version> |
Timoney, Daniel (dt5972) | 324ee36 | 2017-02-15 10:37:53 -0500 | [diff] [blame] | 9 | </parent> |
| 10 | |
| 11 | <modelVersion>4.0.0</modelVersion> |
| 12 | <packaging>pom</packaging> |
| 13 | <groupId>org.openecomp.sdnc.oam</groupId> |
| 14 | <artifactId>installation-ubuntu</artifactId> |
Dan Timoney | 139e1b5 | 2017-04-26 08:13:03 -0400 | [diff] [blame^] | 15 | <version>1.1.1-SNAPSHOT</version> |
Timoney, Daniel (dt5972) | 324ee36 | 2017-02-15 10:37:53 -0500 | [diff] [blame] | 16 | |
| 17 | <name>Installation - ubuntu</name> |
| 18 | <description>Creates base ubuntu Docker container</description> |
| 19 | |
| 20 | <properties> |
Dan Timoney | b217558 | 2017-03-31 17:47:19 -0400 | [diff] [blame] | 21 | <image.name>openecomp/ubuntu-sdnc-image</image.name> |
Dan Timoney | 8f77351 | 2017-04-24 16:30:26 -0400 | [diff] [blame] | 22 | <sdnc.project.version>${project.version}</sdnc.project.version> |
Timoney, Daniel (dt5972) | 324ee36 | 2017-02-15 10:37:53 -0500 | [diff] [blame] | 23 | </properties> |
| 24 | |
| 25 | |
| 26 | <build> |
| 27 | <plugins> |
| 28 | |
Dan Timoney | 8f77351 | 2017-04-24 16:30:26 -0400 | [diff] [blame] | 29 | <plugin> |
| 30 | <groupId>org.codehaus.groovy.maven</groupId> |
| 31 | <artifactId>gmaven-plugin</artifactId> |
| 32 | <executions> |
| 33 | <execution> |
| 34 | <phase>validate</phase> |
| 35 | <goals> |
| 36 | <goal>execute</goal> |
| 37 | </goals> |
| 38 | <configuration> |
| 39 | <source> |
| 40 | println project.properties['sdnc.project.version']; |
| 41 | def versionArray; |
| 42 | if ( project.properties['sdnc.project.version'] != null ) { |
Dan Timoney | 687146e | 2017-04-25 08:43:30 -0400 | [diff] [blame] | 43 | versionArray = |
| 44 | project.properties['sdnc.project.version'].split('\\.'); |
Dan Timoney | 8f77351 | 2017-04-24 16:30:26 -0400 | [diff] [blame] | 45 | } |
Timoney, Daniel (dt5972) | 324ee36 | 2017-02-15 10:37:53 -0500 | [diff] [blame] | 46 | |
Dan Timoney | 687146e | 2017-04-25 08:43:30 -0400 | [diff] [blame] | 47 | if (project.properties['sdnc.project.version'].endsWith("-SNAPSHOT")) { |
| 48 | project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-SNAPSHOT-latest"; |
Dan Timoney | 8f77351 | 2017-04-24 16:30:26 -0400 | [diff] [blame] | 49 | } else { |
Dan Timoney | 687146e | 2017-04-25 08:43:30 -0400 | [diff] [blame] | 50 | project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest"; |
Dan Timoney | 8f77351 | 2017-04-24 16:30:26 -0400 | [diff] [blame] | 51 | } |
| 52 | |
| 53 | println 'New Tag for docker:' + |
| 54 | project.properties['project.docker.latesttag.version']; |
| 55 | </source> |
| 56 | </configuration> |
| 57 | </execution> |
| 58 | </executions> |
| 59 | </plugin> |
Timoney, Daniel (dt5972) | 324ee36 | 2017-02-15 10:37:53 -0500 | [diff] [blame] | 60 | <plugin> |
| 61 | <groupId>io.fabric8</groupId> |
| 62 | <artifactId>docker-maven-plugin</artifactId> |
| 63 | <version>0.16.5</version> |
| 64 | <inherited>false</inherited> |
| 65 | <configuration> |
| 66 | |
| 67 | <images> |
| 68 | <image> |
| 69 | <name>${image.name}</name> |
| 70 | <build> |
| 71 | <cleanup>try</cleanup> |
| 72 | <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir> |
| 73 | <dockerFile>${basedir}/target/docker-stage/Dockerfile</dockerFile> |
| 74 | <tags> |
Dan Timoney | 8f77351 | 2017-04-24 16:30:26 -0400 | [diff] [blame] | 75 | <tag>${project.version}</tag> |
| 76 | <tag>${project.version}-STAGING-${maven.build.timestamp}</tag> |
| 77 | <tag>${project.docker.latesttag.version}</tag> |
Timoney, Daniel (dt5972) | 324ee36 | 2017-02-15 10:37:53 -0500 | [diff] [blame] | 78 | </tags> |
| 79 | </build> |
| 80 | </image> |
| 81 | </images> |
| 82 | </configuration> |
| 83 | <executions> |
| 84 | <execution> |
| 85 | <id>generate-images</id> |
| 86 | <phase>generate-sources</phase> |
| 87 | <goals> |
| 88 | <goal>build</goal> |
| 89 | </goals> |
| 90 | </execution> |
| 91 | |
| 92 | <execution> |
| 93 | <id>push-images</id> |
| 94 | <phase>deploy</phase> |
| 95 | <goals> |
| 96 | <goal>build</goal> |
| 97 | <goal>push</goal> |
| 98 | </goals> |
| 99 | </execution> |
| 100 | </executions> |
| 101 | </plugin> |
| 102 | |
| 103 | <plugin> |
| 104 | <artifactId>maven-resources-plugin</artifactId> |
| 105 | <version>2.6</version> |
| 106 | <executions> |
| 107 | <execution> |
| 108 | <id>copy-dockerfile</id> |
| 109 | <goals> |
| 110 | <goal>copy-resources</goal> |
| 111 | </goals><!-- here the phase you need --> |
| 112 | <phase>validate</phase> |
| 113 | <configuration> |
| 114 | <outputDirectory>${basedir}/target/docker-stage</outputDirectory> |
| 115 | <resources> |
| 116 | <resource> |
| 117 | <directory>src/main/docker</directory> |
| 118 | <includes> |
| 119 | <include>Dockerfile</include> |
| 120 | </includes> |
| 121 | <filtering>true</filtering> |
| 122 | </resource> |
| 123 | </resources> |
| 124 | </configuration> |
| 125 | </execution> |
| 126 | </executions> |
| 127 | </plugin> |
| 128 | </plugins> |
| 129 | |
| 130 | </build> |
| 131 | <organization> |
| 132 | <name>openECOMP</name> |
| 133 | </organization> |
| 134 | </project> |