mirror of
https://github.com/Alfresco/acs-community-packaging.git
synced 2025-09-17 14:21:44 +00:00
ACS-457: Build linkage, tagging and release (#991)
* ACS-457: Build linkage, tagging and release - update .travis.settings.xml * ACS-457: Build linkage, tagging and release - add cleanup_cache.sh script * ACS-457: Build linkage, tagging and release - add init.sh script for before_install job phases * ACS-457: Build linkage, tagging and release - add build.sh script for install job phases * ACS-457: Build linkage, tagging and release - minor updates on the older travis and veracode scripts * ACS-457: Build linkage, tagging and release - reorganized and updated .travis.yml * ACS-457: Build linkage, tagging and release - update and propagate branch version numbers during the build * ACS-457: Build linkage, tagging and release - enable docker image squash for all image builds * ACS-457: Build linkage, tagging and release - shellcheck CI scripts * ACS-457: Build linkage, tagging and release - handle upstream versions in chained feature branch builds * ACS-457: Build linkage, tagging and release - switch to TEST pom versions * ACS-457: Build linkage, tagging and release - handle pom properties for upstream dependencies in build.sh scripts * ACS-457: Build linkage, tagging and release - post-merge fixes * ACS-457: Build linkage, tagging and release - clone upstream repositories with "--depth=1" (no history needed) - add "-Dmaven.javadoc.skip=true" options in the build scripts * ACS-457: Build linkage, tagging and release - remove <scm> configuration from sub-modules - remove <distributionManagement> configurations from submodules - remove <repository> configuration from poms - remove unnecessary and unused POM profiles * ACS-457: Build linkage, tagging and release - add pom <pluginManagement> section - removed some plugin versions from downstream modules - add a single common configuration for the *maven-relese-plugin* * ACS-457: Build linkage, tagging and release - update and reorganize the fabric8-maven-plugin configuration * ACS-457: Build linkage, tagging and release - add configurable docker upstream.image.tag property * ACS-457: Build linkage, tagging and release - modify the build.sh scripts so they checkout the upstream project tag * ACS-457: Build linkage, tagging and release - re-implement build.sh script logic to support PRs & branch builds - restricted the build.sh script capabilities - moved build functions to a separate .sh file * ACS-457: Build linkage, tagging and release - update release scripts * ACS-457: Build linkage, tagging and release - debug build scripts * ACS-457: Build linkage, tagging and release - fix build scripts * ACS-457: Build linkage, tagging and release - fix build scripts * ACS-457: Build linkage, tagging and release - setup/update the S3 publishing jobs * ACS-457: Build linkage, tagging and release - add missing profile * ACS-457: Build linkage, tagging and release - disable PR merges with SNAPSHOT dependencies (on master|release/*) * ACS-457: Build linkage, tagging and release - made the upstream cloning (build_functions.sh) more lenient * ACS-457: Build linkage, tagging and release - fix scripting bug (execute function in sub-shell)
This commit is contained in:
@@ -25,6 +25,10 @@
|
|||||||
<url>https://artifacts.alfresco.com/nexus/content/groups/public</url>
|
<url>https://artifacts.alfresco.com/nexus/content/groups/public</url>
|
||||||
</pluginRepository>
|
</pluginRepository>
|
||||||
</pluginRepositories>
|
</pluginRepositories>
|
||||||
|
<properties>
|
||||||
|
<!-- WhiteSource token -->
|
||||||
|
<org.whitesource.orgToken>${env.WHITESOURCE_API_KEY}</org.whitesource.orgToken>
|
||||||
|
</properties>
|
||||||
</profile>
|
</profile>
|
||||||
</profiles>
|
</profiles>
|
||||||
|
|
||||||
|
137
.travis.yml
137
.travis.yml
@@ -1,59 +1,58 @@
|
|||||||
|
---
|
||||||
dist: xenial
|
dist: xenial
|
||||||
os: linux
|
|
||||||
language: java
|
language: java
|
||||||
jdk:
|
jdk: openjdk11
|
||||||
- openjdk11
|
|
||||||
|
|
||||||
services:
|
services:
|
||||||
- docker
|
- docker
|
||||||
|
|
||||||
|
git:
|
||||||
|
depth: false
|
||||||
|
quiet: true
|
||||||
|
|
||||||
cache:
|
cache:
|
||||||
directories:
|
directories:
|
||||||
- $HOME/.m2
|
- ${HOME}/.m2/repository
|
||||||
|
|
||||||
before_cache:
|
# the cache can grow constantly
|
||||||
- rm -rf $HOME/.m2/repository/org/alfresco/acs-community-packaging
|
before_cache: bash scripts/travis/cleanup_cache.sh
|
||||||
|
|
||||||
env:
|
|
||||||
global:
|
|
||||||
- TAS_SCRIPTS=../alfresco-community-repo/packaging/tests/scripts
|
|
||||||
- TAS_ENVIRONMENT=./tests/environment
|
|
||||||
# Edition
|
|
||||||
- VERSION_EDITION=Community
|
|
||||||
# Must be in the format <alfresco-version>-<additional_versioning> ie. 6.3.0-repo-xxxx-x or 6.3.0-Ax
|
|
||||||
- RELEASE_VERSION=6.2.2-RC1
|
|
||||||
- DEVELOPMENT_VERSION=7.0.0-SNAPSHOT
|
|
||||||
|
|
||||||
branches:
|
branches:
|
||||||
only:
|
only:
|
||||||
- master
|
- master
|
||||||
- develop
|
- develop
|
||||||
|
- /release\/.*/
|
||||||
- feature/REPO-5111_repo_build
|
- feature/REPO-5111_repo_build
|
||||||
|
- feature/ACS-457_travis-release-config
|
||||||
|
|
||||||
|
env:
|
||||||
|
global:
|
||||||
|
- TAS_SCRIPTS=../alfresco-community-repo/packaging/tests/scripts
|
||||||
|
- TAS_ENVIRONMENT=./tests/environment
|
||||||
|
# Must be in the format <alfresco-version>-<additional_versioning> ie. 6.3.0-repo-xxxx-x or 6.3.0-Ax
|
||||||
|
- RELEASE_VERSION=7.0.0-TEST1
|
||||||
|
- DEVELOPMENT_VERSION=7.0.0-TEST1-SNAPSHOT
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
- name: test
|
- name: test
|
||||||
if: commit_message !~ /\[skip tests\]/
|
if: commit_message !~ /\[skip tests\]/
|
||||||
- release
|
- name: docker_latest
|
||||||
- publish
|
if: fork = false AND type != pull_request AND branch = master
|
||||||
|
- name: release
|
||||||
|
if: commit_message ~= /\[release\]/ AND fork = false AND type != pull_request AND (branch =~ ^(master|develop)$ OR branch =~ /release\/.*/)
|
||||||
|
- name: publish
|
||||||
|
if: commit_message ~= /\[publish\]/ AND fork = false AND type != pull_request AND (branch =~ ^(master|develop)$ OR branch =~ /release\/.*/)
|
||||||
|
|
||||||
before_install:
|
before_install: travis_retry bash scripts/travis/init.sh
|
||||||
- "cp .travis.settings.xml $HOME/.m2/settings.xml"
|
install: travis_retry travis_wait 40 bash scripts/travis/build.sh
|
||||||
- pushd ..
|
|
||||||
# - git clone -b ${TRAVIS_BRANCH} https://${GIT_USERNAME}:${GIT_PASSWORD}@github.com/Alfresco/alfresco-community-repo.git
|
|
||||||
- git clone https://${GIT_USERNAME}:${GIT_PASSWORD}@github.com/Alfresco/alfresco-community-repo.git
|
|
||||||
- cd alfresco-community-repo
|
|
||||||
- travis_retry mvn install -DskipTests -PcommunityDocker -B -V
|
|
||||||
- travis_retry mvn install -f packaging/tests/pom.xml -DskipTests -B -V
|
|
||||||
- popd
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
include:
|
include:
|
||||||
- stage: test
|
- name: "WhiteSource scan"
|
||||||
name: "WhiteSource scan"
|
stage: test
|
||||||
# only on master or develop and if it is not a PR
|
# only on master or develop and if it is not a PR
|
||||||
if: fork = false AND branch =~ ^(master|develop)$ AND type != pull_request
|
if: fork = false AND branch =~ ^(master|develop)$ AND type != pull_request
|
||||||
install:
|
install: travis_retry travis_wait 30 mvn -B -q install -f war/pom.xml
|
||||||
- travis_retry travis_wait 30 mvn -q install "-Dversion.edition=${VERSION_EDITION}" -f war/pom.xml
|
|
||||||
script:
|
script:
|
||||||
# Download the latest version of WhiteSource Unified Agent
|
# Download the latest version of WhiteSource Unified Agent
|
||||||
- curl -LJO https://github.com/whitesource/unified-agent-distribution/releases/latest/download/wss-unified-agent.jar
|
- curl -LJO https://github.com/whitesource/unified-agent-distribution/releases/latest/download/wss-unified-agent.jar
|
||||||
@@ -61,105 +60,91 @@ jobs:
|
|||||||
- java -jar wss-unified-agent.jar -apiKey ${WHITESOURCE_API_KEY} -c .wss-unified-agent.config -d ./war
|
- java -jar wss-unified-agent.jar -apiKey ${WHITESOURCE_API_KEY} -c .wss-unified-agent.config -d ./war
|
||||||
|
|
||||||
- name: "REST API TAS tests part1"
|
- name: "REST API TAS tests part1"
|
||||||
jdk: openjdk11
|
before_script:
|
||||||
install:
|
|
||||||
- travis_retry travis_wait 40 mvn install -q "-Dversion.edition=${VERSION_EDITION}" -Dmaven.javadoc.skip=true -PcommunityDocker
|
|
||||||
- ${TAS_SCRIPTS}/start-compose.sh ${TAS_ENVIRONMENT}/docker-compose-minimal+transforms.yml
|
- ${TAS_SCRIPTS}/start-compose.sh ${TAS_ENVIRONMENT}/docker-compose-minimal+transforms.yml
|
||||||
- ${TAS_SCRIPTS}/wait-for-alfresco-start.sh "http://localhost:8082/alfresco"
|
- ${TAS_SCRIPTS}/wait-for-alfresco-start.sh "http://localhost:8082/alfresco"
|
||||||
script:
|
script:
|
||||||
- travis_wait 60 mvn install -f tests/tas-restapi/pom.xml -Pall-tas-tests,run-restapi-part1 -Denvironment=default -DrunBugs=false
|
- travis_wait 60 mvn -B install -f tests/tas-restapi/pom.xml -Pall-tas-tests,run-restapi-part1 -Denvironment=default -DrunBugs=false
|
||||||
|
|
||||||
- name: "REST API TAS tests part2"
|
- name: "REST API TAS tests part2"
|
||||||
jdk: openjdk11
|
before_script:
|
||||||
install:
|
|
||||||
- travis_retry travis_wait 40 mvn install -q "-Dversion.edition=${VERSION_EDITION}" -Dmaven.javadoc.skip=true -PcommunityDocker
|
|
||||||
- ${TAS_SCRIPTS}/start-compose.sh ${TAS_ENVIRONMENT}/docker-compose-minimal+transforms.yml
|
- ${TAS_SCRIPTS}/start-compose.sh ${TAS_ENVIRONMENT}/docker-compose-minimal+transforms.yml
|
||||||
- ${TAS_SCRIPTS}/wait-for-alfresco-start.sh "http://localhost:8082/alfresco"
|
- ${TAS_SCRIPTS}/wait-for-alfresco-start.sh "http://localhost:8082/alfresco"
|
||||||
script:
|
script:
|
||||||
- travis_wait 60 mvn install -f tests/tas-restapi/pom.xml -Pall-tas-tests,run-restapi-part2 -Denvironment=default -DrunBugs=false
|
- travis_wait 60 mvn -B install -f tests/tas-restapi/pom.xml -Pall-tas-tests,run-restapi-part2 -Denvironment=default -DrunBugs=false
|
||||||
|
|
||||||
- name: "REST API TAS tests part3"
|
- name: "REST API TAS tests part3"
|
||||||
jdk: openjdk11
|
before_script:
|
||||||
install:
|
|
||||||
- travis_retry travis_wait 40 mvn install -q "-Dversion.edition=${VERSION_EDITION}" -Dmaven.javadoc.skip=true -PcommunityDocker
|
|
||||||
- ${TAS_SCRIPTS}/start-compose.sh ${TAS_ENVIRONMENT}/docker-compose-minimal+transforms.yml
|
- ${TAS_SCRIPTS}/start-compose.sh ${TAS_ENVIRONMENT}/docker-compose-minimal+transforms.yml
|
||||||
- ${TAS_SCRIPTS}/wait-for-alfresco-start.sh "http://localhost:8082/alfresco"
|
- ${TAS_SCRIPTS}/wait-for-alfresco-start.sh "http://localhost:8082/alfresco"
|
||||||
script:
|
script:
|
||||||
- travis_wait 60 mvn install -f tests/tas-restapi/pom.xml -Pall-tas-tests,run-restapi-part3 -Denvironment=default -DrunBugs=false
|
- travis_wait 60 mvn -B install -f tests/tas-restapi/pom.xml -Pall-tas-tests,run-restapi-part3 -Denvironment=default -DrunBugs=false
|
||||||
|
|
||||||
- name: "CMIS TAS tests"
|
- name: "CMIS TAS tests"
|
||||||
jdk: openjdk11
|
before_script:
|
||||||
install:
|
|
||||||
- travis_retry travis_wait 40 mvn install -q "-Dversion.edition=${VERSION_EDITION}" -Dmaven.javadoc.skip=true -PcommunityDocker
|
|
||||||
- ${TAS_SCRIPTS}/start-compose.sh ${TAS_ENVIRONMENT}/docker-compose-minimal+transforms.yml
|
- ${TAS_SCRIPTS}/start-compose.sh ${TAS_ENVIRONMENT}/docker-compose-minimal+transforms.yml
|
||||||
- ${TAS_SCRIPTS}/wait-for-alfresco-start.sh "http://localhost:8082/alfresco"
|
- ${TAS_SCRIPTS}/wait-for-alfresco-start.sh "http://localhost:8082/alfresco"
|
||||||
script:
|
script:
|
||||||
- travis_wait 40 mvn install -f tests/tas-cmis/pom.xml -Pall-tas-tests -Denvironment=default -DrunBugs=false
|
- travis_wait 40 mvn -B install -f tests/tas-cmis/pom.xml -Pall-tas-tests -Denvironment=default -DrunBugs=false
|
||||||
|
|
||||||
- name: "Email TAS tests"
|
- name: "Email TAS tests"
|
||||||
jdk: openjdk11
|
before_script:
|
||||||
install:
|
|
||||||
- travis_retry travis_wait 40 mvn install -q "-Dversion.edition=${VERSION_EDITION}" -Dmaven.javadoc.skip=true -PcommunityDocker
|
|
||||||
- ${TAS_SCRIPTS}/start-compose.sh ${TAS_ENVIRONMENT}/docker-compose-minimal.yml
|
- ${TAS_SCRIPTS}/start-compose.sh ${TAS_ENVIRONMENT}/docker-compose-minimal.yml
|
||||||
- ${TAS_SCRIPTS}/wait-for-alfresco-start.sh "http://localhost:8082/alfresco"
|
- ${TAS_SCRIPTS}/wait-for-alfresco-start.sh "http://localhost:8082/alfresco"
|
||||||
script:
|
script:
|
||||||
- travis_wait 30 mvn install -f tests/tas-email/pom.xml -Pall-tas-tests -Denvironment=default -DrunBugs=false
|
- travis_wait 30 mvn -B install -f tests/tas-email/pom.xml -Pall-tas-tests -Denvironment=default -DrunBugs=false
|
||||||
|
|
||||||
- name: "WebDAV TAS tests"
|
- name: "WebDAV TAS tests"
|
||||||
jdk: openjdk11
|
before_script:
|
||||||
install:
|
|
||||||
- travis_retry travis_wait 40 mvn install -q "-Dversion.edition=${VERSION_EDITION}" -Dmaven.javadoc.skip=true -PcommunityDocker
|
|
||||||
- ${TAS_SCRIPTS}/start-compose.sh ${TAS_ENVIRONMENT}/docker-compose-minimal.yml
|
- ${TAS_SCRIPTS}/start-compose.sh ${TAS_ENVIRONMENT}/docker-compose-minimal.yml
|
||||||
- ${TAS_SCRIPTS}/wait-for-alfresco-start.sh "http://localhost:8082/alfresco"
|
- ${TAS_SCRIPTS}/wait-for-alfresco-start.sh "http://localhost:8082/alfresco"
|
||||||
script:
|
script:
|
||||||
- travis_wait 20 mvn install -f tests/tas-webdav/pom.xml -Pall-tas-tests -Denvironment=default -DrunBugs=false
|
- travis_wait 20 mvn -B install -f tests/tas-webdav/pom.xml -Pall-tas-tests -Denvironment=default -DrunBugs=false
|
||||||
|
|
||||||
- name: "Integration TAS tests"
|
- name: "Integration TAS tests"
|
||||||
jdk: openjdk11
|
before_script:
|
||||||
install:
|
|
||||||
- travis_retry travis_wait 40 mvn install -q "-Dversion.edition=${VERSION_EDITION}" -Dmaven.javadoc.skip=true -PcommunityDocker
|
|
||||||
- ${TAS_SCRIPTS}/start-compose.sh ${TAS_ENVIRONMENT}/docker-compose-minimal.yml
|
- ${TAS_SCRIPTS}/start-compose.sh ${TAS_ENVIRONMENT}/docker-compose-minimal.yml
|
||||||
- ${TAS_SCRIPTS}/wait-for-alfresco-start.sh "http://localhost:8082/alfresco"
|
- ${TAS_SCRIPTS}/wait-for-alfresco-start.sh "http://localhost:8082/alfresco"
|
||||||
script:
|
script:
|
||||||
- travis_wait 30 mvn install -f tests/tas-integration/pom.xml -Pall-tas-tests -Denvironment=default -DrunBugs=false
|
- travis_wait 30 mvn -B install -f tests/tas-integration/pom.xml -Pall-tas-tests -Denvironment=default -DrunBugs=false
|
||||||
|
|
||||||
- stage: Release
|
- name: "Update Docker latest images"
|
||||||
name: "Maven release"
|
stage: docker_latest
|
||||||
if: commit_message ~= /\[release\]/ AND fork = false AND branch =~ ^(master|develop)$ AND type != pull_request
|
script: travis_retry travis_wait 30 mvn -B -V clean install -DskipTests -Dmaven.javadoc.skip=true -Pinternal
|
||||||
install: travis_retry travis_wait 40 mvn clean install -DskipTests=true "-Dversion.edition=${VERSION_EDITION}" -Dmaven.javadoc.skip=true -B -V
|
|
||||||
# Fail the job if there is a docker image tag that matches the RELEASE_VERSION (or project version in the POM if not set)
|
- name: "Release and Copy to S3 Staging"
|
||||||
before_script: ./scripts/travis/verify_release_tag.sh
|
stage: release
|
||||||
script: travis_wait 40 ./scripts/travis/maven_release.sh ${RELEASE_VERSION} ${DEVELOPMENT_VERSION}
|
install: travis_retry travis_wait 40 mvn -B -V clean install -DskipTests -Dmaven.javadoc.skip=true
|
||||||
# Copy alfresco.war and the distribution zip to deploy_dir
|
before_script: bash scripts/travis/verify_release_tag.sh
|
||||||
|
script: travis_wait 40 bash scripts/travis/maven_release.sh
|
||||||
before_deploy:
|
before_deploy:
|
||||||
# Move the final artifacts to a single folder (deploy_dir) to be copied to S3
|
# Move the final artifacts to a single folder (deploy_dir) to be copied to S3
|
||||||
- mkdir -p deploy_dir
|
- mkdir -p deploy_dir
|
||||||
- cp war/target/alfresco.war deploy_dir
|
- cp distribution/target/alfresco.war deploy_dir
|
||||||
- cp distribution/target/*-distribution*.zip deploy_dir
|
- cp distribution/target/*-distribution*.zip deploy_dir
|
||||||
deploy:
|
deploy:
|
||||||
- provider: s3
|
- provider: s3
|
||||||
access_key_id: ${AWS_STAGING_ACCESS_KEY}
|
access_key_id: "${AWS_STAGING_ACCESS_KEY}"
|
||||||
secret_access_key: ${AWS_STAGING_SECRET_KEY}
|
secret_access_key: "${AWS_STAGING_SECRET_KEY}"
|
||||||
bucket: "alfresco-artefacts-staging"
|
bucket: "alfresco-artefacts-staging"
|
||||||
region: "eu-west-1"
|
region: "eu-west-1"
|
||||||
skip_cleanup: true
|
skip_cleanup: true
|
||||||
acl: private
|
acl: private
|
||||||
local_dir: deploy_dir
|
local_dir: "deploy_dir"
|
||||||
upload_dir: "alfresco-content-services-community/release/${TRAVIS_BRANCH}/${TRAVIS_BUILD_NUMBER}"
|
upload_dir: "alfresco-content-services-community/release/${TRAVIS_BRANCH}/${TRAVIS_BUILD_NUMBER}"
|
||||||
on:
|
on:
|
||||||
all_branches: true
|
all_branches: true
|
||||||
condition: $TRAVIS_BRANCH =~ ^(master|develop)$
|
condition: ${TRAVIS_BRANCH} =~ ^(master|develop)$
|
||||||
|
|
||||||
- stage: "Publish"
|
- name: "Copy to S3 Release"
|
||||||
name: "Copy to S3 Release"
|
stage: publish
|
||||||
if: commit_message ~= /\[publish\]/ AND fork = false AND branch = master AND type != pull_request
|
|
||||||
# Nothing to build/install as we are just copying from S3 buckets
|
# Nothing to build/install as we are just copying from S3 buckets
|
||||||
install: skip
|
install: skip
|
||||||
script: skip
|
script: skip
|
||||||
before_deploy: pip install awscli
|
before_deploy: pip install awscli
|
||||||
deploy:
|
deploy:
|
||||||
- provider: script
|
- provider: script
|
||||||
script: ./scripts/travis/copy_to_release_bucket.sh ${TRAVIS_BUILD_NUMBER} ${TRAVIS_BRANCH}
|
script: bash scripts/travis/copy_to_release_bucket.sh
|
||||||
on:
|
on:
|
||||||
branch: master
|
branch: master
|
||||||
|
|
||||||
|
@@ -7,7 +7,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>acs-community-packaging</artifactId>
|
<artifactId>acs-community-packaging</artifactId>
|
||||||
<version>7.0.0-SNAPSHOT</version>
|
<version>7.0.0-TEST3-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
@@ -147,6 +147,28 @@
|
|||||||
</artifactItems>
|
</artifactItems>
|
||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
|
|
||||||
|
<!-- Copy ROOT.war -->
|
||||||
|
<execution>
|
||||||
|
<id>copy-alfresco-war</id>
|
||||||
|
<phase>generate-resources</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>copy</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<artifactItems>
|
||||||
|
<artifactItem>
|
||||||
|
<groupId>org.alfresco</groupId>
|
||||||
|
<artifactId>content-services-community</artifactId>
|
||||||
|
<version>${dependency.alfresco-community-repo.version}</version>
|
||||||
|
<type>war</type>
|
||||||
|
<overWrite>false</overWrite>
|
||||||
|
<outputDirectory>${project.build.directory}</outputDirectory>
|
||||||
|
<destFileName>alfresco.war</destFileName>
|
||||||
|
</artifactItem>
|
||||||
|
</artifactItems>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
FROM alfresco/alfresco-community-repo-base:latest
|
FROM alfresco/alfresco-community-repo-base:${upstream.image.tag}
|
||||||
|
|
||||||
# Set default docker_context. Will / Can be overriden with maven.
|
# Set default docker_context. Will / Can be overriden with maven.
|
||||||
ARG resource_path=target
|
ARG resource_path=target
|
||||||
|
@@ -7,12 +7,11 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>acs-community-packaging</artifactId>
|
<artifactId>acs-community-packaging</artifactId>
|
||||||
<version>7.0.0-SNAPSHOT</version>
|
<version>7.0.0-TEST3-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<image.name>alfresco/alfresco-content-repository-community</image.name>
|
<image.name>alfresco/alfresco-content-repository-community</image.name>
|
||||||
<image.registry>quay.io</image.registry>
|
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<!-- <dependencies>-->
|
<!-- <dependencies>-->
|
||||||
@@ -68,7 +67,6 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-resources-plugin</artifactId>
|
<artifactId>maven-resources-plugin</artifactId>
|
||||||
<version>3.1.0</version>
|
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<id>copy-licenses</id>
|
<id>copy-licenses</id>
|
||||||
@@ -92,7 +90,6 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-dependency-plugin</artifactId>
|
<artifactId>maven-dependency-plugin</artifactId>
|
||||||
<version>3.1.2</version>
|
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<id>unpack-war-files</id>
|
<id>unpack-war-files</id>
|
||||||
@@ -195,34 +192,31 @@
|
|||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
<plugin>
|
|
||||||
<groupId>io.fabric8</groupId>
|
|
||||||
<artifactId>fabric8-maven-plugin</artifactId>
|
|
||||||
<version>${dependency.fabric8.version}</version>
|
|
||||||
<configuration>
|
|
||||||
<images>
|
|
||||||
<image>
|
|
||||||
<name>${image.name}</name>
|
|
||||||
<build>
|
|
||||||
<dockerFileDir>${project.basedir}/</dockerFileDir>
|
|
||||||
</build>
|
|
||||||
</image>
|
|
||||||
</images>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
<profiles>
|
<profiles>
|
||||||
<profile>
|
<profile>
|
||||||
<id>communityDocker</id>
|
<id>communityDocker</id>
|
||||||
|
<!-- builds "image:latest" locally -->
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>io.fabric8</groupId>
|
<groupId>io.fabric8</groupId>
|
||||||
<artifactId>fabric8-maven-plugin</artifactId>
|
<artifactId>fabric8-maven-plugin</artifactId>
|
||||||
<version>${dependency.fabric8.version}</version>
|
<configuration>
|
||||||
|
<images>
|
||||||
|
<image>
|
||||||
|
<name>${image.name}:${image.tag}</name>
|
||||||
|
<build>
|
||||||
|
<dockerFileDir>${project.basedir}/</dockerFileDir>
|
||||||
|
<buildOptions>
|
||||||
|
<squash>true</squash>
|
||||||
|
</buildOptions>
|
||||||
|
</build>
|
||||||
|
</image>
|
||||||
|
</images>
|
||||||
|
</configuration>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<id>build-image</id>
|
<id>build-image</id>
|
||||||
@@ -239,59 +233,33 @@
|
|||||||
|
|
||||||
<profile>
|
<profile>
|
||||||
<id>internal</id>
|
<id>internal</id>
|
||||||
|
<!-- publishes "image:latest" on Quay & DockerHub -->
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>io.fabric8</groupId>
|
<groupId>io.fabric8</groupId>
|
||||||
<artifactId>fabric8-maven-plugin</artifactId>
|
<artifactId>fabric8-maven-plugin</artifactId>
|
||||||
<version>${dependency.fabric8.version}</version>
|
|
||||||
<configuration>
|
<configuration>
|
||||||
<images>
|
<images>
|
||||||
|
<!-- Quay image -->
|
||||||
<image>
|
<image>
|
||||||
<name>${image.name}:${image.tag}</name>
|
<name>${image.name}:${image.tag}</name>
|
||||||
<registry>${image.registry}</registry>
|
<registry>${image.registry}</registry>
|
||||||
<build>
|
<build>
|
||||||
<dockerFileDir>${project.basedir}/</dockerFileDir>
|
<dockerFileDir>${project.basedir}/</dockerFileDir>
|
||||||
|
<buildOptions>
|
||||||
|
<squash>true</squash>
|
||||||
|
</buildOptions>
|
||||||
</build>
|
</build>
|
||||||
</image>
|
</image>
|
||||||
</images>
|
<!-- DockerHub image -->
|
||||||
</configuration>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<id>build-push-image</id>
|
|
||||||
<phase>install</phase>
|
|
||||||
<goals>
|
|
||||||
<goal>build</goal>
|
|
||||||
<goal>push</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</build>
|
|
||||||
</profile>
|
|
||||||
|
|
||||||
<profile>
|
|
||||||
<id>master</id>
|
|
||||||
<build>
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<groupId>io.fabric8</groupId>
|
|
||||||
<artifactId>fabric8-maven-plugin</artifactId>
|
|
||||||
<version>${dependency.fabric8.version}</version>
|
|
||||||
<configuration>
|
|
||||||
<images>
|
|
||||||
<image>
|
<image>
|
||||||
<name>${image.name}</name>
|
<name>${image.name}:${image.tag}</name>
|
||||||
<registry>${image.registry}</registry>
|
|
||||||
<build>
|
|
||||||
<dockerFileDir>${project.basedir}/</dockerFileDir>
|
|
||||||
</build>
|
|
||||||
</image>
|
|
||||||
<image>
|
|
||||||
<name>${image.name}</name>
|
|
||||||
<build>
|
<build>
|
||||||
<dockerFileDir>${project.basedir}/</dockerFileDir>
|
<dockerFileDir>${project.basedir}/</dockerFileDir>
|
||||||
|
<buildOptions>
|
||||||
|
<squash>true</squash>
|
||||||
|
</buildOptions>
|
||||||
</build>
|
</build>
|
||||||
</image>
|
</image>
|
||||||
</images>
|
</images>
|
||||||
@@ -313,27 +281,33 @@
|
|||||||
|
|
||||||
<profile>
|
<profile>
|
||||||
<id>release</id>
|
<id>release</id>
|
||||||
|
<!-- publishes "image:release_version" on Quay & DockerHub -->
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>io.fabric8</groupId>
|
<groupId>io.fabric8</groupId>
|
||||||
<artifactId>fabric8-maven-plugin</artifactId>
|
<artifactId>fabric8-maven-plugin</artifactId>
|
||||||
<version>${dependency.fabric8.version}</version>
|
<configuration combine.self="override">
|
||||||
<configuration>
|
|
||||||
<images>
|
<images>
|
||||||
|
<!-- Quay image -->
|
||||||
<image>
|
<image>
|
||||||
<alias>quay.io</alias>
|
|
||||||
<name>${image.name}:${project.version}</name>
|
<name>${image.name}:${project.version}</name>
|
||||||
<registry>${image.registry}</registry>
|
<registry>${image.registry}</registry>
|
||||||
<build>
|
<build>
|
||||||
<dockerFileDir>${project.basedir}/</dockerFileDir>
|
<dockerFileDir>${project.basedir}/</dockerFileDir>
|
||||||
|
<buildOptions>
|
||||||
|
<squash>true</squash>
|
||||||
|
</buildOptions>
|
||||||
</build>
|
</build>
|
||||||
</image>
|
</image>
|
||||||
|
<!-- DockerHub image -->
|
||||||
<image>
|
<image>
|
||||||
<alias>dockerhub</alias>
|
|
||||||
<name>${image.name}:${project.version}</name>
|
<name>${image.name}:${project.version}</name>
|
||||||
<build>
|
<build>
|
||||||
<dockerFileDir>${project.basedir}/</dockerFileDir>
|
<dockerFileDir>${project.basedir}/</dockerFileDir>
|
||||||
|
<buildOptions>
|
||||||
|
<squash>true</squash>
|
||||||
|
</buildOptions>
|
||||||
</build>
|
</build>
|
||||||
</image>
|
</image>
|
||||||
</images>
|
</images>
|
||||||
|
27
pom.xml
27
pom.xml
@@ -2,14 +2,14 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<artifactId>acs-community-packaging</artifactId>
|
<artifactId>acs-community-packaging</artifactId>
|
||||||
<name>Alfresco Content Services Community Packaging</name>
|
<name>Alfresco Content Services Community Packaging</name>
|
||||||
<version>7.0.0-SNAPSHOT</version>
|
<version>7.0.0-TEST3-SNAPSHOT</version>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
|
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-community-repo</artifactId>
|
<artifactId>alfresco-community-repo</artifactId>
|
||||||
<relativePath>../alfresco-community-repo/pom.xml</relativePath>
|
<relativePath>../alfresco-community-repo/pom.xml</relativePath>
|
||||||
<version>8.300-SNAPSHOT</version>
|
<version>8.300-TEST1-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<scm>
|
<scm>
|
||||||
@@ -31,11 +31,14 @@
|
|||||||
</distributionManagement>
|
</distributionManagement>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<dependency.alfresco-community-repo.version>8.300-SNAPSHOT</dependency.alfresco-community-repo.version>
|
<dependency.alfresco-community-repo.version>8.300-TEST1-SNAPSHOT</dependency.alfresco-community-repo.version>
|
||||||
|
|
||||||
<!-- Set to "Community Early Access" to add to the version.edition property in version.properties -->
|
<!-- Set to "Community Early Access" to add to the version.edition property in version.properties -->
|
||||||
<version.edition>Community</version.edition>
|
<version.edition>Community</version.edition>
|
||||||
<image.tag>latest</image.tag>
|
<image.tag>latest</image.tag>
|
||||||
|
<image.registry>quay.io</image.registry>
|
||||||
|
|
||||||
|
<upstream.image.tag>${dependency.alfresco-community-repo.version}</upstream.image.tag>
|
||||||
|
|
||||||
<alfresco.share.version>6.2.2</alfresco.share.version>
|
<alfresco.share.version>6.2.2</alfresco.share.version>
|
||||||
<alfresco.alfresco-share-services.version>6.2.2</alfresco.alfresco-share-services.version>
|
<alfresco.alfresco-share-services.version>6.2.2</alfresco.alfresco-share-services.version>
|
||||||
@@ -47,12 +50,6 @@
|
|||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<profiles>
|
<profiles>
|
||||||
<profile>
|
|
||||||
<id>communityDocker</id>
|
|
||||||
<modules>
|
|
||||||
<module>docker-alfresco</module>
|
|
||||||
</modules>
|
|
||||||
</profile>
|
|
||||||
<profile>
|
<profile>
|
||||||
<id>fullBuild</id>
|
<id>fullBuild</id>
|
||||||
<activation>
|
<activation>
|
||||||
@@ -64,6 +61,18 @@
|
|||||||
<module>docker-alfresco</module>
|
<module>docker-alfresco</module>
|
||||||
</modules>
|
</modules>
|
||||||
</profile>
|
</profile>
|
||||||
|
<profile>
|
||||||
|
<id>communityDocker</id>
|
||||||
|
<modules>
|
||||||
|
<module>docker-alfresco</module>
|
||||||
|
</modules>
|
||||||
|
</profile>
|
||||||
|
<profile>
|
||||||
|
<id>internal</id>
|
||||||
|
<modules>
|
||||||
|
<module>docker-alfresco</module>
|
||||||
|
</modules>
|
||||||
|
</profile>
|
||||||
<profile>
|
<profile>
|
||||||
<id>all-tas-tests</id>
|
<id>all-tas-tests</id>
|
||||||
<modules>
|
<modules>
|
||||||
|
@@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>acs-community-packaging</artifactId>
|
<artifactId>acs-community-packaging</artifactId>
|
||||||
<version>7.0.0-SNAPSHOT</version>
|
<version>7.0.0-TEST3-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
|
|
||||||
|
34
scripts/travis/build.sh
Normal file
34
scripts/travis/build.sh
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -ev
|
||||||
|
pushd "$(dirname "${BASH_SOURCE[0]}")/../../"
|
||||||
|
|
||||||
|
source "$(dirname "${BASH_SOURCE[0]}")/build_functions.sh"
|
||||||
|
|
||||||
|
DEPENDENCY_VERSION="$(retrievePomProperty "dependency.alfresco-community-repo.version")"
|
||||||
|
|
||||||
|
# Either both the parent and the upstream dependency are the same, or else fail the build
|
||||||
|
if [ "${DEPENDENCY_VERSION}" != "$(retrievePomParentVersion)" ]; then
|
||||||
|
printf "Upstream dependency version (%s) is different then the project parent version!\n" "${DEPENDENCY_VERSION}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Prevent merging of any SNAPSHOT dependencies into the master or the release/* branches
|
||||||
|
if [[ $(isPullRequestBuild) && "${DEPENDENCY_VERSION}" =~ ^.+-SNAPSHOT$ && "${TRAVIS_BRANCH}" =~ ^master$|^release/.+$ ]] ; then
|
||||||
|
printf "PRs with SNAPSHOT dependencies are not allowed into master or release branches\n"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
UPSTREAM_REPO="github.com/Alfresco/alfresco-community-repo.git"
|
||||||
|
# Search, checkout and build the same branch on the upstream project in case of SNAPSHOT dependencies
|
||||||
|
# Otherwise just checkout the upstream dependency sources
|
||||||
|
if [[ "${DEPENDENCY_VERSION}" =~ ^.+-SNAPSHOT$ ]] ; then
|
||||||
|
pullAndBuildSameBranchOnUpstream "${UPSTREAM_REPO}" "-PcommunityDocker"
|
||||||
|
else
|
||||||
|
pullUpstreamTag "${UPSTREAM_REPO}" "${DEPENDENCY_VERSION}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Build the current project
|
||||||
|
mvn -B -V -q install -DskipTests -Dmaven.javadoc.skip=true -PcommunityDocker \
|
||||||
|
$([[ "${DEPENDENCY_VERSION}" =~ ^.+-SNAPSHOT$ ]] && echo "-Dupstream.image.tag=latest")
|
||||||
|
|
||||||
|
|
104
scripts/travis/build_functions.sh
Normal file
104
scripts/travis/build_functions.sh
Normal file
@@ -0,0 +1,104 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
function isPullRequestBuild() {
|
||||||
|
test "${TRAVIS_PULL_REQUEST}" != "false"
|
||||||
|
}
|
||||||
|
|
||||||
|
function isBranchBuild() {
|
||||||
|
test "${TRAVIS_PULL_REQUEST}" = "false"
|
||||||
|
}
|
||||||
|
|
||||||
|
function cloneRepo() {
|
||||||
|
local REPO="${1}"
|
||||||
|
local TAG_OR_BRANCH="${2}"
|
||||||
|
|
||||||
|
# clone the repository branch/tag
|
||||||
|
pushd "$(dirname "${BASH_SOURCE[0]}")/../../../" >/dev/null
|
||||||
|
|
||||||
|
rm -rf "$(basename "${REPO%.git}")"
|
||||||
|
|
||||||
|
git clone -b "${TAG_OR_BRANCH}" --depth=1 "https://${GIT_USERNAME}:${GIT_PASSWORD}@${REPO}"
|
||||||
|
|
||||||
|
popd >/dev/null
|
||||||
|
}
|
||||||
|
|
||||||
|
function retrievePomParentVersion() {
|
||||||
|
pushd "$(dirname "${BASH_SOURCE[0]}")/../../" >/dev/null
|
||||||
|
|
||||||
|
sed -n '/<parent>/,/<\/parent>/p' pom.xml \
|
||||||
|
| sed -n '/<version>/,/<\/version>/p' \
|
||||||
|
| tr -d '\n' \
|
||||||
|
| grep -oP '(?<=<version>).*(?=</version>)' \
|
||||||
|
| xargs
|
||||||
|
|
||||||
|
popd >/dev/null
|
||||||
|
}
|
||||||
|
|
||||||
|
function retrievePomProperty() {
|
||||||
|
local KEY="${1}"
|
||||||
|
|
||||||
|
pushd "$(dirname "${BASH_SOURCE[0]}")/../../" >/dev/null
|
||||||
|
|
||||||
|
sed -n '/<properties>/,/<\/properties>/p' pom.xml \
|
||||||
|
| sed -n "/<${KEY}>/,/<\/${KEY}>/p" \
|
||||||
|
| tr -d '\n' \
|
||||||
|
| grep -oP "(?<=<${KEY}>).*(?=</${KEY}>)" \
|
||||||
|
| xargs
|
||||||
|
|
||||||
|
popd >/dev/null
|
||||||
|
}
|
||||||
|
|
||||||
|
function evaluatePomProperty() {
|
||||||
|
local KEY="${1}"
|
||||||
|
|
||||||
|
pushd "$(dirname "${BASH_SOURCE[0]}")/../../" >/dev/null
|
||||||
|
|
||||||
|
mvn -B -q help:evaluate -Dexpression="${KEY}" -DforceStdout
|
||||||
|
|
||||||
|
popd >/dev/null
|
||||||
|
}
|
||||||
|
|
||||||
|
function remoteBranchExists() {
|
||||||
|
local REMOTE_REPO="${1}"
|
||||||
|
local BRANCH="${2}"
|
||||||
|
|
||||||
|
git ls-remote --exit-code --heads "https://${GIT_USERNAME}:${GIT_PASSWORD}@${REMOTE_REPO}" "${BRANCH}"
|
||||||
|
}
|
||||||
|
|
||||||
|
function pullUpstreamTag() {
|
||||||
|
local UPSTREAM_REPO="${1}"
|
||||||
|
local TAG="${2}"
|
||||||
|
|
||||||
|
cloneRepo "${UPSTREAM_REPO}" "${TAG}"
|
||||||
|
}
|
||||||
|
|
||||||
|
function pullAndBuildSameBranchOnUpstream() {
|
||||||
|
local UPSTREAM_REPO="${1}"
|
||||||
|
local EXTRA_BUILD_ARGUMENTS="${2}"
|
||||||
|
local SOURCE_BRANCH="$(isBranchBuild && echo "${TRAVIS_BRANCH}" || echo "${TRAVIS_PULL_REQUEST_BRANCH}")"
|
||||||
|
|
||||||
|
if ! remoteBranchExists "${UPSTREAM_REPO}" "${SOURCE_BRANCH}" ; then
|
||||||
|
printf "Branch \"%s\" not found on the %s repository\n" "${SOURCE_BRANCH}" "${UPSTREAM_REPO}"
|
||||||
|
#exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
local SOURCE_BRANCH="${TRAVIS_BRANCH}"
|
||||||
|
if ! remoteBranchExists "${UPSTREAM_REPO}" "${SOURCE_BRANCH}" ; then
|
||||||
|
printf "Branch \"%s\" not found on the %s repository\n" "${SOURCE_BRANCH}" "${UPSTREAM_REPO}"
|
||||||
|
#exit 1
|
||||||
|
fi
|
||||||
|
# TODO remove this line and enable the previous "exit" commands:
|
||||||
|
local SOURCE_BRANCH="master"
|
||||||
|
|
||||||
|
cloneRepo "${UPSTREAM_REPO}" "${SOURCE_BRANCH}"
|
||||||
|
|
||||||
|
pushd "$(dirname "${BASH_SOURCE[0]}")/../../../"
|
||||||
|
|
||||||
|
cd "$(basename "${UPSTREAM_REPO%.git}")"
|
||||||
|
|
||||||
|
mvn -B -V -q clean install -DskipTests -Dmaven.javadoc.skip=true ${EXTRA_BUILD_ARGUMENTS}
|
||||||
|
mvn -B -V install -DskipTests -f packaging/tests/pom.xml
|
||||||
|
|
||||||
|
popd
|
||||||
|
}
|
||||||
|
|
19
scripts/travis/cleanup_cache.sh
Normal file
19
scripts/travis/cleanup_cache.sh
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -ev
|
||||||
|
|
||||||
|
rm -rf "${HOME}/.m2/repository/org/alfresco/acs-community-packaging"
|
||||||
|
rm -rf "${HOME}/.m2/repository/org/alfresco/alfresco-community-repo"
|
||||||
|
rm -rf "${HOME}/.m2/repository/org/alfresco/alfresco-community-repo-*"
|
||||||
|
rm -rf "${HOME}/.m2/repository/org/alfresco/alfresco-core"
|
||||||
|
rm -rf "${HOME}/.m2/repository/org/alfresco/alfresco-data-model"
|
||||||
|
rm -rf "${HOME}/.m2/repository/org/alfresco/alfresco-enterprise-remote-api"
|
||||||
|
rm -rf "${HOME}/.m2/repository/org/alfresco/alfresco-enterprise-repo-*"
|
||||||
|
rm -rf "${HOME}/.m2/repository/org/alfresco/alfresco-enterprise-repository"
|
||||||
|
rm -rf "${HOME}/.m2/repository/org/alfresco/alfresco-remote-api"
|
||||||
|
rm -rf "${HOME}/.m2/repository/org/alfresco/alfresco-repository"
|
||||||
|
rm -rf "${HOME}/.m2/repository/org/alfresco/content-services"
|
||||||
|
rm -rf "${HOME}/.m2/repository/org/alfresco/content-services*"
|
||||||
|
rm -rf "${HOME}/.m2/repository/org/alfresco/content-services-community"
|
||||||
|
rm -rf "${HOME}/.m2/repository/org/alfresco/tas/alfresco-community-repo-*-test"
|
||||||
|
rm -rf "${HOME}/.m2/repository/org/alfresco/tas/alfresco-enterprise-repo-*-test"
|
||||||
|
|
@@ -1,17 +1,24 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -ev
|
set -ev
|
||||||
|
|
||||||
if [ -z ${COMM_RELEASE_VERSION} ] || [ -z ${RELEASE_VERSION} ];
|
#
|
||||||
then
|
# Copy from S3 Release bucket to S3 eu.dl bucket
|
||||||
echo "Please provide a COMM_RELEASE_VERSION and RELEASE_VERSION in the format <acs-version>-<additional-info> (6.3.0-EA or 6.3.0-SNAPSHOT)"
|
#
|
||||||
exit -1
|
|
||||||
|
if [ -z "${RELEASE_VERSION}" ]; then
|
||||||
|
echo "Please provide a RELEASE_VERSION in the format <acs-version>-<additional-info> (6.3.0-EA or 6.3.0-SNAPSHOT)"
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
build_number=$1
|
SOURCE="s3://alfresco-artefacts-staging/alfresco-content-services-community/release/${TRAVIS_BRANCH}/${TRAVIS_BUILD_NUMBER}"
|
||||||
branch_name=$2
|
DESTINATION="s3://eu.dl.alfresco.com/release/community/${RELEASE_VERSION}-build-${TRAVIS_BUILD_NUMBER}"
|
||||||
build_stage=release
|
|
||||||
SOURCE=s3://alfresco-artefacts-staging/alfresco-content-services-community/$build_stage/$branch_name/$build_number
|
|
||||||
DESTINATION=s3://eu.dl.alfresco.com/release/community/$COMM_RELEASE_VERSION-build-$build_number
|
|
||||||
|
|
||||||
aws s3 cp --acl private $SOURCE/alfresco.war $DESTINATION/alfresco.war
|
printf "\n%s\n%s\n" "${SOURCE}" "${DESTINATION}"
|
||||||
aws s3 cp --acl private $SOURCE/alfresco-content-services-community-distribution-$RELEASE_VERSION.zip $DESTINATION/alfresco-content-services-community-distribution-$RELEASE_VERSION.zip
|
|
||||||
|
aws s3 cp --acl private \
|
||||||
|
"${SOURCE}/alfresco.war" \
|
||||||
|
"${DESTINATION}/alfresco.war"
|
||||||
|
|
||||||
|
aws s3 cp --acl private \
|
||||||
|
"${SOURCE}/alfresco-content-services-community-distribution-${RELEASE_VERSION}.zip" \
|
||||||
|
"${DESTINATION}/alfresco-content-services-community-distribution-${RELEASE_VERSION}.zip"
|
18
scripts/travis/init.sh
Normal file
18
scripts/travis/init.sh
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -ev
|
||||||
|
pushd "$(dirname "${BASH_SOURCE[0]}")/../../"
|
||||||
|
|
||||||
|
# Maven Setup
|
||||||
|
mkdir -p "${HOME}/.m2" && cp -f .travis.settings.xml "${HOME}/.m2/settings.xml"
|
||||||
|
find "${HOME}/.m2/repository/" -type d -name "*-SNAPSHOT*" | xargs -r -l rm -rf
|
||||||
|
|
||||||
|
# Docker Logins
|
||||||
|
echo "${QUAY_PASSWORD}" | docker login -u="${QUAY_USERNAME}" --password-stdin quay.io
|
||||||
|
|
||||||
|
# Enable experimental docker features (for the image squash option)
|
||||||
|
echo '{"experimental":true}' | sudo tee /etc/docker/daemon.json
|
||||||
|
sudo service docker restart
|
||||||
|
|
||||||
|
# not helpful in this script
|
||||||
|
# export HOST_IP=$(hostname -I | cut -f1 -d' ')
|
||||||
|
|
@@ -1,31 +1,26 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -e
|
set -ev
|
||||||
|
|
||||||
releaseVersion=$1
|
RELEASE_VERSION=${1}
|
||||||
developmentVersion=$2
|
DEVELOPMENT_VERSION=${2}
|
||||||
scm_path=$(mvn help:evaluate -Dexpression=project.scm.url -q -DforceStdout)
|
|
||||||
|
if [ -z "${RELEASE_VERSION}" ] || [ -z "${DEVELOPMENT_VERSION}" ]; then
|
||||||
|
echo "Please provide a Release and Development version in the format <acs-version>-<additional-info> (6.3.0-EA or 6.3.0-SNAPSHOT)"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# Use full history for release
|
# Use full history for release
|
||||||
git checkout -B "${TRAVIS_BRANCH}"
|
git checkout -B "${TRAVIS_BRANCH}"
|
||||||
# Add email to link commits to user
|
# Add email to link commits to user
|
||||||
git config user.email "${GIT_EMAIL}"
|
git config user.email "${GIT_EMAIL}"
|
||||||
|
|
||||||
if [ -z ${releaseVersion} ] || [ -z ${developmentVersion} ];
|
mvn -B \
|
||||||
then echo "Please provide a Release and Development verison in the format <acs-version>-<additional-info> (6.3.0-EA or 6.3.0-SNAPSHOT)"
|
-Prelease,fullBuild,all-tas-tests \
|
||||||
exit -1
|
-DreleaseVersion="${RELEASE_VERSION}" \
|
||||||
else
|
-DdevelopmentVersion="${DEVELOPMENT_VERSION}" \
|
||||||
mvn --batch-mode \
|
"-Darguments=-Prelease,fullBuild,all-tas-tests -DskipTests -Dbuild-number=${TRAVIS_BUILD_NUMBER}" \
|
||||||
-PfullBuild,all-tas-tests \
|
|
||||||
-Dusername="${GIT_USERNAME}" \
|
|
||||||
-Dpassword="${GIT_PASSWORD}" \
|
|
||||||
-DreleaseVersion=${releaseVersion} \
|
|
||||||
-DdevelopmentVersion=${developmentVersion} \
|
|
||||||
-Dbuild-number=${TRAVIS_BUILD_NUMBER} \
|
|
||||||
-Dbuild-name="${TRAVIS_BUILD_STAGE_NAME}" \
|
|
||||||
-Dscm-path=${scm_path} \
|
|
||||||
-DscmCommentPrefix="[maven-release-plugin][skip ci]" \
|
|
||||||
-DskipTests \
|
|
||||||
"-Darguments=-DskipTests -Dbuild-number=${TRAVIS_BUILD_NUMBER} '-Dbuild-name=${TRAVIS_BUILD_STAGE_NAME}' -Dscm-path=${scm_path} -PfullBuild,all-tas-tests" \
|
|
||||||
release:clean release:prepare release:perform \
|
release:clean release:prepare release:perform \
|
||||||
-Prelease
|
-DscmCommentPrefix="[maven-release-plugin][skip ci] " \
|
||||||
fi
|
-Dusername="${GIT_USERNAME}" \
|
||||||
|
-Dpassword="${GIT_PASSWORD}"
|
||||||
|
|
||||||
|
@@ -1,31 +1,38 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -e
|
set -ev
|
||||||
|
|
||||||
if [ -v ${RELEASE_VERSION} ]||[ -z ${RELEASE_VERSION} ]; then
|
#
|
||||||
|
# Check that the version to be released does not already have a docker tag.
|
||||||
|
#
|
||||||
|
|
||||||
|
if [ -z "${RELEASE_VERSION}" ]; then
|
||||||
echo "Please provide a RELEASE_VERSION in the format <acs-version>-<additional-info> (6.3.0-EA or 6.3.0-SNAPSHOT)"
|
echo "Please provide a RELEASE_VERSION in the format <acs-version>-<additional-info> (6.3.0-EA or 6.3.0-SNAPSHOT)"
|
||||||
exit -1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# get the image name from the pom file
|
# get the image name from the pom file
|
||||||
alfresco_docker_image=$(mvn help:evaluate -f ./docker-alfresco/pom.xml -Dexpression=image.name -q -DforceStdout)
|
ALFRESCO_DOCKER_IMAGE="$(mvn -B -q help:evaluate -f ./docker-alfresco/pom.xml -Dexpression=image.name -DforceStdout)"
|
||||||
docker_image_full_name="$alfresco_docker_image:$RELEASE_VERSION"
|
DOCKER_IMAGE_FULL_NAME="${ALFRESCO_DOCKER_IMAGE}:${RELEASE_VERSION}"
|
||||||
|
|
||||||
function docker_image_exists() {
|
function docker_image_exists() {
|
||||||
local image_full_name="$1"; shift
|
local IMAGE_FULL_NAME="${1}"; shift
|
||||||
local wait_time="${1:-5}"
|
local WAIT_TIME="${1:-5}"
|
||||||
local search_term='Pulling|is up to date|not found'
|
local SEARCH_TERM='Pulling|is up to date|not found'
|
||||||
echo "Looking to see if $image_full_name already exists..."
|
|
||||||
local result="$((timeout --preserve-status "$wait_time" docker 2>&1 pull "$image_full_name" &) | grep -v 'Pulling repository' | egrep -o "$search_term")"
|
echo "Looking to see if ${IMAGE_FULL_NAME} already exists..."
|
||||||
test "$result" || { echo "Timed out too soon. Try using a wait_time greater than $wait_time..."; return 1 ;}
|
local RESULT=$( (timeout --preserve-status "${WAIT_TIME}" docker 2>&1 pull "${IMAGE_FULL_NAME}" &) | grep -v 'Pulling repository' | grep -E -o "${SEARCH_TERM}")
|
||||||
if echo $result | grep -vq 'not found'; then
|
|
||||||
|
test "${RESULT}" || { echo "Timed out too soon. Try using a wait_time greater than ${WAIT_TIME}..."; return 1 ;}
|
||||||
|
if echo "${RESULT}" | grep -vq 'not found'; then
|
||||||
true
|
true
|
||||||
else
|
else
|
||||||
false
|
false
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
if docker_image_exists $docker_image_full_name; then
|
if docker_image_exists "${DOCKER_IMAGE_FULL_NAME}" ; then
|
||||||
echo "Tag $RELEASE_VERSION already pushed, release process will interrupt."
|
echo "Tag ${RELEASE_VERSION} already pushed, release process will interrupt."
|
||||||
exit -1
|
exit 1
|
||||||
else
|
else
|
||||||
echo "The $RELEASE_VERSION tag was not found"
|
echo "The ${RELEASE_VERSION} tag was not found"
|
||||||
fi
|
fi
|
||||||
|
@@ -6,7 +6,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>acs-community-packaging</artifactId>
|
<artifactId>acs-community-packaging</artifactId>
|
||||||
<version>7.0.0-SNAPSHOT</version>
|
<version>7.0.0-TEST3-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<modules>
|
<modules>
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>content-repository-community-tests</artifactId>
|
<artifactId>content-repository-community-tests</artifactId>
|
||||||
<version>7.0.0-SNAPSHOT</version>
|
<version>7.0.0-TEST3-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<developers>
|
<developers>
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>content-repository-community-tests</artifactId>
|
<artifactId>content-repository-community-tests</artifactId>
|
||||||
<version>7.0.0-SNAPSHOT</version>
|
<version>7.0.0-TEST3-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<developers>
|
<developers>
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>content-repository-community-tests</artifactId>
|
<artifactId>content-repository-community-tests</artifactId>
|
||||||
<version>7.0.0-SNAPSHOT</version>
|
<version>7.0.0-TEST3-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<developers>
|
<developers>
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>content-repository-community-tests</artifactId>
|
<artifactId>content-repository-community-tests</artifactId>
|
||||||
<version>7.0.0-SNAPSHOT</version>
|
<version>7.0.0-TEST3-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<developers>
|
<developers>
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>content-repository-community-tests</artifactId>
|
<artifactId>content-repository-community-tests</artifactId>
|
||||||
<version>7.0.0-SNAPSHOT</version>
|
<version>7.0.0-TEST3-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<developers>
|
<developers>
|
||||||
|
Reference in New Issue
Block a user