Bitbucket Pipeline: Difference between revisions

From Chorke Wiki
Jump to navigation Jump to search
(Created page with "==References== * [https://confluence.atlassian.com/bitbucket/java-with-bitbucket-pipelines-872013773.html Java with Bitbucket Pipelines] * [https://hub.docker.com/_/maven Mave...")
 
 
(15 intermediate revisions by the same user not shown)
Line 1: Line 1:
==Images for Pipelines ==
<source lang="yaml">
https://hub.docker.com/_/maven
3.3.3-jdk-7, 3.3.3-jdk-8, 3.3.3-jdk-9
3.3.9-jdk-7, 3.3.9-jdk-7-alpine
3.3.9-jdk-8, 3.3.9-jdk-8-alpine
</source>
==Maven JDK Pipelines==
<source lang="yaml">
# @web      http://chorke.org
# @vendor    Chorke, Inc.
# @version  0.0.00
# @since    0.0.00
image: maven:3.3.9-jdk-7
pipelines:
  branches:
    master:
      - step:
          name: Deploy Releases Base Artifact
          caches:
            - maven
          script:
            - bash <(curl -s 'http://cdn.chorke.org/repo/mvn/settings.sh.txt')
            - cat $HOME/.m2/settings.xml
            - cat /usr/share/maven/conf/settings.xml
            - mvn clean deploy -N -Djava.net.preferIPv4Stack=true
</source>
==Maven Local Settings==
<source lang="xml">
<settings 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/settings-1.0.0.xsd">
  <servers>
    <server>
      <id>chorke.releases</id>
      <configuration>
        <httpHeaders>
          <property>
            <name>Authorization</name>
            <value>${env.CKI_HTTP_BASIC_AUTH}</value>
          </property>
        </httpHeaders>
      </configuration>
    </server>
    <server>
      <id>chorke.snapshots</id>
      <configuration>
        <httpHeaders>
          <property>
            <name>Authorization</name>
            <value>${env.CKI_HTTP_BASIC_AUTH}</value>
          </property>
        </httpHeaders>
      </configuration>
    </server>
    <server>
      <id>chorke.releases.ftp</id>
      <username>[email protected]</username>
      <password>${env.CKI_SFTP_RELEA_PASS}</password>
    </server>
    <server>
      <id>chorke.snapshots.ftp</id>
      <username>[email protected]</username>
      <password>${env.CKI_SFTP_SNAPS_PASS}</password>
    </server>
    <server>
      <id>chorke.webstart.ftp</id>
      <username>[email protected]</username>
      <password>${env.CKI_SFTP_JAVAW_PASS}</password>
    </server>
  </servers>
</settings>
</source>
==Maven Global Settings==
<source lang="bash">
#!/bin/bash
: '
@author  "Chorke, Inc."<[email protected]>
@web      http://chorke.org
@vendor    Chorke, Inc.
@version  0.0.00
@since    0.0.00
'
CKI_M2_SETTING_CONF='/usr/share/maven/conf/settings.xml'
CKI_M2_MIRRORS_FIND="  </mirrors>"
CKI_M2_MIRRORS_FILL="\
    <mirror>\n\
      <id>chorke.snapshots</id>\n\
      <name>chorke.snapshots</name>\n\
      <mirrorOf>flyway-repo-private</mirrorOf>\n\
      <url>http://mvn.chorke.org/m2/snapshots</url>\n\
    </mirror>\n\
    <mirror>\n\
      <id>chorke.releases</id>\n\
      <name>chorke.releases</name>\n\
      <mirrorOf>flyway-repo-private</mirrorOf>\n\
      <url>http://mvn.chorke.org/m2/releases/</url>\n\
    </mirror>\n\
  </mirrors>"
