mirror of
https://github.com/Alfresco/alfresco-transform-core.git
synced 2025-10-08 14:51:18 +00:00
ATS-421 : Create Travis build for "alfresco-transform-core" (#21)
* ATS-421 : ATS-400: Create Travis build for "alfresco-transform-core" - rename mvn profile from 'enterpriseDocker' to 'local' - add config to publish docker image on both Quay and Docker - remove unused 'master' profile - similar to ATS, publish images only from master branch and on Release - update <distributionManagement> to publish artefacts to Nexus public (rather than Enterprise Releases) - add travis build configs - include SP branches to travis build - add documentation on build&release process
This commit is contained in:
21
_ci/build.sh
Normal file
21
_ci/build.sh
Normal file
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
echo "=========================== Starting Build&Test Script ==========================="
|
||||
PS4="\[\e[35m\]+ \[\e[m\]"
|
||||
set -vex
|
||||
pushd "$(dirname "${BASH_SOURCE[0]}")/../"
|
||||
|
||||
# Always build the image, but only publish from the "master" branch
|
||||
[ "${TRAVIS_PULL_REQUEST}" = "false" ] && [ "${TRAVIS_BRANCH}" = "master" ] && PROFILE="internal" || PROFILE="local"
|
||||
|
||||
mvn -B -U \
|
||||
clean install \
|
||||
-DadditionalOption=-Xdoclint:none -Dmaven.javadoc.skip=true \
|
||||
"-P${PROFILE}"
|
||||
|
||||
docker ps -a -q | xargs -r -l docker stop ; docker ps -a -q | xargs -r -l docker rm
|
||||
|
||||
popd
|
||||
set +vex
|
||||
echo "=========================== Finishing Build&Test Script =========================="
|
||||
|
15
_ci/init.sh
Normal file
15
_ci/init.sh
Normal file
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
echo "=========================== Starting Init Script ==========================="
|
||||
PS4="\[\e[35m\]+ \[\e[m\]"
|
||||
set -vex
|
||||
pushd "$(dirname "${BASH_SOURCE[0]}")/../"
|
||||
|
||||
mkdir -p ${HOME}/.m2 && cp -rf _ci/settings.xml ${HOME}/.m2/
|
||||
echo "${QUAY_PASSWORD}" | docker login -u="alfresco+bamboo" --password-stdin quay.io
|
||||
find "${HOME}/.m2/repository/" -type d -name "*-SNAPSHOT*" | xargs -r -l rm -rf
|
||||
|
||||
popd
|
||||
set +vex
|
||||
echo "=========================== Finishing Init Script =========================="
|
||||
|
24
_ci/prepare_release_deploy.sh
Normal file
24
_ci/prepare_release_deploy.sh
Normal file
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
echo "========================== Starting Prepare Release Deploy Script ==========================="
|
||||
PS4="\[\e[35m\]+ \[\e[m\]"
|
||||
set -vex
|
||||
pushd "$(dirname "${BASH_SOURCE[0]}")/../"
|
||||
|
||||
# Identify latest annotated tag (latest version)
|
||||
export VERSION=$(git describe --abbrev=0 --tags)
|
||||
|
||||
mkdir -p deploy_dir
|
||||
|
||||
# Download the WhiteSource report
|
||||
mvn org.alfresco:whitesource-downloader-plugin:inventoryReport \
|
||||
-N \
|
||||
"-Dorg.whitesource.product=Transform Service" \
|
||||
-DsaveReportAs=deploy_dir/3rd-party.xlsx
|
||||
|
||||
echo "Local deploy directory content:"
|
||||
ls -lA deploy_dir
|
||||
|
||||
popd
|
||||
set +vex
|
||||
echo "========================== Finishing Prepare Release Deploy Script =========================="
|
24
_ci/prepare_staging_deploy.sh
Normal file
24
_ci/prepare_staging_deploy.sh
Normal file
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
echo "========================== Starting Prepare Staging Deploy Script ==========================="
|
||||
PS4="\[\e[35m\]+ \[\e[m\]"
|
||||
set -vex
|
||||
pushd "$(dirname "${BASH_SOURCE[0]}")/../"
|
||||
|
||||
# Identify latest annotated tag (latest version)
|
||||
export VERSION=$(git describe --abbrev=0 --tags)
|
||||
|
||||
mkdir -p deploy_dir
|
||||
|
||||
# Download the WhiteSource report
|
||||
mvn org.alfresco:whitesource-downloader-plugin:inventoryReport \
|
||||
-N \
|
||||
"-Dorg.whitesource.product=Transform Service" \
|
||||
-DsaveReportAs=deploy_dir/3rd-party.xlsx
|
||||
|
||||
echo "Local deploy directory content:"
|
||||
ls -lA deploy_dir
|
||||
|
||||
popd
|
||||
set +vex
|
||||
echo "========================== Finishing Prepare Staging Deploy Script =========================="
|
26
_ci/release.sh
Normal file
26
_ci/release.sh
Normal file
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
echo "=========================== Starting Release Script ==========================="
|
||||
PS4="\[\e[35m\]+ \[\e[m\]"
|
||||
set -vex
|
||||
pushd "$(dirname "${BASH_SOURCE[0]}")/../"
|
||||
|
||||
# For PR builds only execute a Dry Run of the release
|
||||
[ "${TRAVIS_PULL_REQUEST}" = "false" ] && DRY_RUN="" || DRY_RUN="-DdryRun"
|
||||
|
||||
# Travis CI runner work on DETACHED HEAD, so we need to checkout the release branch
|
||||
git checkout -B "${TRAVIS_BRANCH}"
|
||||
|
||||
# Run the release plugin - with "[skip ci]" in the release commit message
|
||||
mvn -B \
|
||||
${DRY_RUN} \
|
||||
-Prelease \
|
||||
"-Darguments=-Prelease -DskipTests -Dmaven.javadoc.skip -Dadditionalparam=-Xdoclint:none" \
|
||||
release:clean release:prepare release:perform \
|
||||
-DscmCommentPrefix="[maven-release-plugin][skip ci] " \
|
||||
-Dusername=alfresco-build \
|
||||
-Dpassword=${GIT_PASSWORD}
|
||||
|
||||
popd
|
||||
set +vex
|
||||
echo "=========================== Finishing Release Script =========================="
|
74
_ci/settings.xml
Normal file
74
_ci/settings.xml
Normal file
@@ -0,0 +1,74 @@
|
||||
<settings>
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>alfresco-internal</id>
|
||||
<activation>
|
||||
<activeByDefault>true</activeByDefault>
|
||||
</activation>
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>alfresco-internal</id>
|
||||
<name>Alfresco Internal Repository</name>
|
||||
<url>https://artifacts.alfresco.com/nexus/content/groups/internal</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
<pluginRepositories>
|
||||
<pluginRepository>
|
||||
<id>alfresco-internal</id>
|
||||
<name>Alfresco Internal Repository</name>
|
||||
<url>https://artifacts.alfresco.com/nexus/content/groups/internal</url>
|
||||
</pluginRepository>
|
||||
</pluginRepositories>
|
||||
<properties>
|
||||
<!-- WhiteSource token -->
|
||||
<org.whitesource.orgToken>${env.WHITESOURCE_TOKEN}</org.whitesource.orgToken>
|
||||
</properties>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
<servers>
|
||||
<!-- Credential for private Nexus repository groups -->
|
||||
<server>
|
||||
<id>alfresco-internal</id>
|
||||
<username>bamboo</username>
|
||||
<password>${env.NEXUS_PASSWORD}</password>
|
||||
</server>
|
||||
<!-- Credential for private Nexus repositories -->
|
||||
<server>
|
||||
<id>alfresco-internal-snapshots</id>
|
||||
<username>bamboo</username>
|
||||
<password>${env.NEXUS_PASSWORD}</password>
|
||||
</server>
|
||||
<server>
|
||||
<id>alfresco-internal-releases</id>
|
||||
<username>bamboo</username>
|
||||
<password>${env.NEXUS_PASSWORD}</password>
|
||||
</server>
|
||||
<server>
|
||||
<id>alfresco-enterprise-snapshots</id>
|
||||
<username>bamboo</username>
|
||||
<password>${env.NEXUS_PASSWORD}</password>
|
||||
</server>
|
||||
<server>
|
||||
<id>alfresco-enterprise-releases</id>
|
||||
<username>bamboo</username>
|
||||
<password>${env.NEXUS_PASSWORD}</password>
|
||||
</server>
|
||||
<server>
|
||||
<id>alfresco-public-snapshots</id>
|
||||
<username>bamboo</username>
|
||||
<password>${env.NEXUS_PASSWORD}</password>
|
||||
</server>
|
||||
<server>
|
||||
<id>alfresco-public</id>
|
||||
<username>bamboo</username>
|
||||
<password>${env.NEXUS_PASSWORD}</password>
|
||||
</server>
|
||||
<!-- private docker registry-->
|
||||
<server>
|
||||
<id>quay.io</id>
|
||||
<username>alfresco+bamboo</username>
|
||||
<password>${env.QUAY_PASSWORD}</password>
|
||||
</server>
|
||||
</servers>
|
||||
</settings>
|
22
_ci/whitesource.sh
Normal file
22
_ci/whitesource.sh
Normal file
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
echo "=========================== Starting WhiteSource Script ==========================="
|
||||
PS4="\[\e[35m\]+ \[\e[m\]"
|
||||
set -vex
|
||||
pushd "$(dirname "${BASH_SOURCE[0]}")/../"
|
||||
|
||||
|
||||
mvn clean install \
|
||||
-DskipTests org.whitesource:whitesource-maven-plugin:update \
|
||||
-Dorg.whitesource.failOnError=true \
|
||||
-Dorg.whitesource.forceUpdate=true \
|
||||
-Dorg.whitesource.checkPolicies=true \
|
||||
-Dorg.whitesource.forceCheckAllDependencies=true \
|
||||
-Dorg.whitesource.ignorePomModules=false \
|
||||
"-Dorg.whitesource.product=Transform Service" \
|
||||
-Dmaven.wagon.http.pool=false
|
||||
|
||||
popd
|
||||
set +vex
|
||||
echo "=========================== Finishing WhiteSource Script =========================="
|
||||
|
Reference in New Issue
Block a user