CKI_M2_PROFILE_FIND="  </profiles>"
CKI_M2_PROFILE_FILL="\
    <profile>\n\
      <id>central</id>\n\
      <repositories>\n\
        <repository>\n\
          <id>central</id>\n\
          <name>Maven Repository Switchboard</name>\n\
          <url>http://repo1.maven.org/maven2</url>\n\
          <snapshots><enabled>false</enabled></snapshots>\n\
        </repository>\n\
      </repositories>\n\
      <pluginRepositories>\n\
        <pluginRepository>\n\
          <id>central</id>\n\
          <name>Maven Plugin Repository</name>\n\
          <url>http://repo1.maven.org/maven2</url>\n\
          <snapshots><enabled>false</enabled></snapshots>\n\
          <releases><updatePolicy>never</updatePolicy></releases>\n\
        </pluginRepository>\n\
      </pluginRepositories>\n\
    </profile>\n\
    <profile>\n\
      <id>apache</id>\n\
      <repositories>\n\
        <repository>\n\
          <id>apache</id>\n\
          <url>https://repository.apache.org/content/repositories/releases</url>\n\
          <snapshots><enabled>false</enabled></snapshots>\n\
        </repository>\n\
      </repositories>\n\
      <pluginRepositories>\n\
        <pluginRepository>\n\
          <id>apache</id>\n\
          <url>https://repository.apache.org/content/repositories/releases</url>\n\
          <snapshots><enabled>false</enabled></snapshots>\n\
        </pluginRepository>\n\
      </pluginRepositories>\n\
    </profile>\n\
    <profile>\n\
      <id>spring</id>\n\
      <repositories>\n\
        <repository>\n\
          <id>spring-releases</id>\n\
          <url>http://repo.spring.io/release</url>\n\
          <snapshots><enabled>false</enabled></snapshots>\n\
        </repository>\n\
      </repositories>\n\
      <pluginRepositories>\n\
        <pluginRepository>\n\
          <id>spring-releases</id>\n\
          <url>http://repo.spring.io/release</url>\n\
          <snapshots><enabled>false</enabled></snapshots>\n\
        </pluginRepository>\n\
      </pluginRepositories>\n\
    </profile>\n\
    <profile>\n\
      <id>jboss</id>\n\
      <repositories>\n\
        <repository>\n\
          <id>jboss.public</id>\n\
          <url>http://repository.jboss.org/nexus/content/groups/public</url>\n\
          <snapshots><enabled>false</enabled></snapshots>\n\
        </repository>\n\
        <repository>\n\
          <id>jboss.fuse</id>\n\
          <url>http://repo.fusesource.com/nexus/content/groups/public/</url>\n\
          <snapshots><enabled>false</enabled></snapshots>\n\
        </repository>\n\
      </repositories>\n\
      <pluginRepositories>\n\
        <pluginRepository>\n\
          <id>jboss.public</id>\n\
          <url>http://repository.jboss.org/nexus/content/groups/public</url>\n\
          <snapshots><enabled>false</enabled></snapshots>\n\
        </pluginRepository>\n\
        <pluginRepository>\n\
          <id>jboss.fuse</id>\n\
          <url>http://repo.fusesource.com/nexus/content/groups/public/</url>\n\
          <snapshots><enabled>false</enabled></snapshots>\n\
        </pluginRepository>\n\
      </pluginRepositories>\n\
    </profile>\n\
  </profiles>"
CKI_M2_ACTIVES_FIND="</settings>"
CKI_M2_ACTIVES_FILL="\
  <activeProfiles>\n\
    <activeProfile>central</activeProfile>\n\
    <activeProfile>apache</activeProfile>\n\
    <activeProfile>spring</activeProfile>\n\
  </activeProfiles>\n\
</settings>"
sed -i "s|$CKI_M2_MIRRORS_FIND|$CKI_M2_MIRRORS_FILL|" "$CKI_M2_SETTING_CONF"
sed -i "s|$CKI_M2_PROFILE_FIND|$CKI_M2_PROFILE_FILL|" "$CKI_M2_SETTING_CONF"
sed -i "s|$CKI_M2_ACTIVES_FIND|$CKI_M2_ACTIVES_FILL|" "$CKI_M2_SETTING_CONF"
curl -o $HOME/.m2/settings.xml -s 'http://cdn.chorke.org/repo/mvn/settings.xml'
#bash <(curl -s 'http://cdn.chorke.org/repo/mvn/settings.sh.txt')
</source>
==References==
==References==
{|
| valign="top" |
* [https://stackoverflow.com/questions/40166537 Multiple docker images in Bitbucket Pipelines]
* [https://confluence.atlassian.com/bitbucket/use-ssh-keys-in-bitbucket-pipelines-847452940.html Use SSH keys in Bitbucket Pipelines]
* [https://hub.docker.com/_/maven Maven Docker Official Images]
* [https://confluence.atlassian.com/bitbucket/java-with-bitbucket-pipelines-872013773.html Java with Bitbucket Pipelines]
* [https://confluence.atlassian.com/bitbucket/java-with-bitbucket-pipelines-872013773.html Java with Bitbucket Pipelines]
* [https://hub.docker.com/_/maven Maven Docker Official Images]
* [[Drone Pipeline]]
 
| valign="top" |
 
| valign="top" |
 
|-
| colspan="3" |
----
|-
| valign="top" |
 
| valign="top" |
 
| valign="top" |
 
|}

Latest revision as of 03:08, 22 June 2022

Images for Pipelines

https://hub.docker.com/_/maven
3.3.3-jdk-7, 3.3.3-jdk-8, 3.3.3-jdk-9
3.3.9-jdk-7, 3.3.9-jdk-7-alpine
3.3.9-jdk-8, 3.3.9-jdk-8-alpine

Maven JDK Pipelines

# @web       http://chorke.org
# @vendor    Chorke, Inc.
# @version   0.0.00
# @since     0.0.00
image: maven:3.3.9-jdk-7
pipelines:
  branches:
    master:
      - step:
          name: Deploy Releases Base Artifact
          caches:
            - maven
          script:
            - bash <(curl -s 'http://cdn.chorke.org/repo/mvn/settings.sh.txt')
            - cat $HOME/.m2/settings.xml
            - cat /usr/share/maven/conf/settings.xml
            - mvn clean deploy -N -Djava.net.preferIPv4Stack=true

Maven Local Settings

<settings 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/settings-1.0.0.xsd">
  <servers>
    <server>
      <id>chorke.releases</id>
      <configuration>
        <httpHeaders>
          <property>
            <name>Authorization</name>
            <value>${env.CKI_HTTP_BASIC_AUTH}</value>
          </property>
        </httpHeaders>
      </configuration>
    </server>
    <server>
      <id>chorke.snapshots</id>
      <configuration>
        <httpHeaders>
          <property>
            <name>Authorization</name>
            <value>${env.CKI_HTTP_BASIC_AUTH}</value>
          </property>
        </httpHeaders>
      </configuration>
    </server>
    <server>
      <id>chorke.releases.ftp</id>
      <username>[email protected]</username>
      <password>${env.CKI_SFTP_RELEA_PASS}</password>
    </server>
    <server>
      <id>chorke.snapshots.ftp</id>
      <username>[email protected]</username>
      <password>${env.CKI_SFTP_SNAPS_PASS}</password>
    </server>
    <server>
      <id>chorke.webstart.ftp</id>
      <username>[email protected]</username>
      <password>${env.CKI_SFTP_JAVAW_PASS}</password>
    </server>
  </servers>
</settings>

Maven Global Settings

#!/bin/bash
: '
 @author   "Chorke, Inc."<[email protected]>
 @web       http://chorke.org
 @vendor    Chorke, Inc.
 @version   0.0.00
 @since     0.0.00
'

CKI_M2_SETTING_CONF='/usr/share/maven/conf/settings.xml'
CKI_M2_MIRRORS_FIND="  </mirrors>"
CKI_M2_MIRRORS_FILL="\
    <mirror>\n\
      <id>chorke.snapshots</id>\n\
      <name>chorke.snapshots</name>\n\
      <mirrorOf>flyway-repo-private</mirrorOf>\n\
      <url>http://mvn.chorke.org/m2/snapshots</url>\n\
    </mirror>\n\
    <mirror>\n\
      <id>chorke.releases</id>\n\
      <name>chorke.releases</name>\n\
      <mirrorOf>flyway-repo-private</mirrorOf>\n\
      <url>http://mvn.chorke.org/m2/releases/</url>\n\
    </mirror>\n\
  </mirrors>"

CKI_M2_PROFILE_FIND="  </profiles>"
CKI_M2_PROFILE_FILL="\
    <profile>\n\
      <id>central</id>\n\
      <repositories>\n\
        <repository>\n\
          <id>central</id>\n\
          <name>Maven Repository Switchboard</name>\n\
          <url>http://repo1.maven.org/maven2</url>\n\
          <snapshots><enabled>false</enabled></snapshots>\n\
        </repository>\n\
      </repositories>\n\
      <pluginRepositories>\n\
        <pluginRepository>\n\
          <id>central</id>\n\
          <name>Maven Plugin Repository</name>\n\
          <url>http://repo1.maven.org/maven2</url>\n\
          <snapshots><enabled>false</enabled></snapshots>\n\
          <releases><updatePolicy>never</updatePolicy></releases>\n\
        </pluginRepository>\n\
      </pluginRepositories>\n\
    </profile>\n\
    <profile>\n\
      <id>apache</id>\n\
      <repositories>\n\
        <repository>\n\
          <id>apache</id>\n\
          <url>https://repository.apache.org/content/repositories/releases</url>\n\
          <snapshots><enabled>false</enabled></snapshots>\n\
        </repository>\n\
      </repositories>\n\
      <pluginRepositories>\n\
        <pluginRepository>\n\
          <id>apache</id>\n\
          <url>https://repository.apache.org/content/repositories/releases</url>\n\
          <snapshots><enabled>false</enabled></snapshots>\n\
        </pluginRepository>\n\
      </pluginRepositories>\n\
    </profile>\n\
    <profile>\n\
      <id>spring</id>\n\
      <repositories>\n\
        <repository>\n\
          <id>spring-releases</id>\n\
          <url>http://repo.spring.io/release</url>\n\
          <snapshots><enabled>false</enabled></snapshots>\n\
        </repository>\n\
      </repositories>\n\
      <pluginRepositories>\n\
        <pluginRepository>\n\
          <id>spring-releases</id>\n\
          <url>http://repo.spring.io/release</url>\n\
          <snapshots><enabled>false</enabled></snapshots>\n\
        </pluginRepository>\n\
      </pluginRepositories>\n\
    </profile>\n\
    <profile>\n\
      <id>jboss</id>\n\
      <repositories>\n\
        <repository>\n\
          <id>jboss.public</id>\n\
          <url>http://repository.jboss.org/nexus/content/groups/public</url>\n\
          <snapshots><enabled>false</enabled></snapshots>\n\
        </repository>\n\
        <repository>\n\
          <id>jboss.fuse</id>\n\
          <url>http://repo.fusesource.com/nexus/content/groups/public/</url>\n\
          <snapshots><enabled>false</enabled></snapshots>\n\
        </repository>\n\
      </repositories>\n\
      <pluginRepositories>\n\
        <pluginRepository>\n\
          <id>jboss.public</id>\n\
          <url>http://repository.jboss.org/nexus/content/groups/public</url>\n\
          <snapshots><enabled>false</enabled></snapshots>\n\
        </pluginRepository>\n\
        <pluginRepository>\n\
          <id>jboss.fuse</id>\n\
          <url>http://repo.fusesource.com/nexus/content/groups/public/</url>\n\
          <snapshots><enabled>false</enabled></snapshots>\n\
        </pluginRepository>\n\
      </pluginRepositories>\n\
    </profile>\n\
  </profiles>"

CKI_M2_ACTIVES_FIND="</settings>"
CKI_M2_ACTIVES_FILL="\
  <activeProfiles>\n\
    <activeProfile>central</activeProfile>\n\
    <activeProfile>apache</activeProfile>\n\
    <activeProfile>spring</activeProfile>\n\
  </activeProfiles>\n\
</settings>"

sed -i "s|$CKI_M2_MIRRORS_FIND|$CKI_M2_MIRRORS_FILL|" "$CKI_M2_SETTING_CONF"
sed -i "s|$CKI_M2_PROFILE_FIND|$CKI_M2_PROFILE_FILL|" "$CKI_M2_SETTING_CONF"
sed -i "s|$CKI_M2_ACTIVES_FIND|$CKI_M2_ACTIVES_FILL|" "$CKI_M2_SETTING_CONF"

curl -o $HOME/.m2/settings.xml -s 'http://cdn.chorke.org/repo/mvn/settings.xml'
#bash <(curl -s 'http://cdn.chorke.org/repo/mvn/settings.sh.txt')

References