diff --git a/.travis.settings.xml b/.travis.settings.xml index e60b0e0c4c..3ad1180aae 100644 --- a/.travis.settings.xml +++ b/.travis.settings.xml @@ -22,18 +22,8 @@ alfresco-internal Alfresco Internal Repository - https://artifacts.alfresco.com/nexus/content/groups/internal - - - alfresco-public - Alfresco Public Repository https://artifacts.alfresco.com/nexus/content/groups/public - - alfresco-private - Alfresco Private Repository - https://artifacts.alfresco.com/nexus/content/groups/private - @@ -55,7 +45,7 @@ ${env.MAVEN_PASSWORD} - alfresco-private + alfresco-public ${env.MAVEN_USERNAME} ${env.MAVEN_PASSWORD} diff --git a/.travis.yml b/.travis.yml index 419ef99e0d..2a6e359ecc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,7 @@ import: - source: travis/.travis.env-vars.yml - source: travis/.travis.tests-stage.yml - source: travis/.travis.integration-test-MySQL.yml + - source: travis/.travis.deploy-stage.yml - source: travis/.travis.release-stage.yml - source: travis/.travis.publish-stage.yml dist: xenial @@ -28,7 +29,6 @@ cache: directories: - ${HOME}/.m2/repository -# the cache can grow constantly before_cache: rm -rf ${HOME}/.m2/repository/org/alfresco/alfresco-governance-services* before_install: @@ -36,47 +36,15 @@ before_install: - find "${HOME}/.m2/repository/" -type d -name "*-SNAPSHOT*" | xargs -r -l rm -rf - echo "${DOCKERHUB_PASSWORD}" | docker login -u="${DOCKERHUB_USERNAME}" --password-stdin - echo "${QUAY_PASSWORD}" | docker login -u="${QUAY_USERNAME}" --password-stdin quay.io + install: skip stages: - - name: Build AGS - name: Tests if: commit_message !~ /\[skip tests\]/ - - name: Security Scans + - name: Deploy + if: fork = false AND (branch = master OR branch =~ /release\/.*/) AND type != pull_request - name: Release if: fork = false AND (branch = master OR branch =~ /release\/.*/) AND type != pull_request AND commit_message =~ /\[(community|enterprise) release .*\]/ - name: Publish if: fork = false AND (branch = master OR branch =~ /release\/.*/) AND type != pull_request AND commit_message =~ /\[publish\]/ - -jobs: - include: - - name: "Build AGS Community" - stage: Build AGS - before_script: source scripts/setUpMavenPhase.sh - script: - - travis_retry travis_wait 120 mvn -B -q clean ${MAVEN_PHASE} -P${BUILD_PROFILE} -Dimage.tag=${IMAGE_TAG} -Dskip.integrationtests=false -Dcommunity -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn - - - name: "Build AGS Enterprise" - stage: Build AGS - install: - - travis_retry travis_wait 30 mvn -B deploy -N - - travis_retry travis_wait 60 mvn -B -q clean install $MVN_SKIP -f rm-community/pom.xml -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn - before_script: source scripts/setUpMavenPhase.sh - script: - - travis_retry travis_wait 80 mvn -B -q ${MAVEN_PHASE} -P${BUILD_PROFILE} -Dimage.tag=${IMAGE_TAG} -Dskip.integrationtests=false -f rm-enterprise/pom.xml -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn - - - name: "Build AGS Benchmark" - stage: Build AGS - install: - - travis_retry travis_wait 80 mvn -B -q clean install $MVN_SKIP -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn - before_script: source scripts/setUpMavenPhase.sh - script: - - travis_retry travis_wait 35 mvn -B -q ${MAVEN_PHASE} -Dskip.integrationtests=false -f rm-benchmark/pom.xml -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn - - - name: "Source Clear Scan (SCA)" - stage: Security Scans - script: travis_wait 30 bash scripts/source_clear.sh - - name: "Static Analysis (SAST)" - stage: Security Scans - script: - - echo "Static Analysis (SAST)" diff --git a/pom.xml b/pom.xml index 9cc62e9ca8..2f8b100f87 100644 --- a/pom.xml +++ b/pom.xml @@ -34,42 +34,6 @@ 3.3.9 - - - alfresco-internal - Alfresco Internal Repository - https://artifacts.alfresco.com/nexus/content/groups/internal/ - - - alfresco-public - https://artifacts.alfresco.com/nexus/content/groups/public - - - alfresco-public-snapshots - https://artifacts.alfresco.com/nexus/content/groups/public-snapshots - - - - - - alfresco-private - Alfresco Internal Repository - https://artifacts.alfresco.com/nexus/content/groups/private - - - alfresco-public - https://artifacts.alfresco.com/nexus/content/groups/public - - - alfresco-plugin-public - https://artifacts.alfresco.com/nexus/content/groups/public - - - alfresco-plugin-public-snapshots - https://artifacts.alfresco.com/nexus/content/groups/public-snapshots - - - alfresco-internal @@ -98,22 +62,10 @@ rm-automation rm-benchmark - - - alfresco-internal - https://artifacts.alfresco.com/nexus/content/groups/private - - - - - alfresco-private - https://artifacts.alfresco.com/nexus/content/groups/private - - - publicapi + publicapi 1.6.1 @@ -259,7 +211,6 @@ io.fabric8 docker-maven-plugin - ${fabric8.docker.version} build-image @@ -286,86 +237,6 @@ - - - internal - - - - - io.fabric8 - docker-maven-plugin - ${fabric8.docker.version} - - - build-push-image - deploy - - build - push - - - - - ${image.name}:${image.tag} - ${image.registry} - - ${project.basedir}/ - - - - - - - - - - - - - - - master - - - - - io.fabric8 - docker-maven-plugin - ${fabric8.docker.version} - - - build-push-image - deploy - - build - push - - - - - ${image.name}:${image.tag} - ${image.registry} - - ${project.basedir}/ - - - - ${image.name}:${image.tag} - - ${project.basedir}/ - - - - - - - - - - - @@ -377,7 +248,6 @@ io.fabric8 docker-maven-plugin - ${fabric8.docker.version} build-push-image @@ -415,7 +285,6 @@ io.fabric8 docker-maven-plugin - ${fabric8.docker.version} build-push-image @@ -462,7 +331,6 @@ io.fabric8 docker-maven-plugin - ${fabric8.docker.version} start @@ -561,7 +429,7 @@ 2.12.1 2.12.1 - 0.31.0 + 0.34.1 1.10.19 42.2.16 5432 @@ -884,6 +752,7 @@ ${app.filtering.enabled} + @@ -1201,6 +1070,12 @@ + + + io.fabric8 + docker-maven-plugin + ${fabric8.docker.version} + diff --git a/rm-community/pom.xml b/rm-community/pom.xml index d2635d4f5a..d36598dc46 100644 --- a/rm-community/pom.xml +++ b/rm-community/pom.xml @@ -79,4 +79,47 @@ true + + + + publish-docker-latest + + + + + io.fabric8 + docker-maven-plugin + + + build-push-image + deploy + + build + push + + + + + ${image.name}:${image.tag} + ${image.registry} + + ${project.basedir}/ + + + + ${image.name}:${image.tag} + + ${project.basedir}/ + + + + + + + + + + + + diff --git a/rm-community/rm-community-repo/pom.xml b/rm-community/rm-community-repo/pom.xml index 3365d419d9..91c001d99e 100644 --- a/rm-community/rm-community-repo/pom.xml +++ b/rm-community/rm-community-repo/pom.xml @@ -639,18 +639,7 @@ - internal - - - - io.fabric8 - docker-maven-plugin - - - - - - master + publish-docker-latest diff --git a/scripts/release.sh b/scripts/release.sh deleted file mode 100755 index 7c128afef5..0000000000 --- a/scripts/release.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env bash -set -e - -# Use full history for release -git checkout -B "${TRAVIS_BRANCH}" - -git config user.email "build@alfresco.com" - -release_type=$1 -echo Release type: "$release_type" - -if [ -z $release_type ]; then - echo "Please provide a release type." - exit 1 -elif [ $release_type != "community" -a $release_type != "enterprise" ]; then - echo "The provided release type is not valid." - exit 1 -fi - -if [ -z ${RELEASE_VERSION} ] || [ -z ${DEVELOPMENT_VERSION} ]; then - echo "Please provide a Release and Development verison" - exit 1 -fi - -# Check if it's a hotfix version by counting the number of dots in the version number. -if [ $(echo "${RELEASE_VERSION}" | grep -o "\." | wc -l) == 3 ] && [ ${release_type} == "enterprise" ]; -then - deployment_repository="hotfix-release" -else - deployment_repository="${release_type}-release" -fi - -mvn --batch-mode \ - -Dusername="${GIT_USERNAME}" \ - -Dpassword="${GIT_PASSWORD}" \ - -DreleaseVersion=${RELEASE_VERSION} \ - -DdevelopmentVersion=${DEVELOPMENT_VERSION} \ - -DscmCommentPrefix="[maven-release-plugin][skip ci] " \ - -DuseReleaseProfile=false \ - "-Darguments=-DskipTests -D${release_type} -P${deployment_repository},release-${release_type}" \ - release:clean release:prepare release:perform diff --git a/scripts/setUpMavenPhase.sh b/scripts/setUpMavenPhase.sh deleted file mode 100644 index 384131f1ee..0000000000 --- a/scripts/setUpMavenPhase.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env bash -echo "Branch name: ${TRAVIS_BRANCH}" -echo "Pull request: ${TRAVIS_PULL_REQUEST}" -echo "Travis job name: ${TRAVIS_JOB_NAME}" -echo "Image tag: ${TRAVIS_BRANCH:8}" - -if [[ ${TRAVIS_JOB_NAME} == "Build AGS Enterprise" ]] ; then - export BUILD_PROFILE="internal" -else - export BUILD_PROFILE="master" -fi - -if [[ "${TRAVIS_BRANCH}" == "master" && "${TRAVIS_PULL_REQUEST}" == "false" ]] ; then - export MAVEN_PHASE="deploy" - export IMAGE_TAG="latest" -elif [[ ${TRAVIS_BRANCH} = release* && "${TRAVIS_PULL_REQUEST}" == "false" ]] ; then - export MAVEN_PHASE="deploy" - export IMAGE_TAG="${TRAVIS_BRANCH:8}-latest" -else - export MAVEN_PHASE="verify" - export BUILD_PROFILE="buildDockerImage" - export IMAGE_TAG="latest" -fi diff --git a/travis/.travis.deploy-stage.yml b/travis/.travis.deploy-stage.yml new file mode 100644 index 0000000000..0970d8ee4f --- /dev/null +++ b/travis/.travis.deploy-stage.yml @@ -0,0 +1,8 @@ +jobs: + include: + - name: "Deploy Maven & Docker" + stage: Deploy + install: travis_retry travis_wait 60 mvn -B -V -q clean install ${MVN_SKIP} + before_script: test "${TRAVIS_BRANCH}" = "master" && export IMAGE_TAG="latest" || export IMAGE_TAG="${TRAVIS_BRANCH:8}-latest" + script: travis_retry travis_wait 120 mvn -B -q deploy -DskipTests -Ppublish-docker-latest -Dimage.tag=${IMAGE_TAG} ${LOG_WARN} + diff --git a/travis/.travis.env-vars.yml b/travis/.travis.env-vars.yml index d3b953daed..3c45787a59 100644 --- a/travis/.travis.env-vars.yml +++ b/travis/.travis.env-vars.yml @@ -1,12 +1,5 @@ env: global: - - AUTOMATION_COMMUNITY_PATH=rm-automation/rm-automation-community-rest-api - - AUTOMATION_ENTERPRISE_PATH=rm-automation/rm-automation-enterprise-rest-api - - AUTOMATION_UI_PATH=rm-automation/rm-automation-ui - - COMMUNITY_REPO_PATH=rm-community/rm-community-repo - - COMMUNITY_SHARE_PATH=rm-community/rm-community-share - - ENTERPRISE_REPO_PATH=rm-enterprise/rm-enterprise-repo - - ENTERPRISE_SHARE_PATH=rm-enterprise/rm-enterprise-share - MVN_SKIP='-Dmaven.javadoc.skip=true -Dmaven.source.skip=true -DskipTests' - AWS_ACCESS_KEY_ID=${CREATE_BUCKET_AWS_ACCESS_KEY} - AWS_SECRET_ACCESS_KEY=${CREATE_BUCKET_AWS_SECRET_KEY} @@ -17,3 +10,4 @@ env: - SHARE_URL="http://localhost:8181/share" - DISPLAY=:99.0 - WEBDRIVER_ARGUMENTS='-Dwebdriver.local.grid=true -Dwebdriver.browser=RemoteFireFox -Dwebdriver.localGrid=false -Dorg.alfresco.rm.timeout_seconds.MEDIUM=30' + - LOG_WARN="-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn" diff --git a/travis/.travis.integration-test-MySQL.yml b/travis/.travis.integration-test-MySQL.yml index 05934be796..a27f9613d9 100644 --- a/travis/.travis.integration-test-MySQL.yml +++ b/travis/.travis.integration-test-MySQL.yml @@ -6,17 +6,14 @@ jobs: include: - &integration_test_on_MYSQL name: "Community Integrations Tests on MySQL" - services: docker stage: Tests if: branch =~ /(release\/.*$|master)/ OR commit_message =~ /\[execute tests on MySQL\]/ - install: + before_script: - docker run -d -p 3307:3306 -e MYSQL_ROOT_PASSWORD=alfresco -e MYSQL_USER=alfresco -e MYSQL_DATABASE=alfresco -e MYSQL_PASSWORD=alfresco mysql:5.7.23 --transaction-isolation='READ-COMMITTED' - docker run -d -p 61617:61617 -p 5673:5673 alfresco/alfresco-activemq:5.15.8 - script: - - travis_retry travis_wait 80 mvn -B -q clean install -Puse-mysql -DskipTests -Dskip.integrationtests=false -Dmy.db.name=alfresco -Dmy.db.port=3307 -Dcommunity -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn + script: travis_retry travis_wait 80 mvn -B -q clean verify ${MVN_SKIP} -Puse-mysql -Dskip.integrationtests=false -Dmy.db.name=alfresco -Dmy.db.port=3307 -f rm-community/pom.xml -amd ${LOG_WARN} - <<: *integration_test_on_MYSQL name: "Enterprise Integrations Tests on MySQL" - install: - - travis_retry travis_wait 60 mvn -B -q clean install ${MVN_SKIP} -f rm-community/pom.xml -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -am - script: travis_retry travis_wait 80 mvn -B -q clean install ${MVN_SKIP} -Puse-mysql -Dskip.integrationtests=false -Dmy.db.name=alfresco -Dmy.db.port=3307 -f rm-enterprise/pom.xml -amd -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn + install: travis_retry travis_wait 60 mvn -B -V -q clean install ${MVN_SKIP} + script: travis_retry travis_wait 80 mvn -B -q clean verify ${MVN_SKIP} -Puse-mysql -Dskip.integrationtests=false -Dmy.db.name=alfresco -Dmy.db.port=3307 -f rm-enterprise/pom.xml -amd ${LOG_WARN} diff --git a/travis/.travis.publish-stage.yml b/travis/.travis.publish-stage.yml index dd2dea54ba..a2a73c09c3 100644 --- a/travis/.travis.publish-stage.yml +++ b/travis/.travis.publish-stage.yml @@ -3,9 +3,9 @@ jobs: - name: "Community Publish to S3 Release Bucket" stage: Publish if: commit_message =~ /\[community release .*\]/ AND commit_message =~ /\[publish\]/ - before_script: source scripts/set-release-variables.sh + before_script: source travis/scripts/set-release-variables.sh script: skip - before_deploy: bash scripts/zip-artifacts-release.sh "community" + before_deploy: bash travis/scripts/zip-artifacts-release.sh "community" deploy: - provider: s3 access_key_id: ${RELEASE_AWS_ACCESS_KEY} @@ -24,9 +24,9 @@ jobs: - name: "Enterprise Publish to S3 Release Bucket" stage: Publish if: commit_message =~ /\[enterprise release .*\]/ AND commit_message =~ /\[publish\]/ - before_script: source scripts/set-release-variables.sh + before_script: source travis/scripts/set-release-variables.sh script: skip - before_deploy: bash scripts/zip-artifacts-release.sh "enterprise" + before_deploy: bash travis/scripts/zip-artifacts-release.sh "enterprise" deploy: - provider: s3 access_key_id: ${RELEASE_AWS_ACCESS_KEY} diff --git a/travis/.travis.release-stage.yml b/travis/.travis.release-stage.yml index acdf93a64a..8d2301df95 100644 --- a/travis/.travis.release-stage.yml +++ b/travis/.travis.release-stage.yml @@ -4,13 +4,13 @@ jobs: stage: Release if: commit_message =~ /\[community release .*\]/ before_script: - - source scripts/set-release-variables.sh - - bash scripts/check-existing-tags.sh "alfresco/alfresco-governance-share-community" + - source travis/scripts/set-release-variables.sh + - bash travis/scripts/check-existing-tags.sh "alfresco/alfresco-governance-share-community" script: - - bash scripts/release.sh "community" + - bash travis/scripts/community_release.sh before_deploy: - - bash scripts/zip-artifacts-staging.sh "community" - - bash scripts/pushDockerDigestTag.sh -i quay.io/alfresco/alfresco-governance-repository-community -i quay.io/alfresco/alfresco-governance-share-community -r quay.io -t ${RELEASE_VERSION} + - bash travis/scripts/zip-artifacts-staging.sh "community" + - bash travis/scripts/pushDockerDigestTag.sh -i quay.io/alfresco/alfresco-governance-repository-community -i quay.io/alfresco/alfresco-governance-share-community -r quay.io -t ${RELEASE_VERSION} deploy: - provider: s3 access_key_id: ${STAGING_AWS_ACCESS_KEY} @@ -30,12 +30,12 @@ jobs: stage: Release if: commit_message =~ /\[enterprise release .*\]/ before_script: - - source scripts/set-release-variables.sh + - source travis/scripts/set-release-variables.sh script: - - bash scripts/release.sh "enterprise" + - bash travis/scripts/enterprise_release.sh before_deploy: - - bash scripts/zip-artifacts-staging.sh "enterprise" - - bash scripts/pushDockerDigestTag.sh -i quay.io/alfresco/alfresco-governance-repository-enterprise -i quay.io/alfresco/alfresco-governance-share-enterprise -r quay.io -t ${RELEASE_VERSION} + - bash travis/scripts/zip-artifacts-staging.sh "enterprise" + - bash travis/scripts/pushDockerDigestTag.sh -i quay.io/alfresco/alfresco-governance-repository-enterprise -i quay.io/alfresco/alfresco-governance-share-enterprise -r quay.io -t ${RELEASE_VERSION} deploy: - provider: s3 access_key_id: ${STAGING_AWS_ACCESS_KEY} diff --git a/travis/.travis.tests-stage.yml b/travis/.travis.tests-stage.yml index c774080e8d..9b1fca53e2 100644 --- a/travis/.travis.tests-stage.yml +++ b/travis/.travis.tests-stage.yml @@ -1,5 +1,15 @@ jobs: include: + - name: "Source Clear Scan (SCA)" + stage: Tests + if: branch = master OR branch =~ /release\/V3.\d+.*/ + script: travis_wait 30 bash travis/scripts/source_clear.sh + + - name: "Unit & Integration Tests" + stage: Tests + install: travis_retry travis_wait 60 mvn -B -V -q clean install ${MVN_SKIP} + script: travis_retry travis_wait 120 mvn -B -q verify -Dskip.integrationtests=false ${LOG_WARN} + - name: "Community Rest API Tests" stage: Tests addons: @@ -8,28 +18,29 @@ jobs: - ./rm-automation/rm-automation-community-rest-api/target/reports/rm-automation-community-rest-api.log - alfresco.log - solr.log - target_paths: $TRAVIS_BUILD_NUMBER/$TRAVIS_JOB_NUMBER + target_paths: ${TRAVIS_BUILD_NUMBER}/${TRAVIS_JOB_NUMBER} install: - | - if [[ ${TRAVIS_BRANCH} == *community* ]]; then - travis_retry travis_wait 90 mvn -B -q install $MVN_SKIP -PbuildDockerImage -pl :alfresco-governance-services-community-repo -am + if [[ ${TRAVIS_COMMIT_MESSAGE} == *"[tests on community]"* ]]; then + travis_retry travis_wait 90 mvn -B -q install ${MVN_SKIP} -PbuildDockerImage -pl :alfresco-governance-services-community-repo -am else - travis_retry travis_wait 90 mvn -B -q install $MVN_SKIP -PbuildDockerImage -pl :alfresco-governance-services-enterprise-repo -am + travis_retry travis_wait 90 mvn -B -q install ${MVN_SKIP} -PbuildDockerImage -pl :alfresco-governance-services-enterprise-repo -am fi - travis_retry travis_wait 30 mvn -B -U -q clean install ${MVN_SKIP} -pl :alfresco-governance-services-automation-community-rest-api -am before_script: - | - if [[ ${TRAVIS_BRANCH} == *community* ]]; then - bash scripts/startAlfresco.sh $COMMUNITY_REPO_PATH false + if [[ ${TRAVIS_COMMIT_MESSAGE} == *"[tests on community]"* ]]; then + bash travis/scripts/startAlfresco.sh rm-community/rm-community-repo false else - bash scripts/startAlfresco.sh $ENTERPRISE_REPO_PATH false + bash travis/scripts/startAlfresco.sh rm-enterprise/rm-enterprise-repo false fi - - bash scripts/waitForAlfrescoToStart.sh + - bash travis/scripts/waitForAlfrescoToStart.sh script: travis_wait 40 mvn -B test -pl :alfresco-governance-services-automation-community-rest-api -Dskip.automationtests=false - after_script: bash scripts/getLogs.sh + after_script: bash travis/scripts/getLogs.sh - name: "Enterprise Rest API Tests" stage: Tests + if: commit_message !~ /\[tests on community\]/ addons: artifacts: paths: @@ -38,19 +49,20 @@ jobs: - solr.log target_paths: $TRAVIS_BUILD_NUMBER/$TRAVIS_JOB_NUMBER install: - - travis_retry travis_wait 90 mvn -B -q install $MVN_SKIP -PbuildDockerImage -pl :alfresco-governance-services-enterprise-repo -am + - travis_retry travis_wait 90 mvn -B -q install ${MVN_SKIP} -PbuildDockerImage -pl :alfresco-governance-services-enterprise-repo -am - travis_retry travis_wait 30 mvn -B -U -q clean install ${MVN_SKIP} -pl :alfresco-governance-services-automation-enterprise-rest-api -am before_script: - - bash scripts/startAlfresco.sh $ENTERPRISE_REPO_PATH false - - bash scripts/waitForAlfrescoToStart.sh - - bash scripts/dockerLimitMemory.sh + - bash travis/scripts/startAlfresco.sh rm-enterprise/rm-enterprise-repo false + - bash travis/scripts/waitForAlfrescoToStart.sh + - bash travis/scripts/dockerLimitMemory.sh - sudo free -m -t script: - travis_wait 90 mvn -B test -pl :alfresco-governance-services-automation-enterprise-rest-api -Dskip.automationtests=false - after_script: bash scripts/getLogs.sh + after_script: bash travis/scripts/getLogs.sh - name: "Enterprise Rest API WORM Tests" stage: Tests + if: commit_message !~ /\[tests on community\]/ addons: artifacts: paths: @@ -62,16 +74,17 @@ jobs: - travis_retry travis_wait 90 mvn -B -U -q clean install ${MVN_SKIP} -PbuildDockerImage -pl :alfresco-governance-services-enterprise-repo,:alfresco-governance-services-enterprise-share -am - travis_retry travis_wait 30 mvn -B -U -q clean install ${MVN_SKIP} -pl :alfresco-governance-services-automation-enterprise-rest-api -am before_script: - - bash scripts/create-worm-bucket.sh - - bash scripts/start-compose.sh "${ENTERPRISE_SHARE_PATH}/docker-compose-worm-support-rest.yml" - - bash scripts/waitForAlfrescoToStart.sh + - bash travis/scripts/create-worm-bucket.sh + - bash travis/scripts/start-compose.sh "rm-enterprise/rm-enterprise-share/docker-compose-worm-support-rest.yml" + - bash travis/scripts/waitForAlfrescoToStart.sh script: mvn -B test -pl :alfresco-governance-services-automation-enterprise-rest-api -DsuiteXmlFile=wormTestSuite.xml -Dskip.automationtests=false after_script: - - bash scripts/getLogs.sh - - bash scripts/cleanup.sh + - bash travis/scripts/getLogs.sh + - bash travis/scripts/cleanup.sh - name: "Enterprise Rest API Cluster Tests" stage: Tests + if: commit_message !~ /\[tests on community\]/ addons: artifacts: paths: @@ -82,8 +95,8 @@ jobs: - travis_retry travis_wait 90 mvn -B -U -q clean install ${MVN_SKIP} -PbuildDockerImage -pl :alfresco-governance-services-enterprise-repo -am - travis_retry travis_wait 30 mvn -B -U -q clean install ${MVN_SKIP} -pl :alfresco-governance-services-automation-enterprise-rest-api -am before_script: - - bash scripts/start-compose.sh "${ENTERPRISE_REPO_PATH}/docker-compose-cluster.yml" - - bash scripts/waitForAlfrescoToStart.sh + - bash travis/scripts/start-compose.sh "rm-enterprise/rm-enterprise-repo/docker-compose-cluster.yml" + - bash travis/scripts/waitForAlfrescoToStart.sh script: mvn -B test -pl :alfresco-governance-services-automation-enterprise-rest-api -DsuiteXmlFile=clusterTestSuite.xml -Dskip.automationtests=false after_failure: - docker ps -a | grep '_alfresco_1' | awk '{print $1}' | xargs docker logs | tail -5000 @@ -106,20 +119,20 @@ jobs: install: - | if [[ ${TRAVIS_COMMIT_MESSAGE} == *"[tests on community]"* ]]; then - travis_retry travis_wait 90 mvn -B -q install $MVN_SKIP -PbuildDockerImage -pl :alfresco-governance-services-community-repo,:alfresco-governance-services-community-share -am - bash scripts/startAlfresco.sh $COMMUNITY_SHARE_PATH false - bash scripts/waitForAlfrescoToStart.sh + travis_retry travis_wait 90 mvn -B -q install ${MVN_SKIP} -PbuildDockerImage -pl :alfresco-governance-services-community-repo,:alfresco-governance-services-community-share -am + bash travis/scripts/startAlfresco.sh rm-community/rm-community-share false + bash travis/scripts/waitForAlfrescoToStart.sh else - travis_retry travis_wait 90 mvn -B -q install $MVN_SKIP -PbuildDockerImage -pl :alfresco-governance-services-enterprise-repo,:alfresco-governance-services-enterprise-share -am - bash scripts/startAlfresco.sh $ENTERPRISE_SHARE_PATH true - bash scripts/waitForAlfrescoToStart.sh - bash scripts/dockerLimitMemory.sh + travis_retry travis_wait 90 mvn -B -q install ${MVN_SKIP} -PbuildDockerImage -pl :alfresco-governance-services-enterprise-repo,:alfresco-governance-services-enterprise-share -am + bash travis/scripts/startAlfresco.sh rm-enterprise/rm-enterprise-share true + bash travis/scripts/waitForAlfrescoToStart.sh + bash travis/scripts/dockerLimitMemory.sh sudo free -m -t fi - travis_retry travis_wait 30 mvn -B -U -q clean install ${MVN_SKIP} -pl :alfresco-governance-services-automation-ui -am script: - travis_wait 90 xvfb-run --server-args="-screen 0 1920x1080x24" mvn -B test -pl :alfresco-governance-services-automation-ui -Dskip.automationtests=false -DsuiteXmlFile=communitySmokeRecords.xml -Dshare.url=${SHARE_URL} -Dalfresco.url=${ALFRESCO_URL} ${WEBDRIVER_ARGUMENTS} - after_script: bash scripts/getLogs.sh + after_script: bash travis/scripts/getLogs.sh - <<: *community_shared_UI_configuration name: "Community Smoke UI Tests for actions in RM site" @@ -152,15 +165,15 @@ jobs: - share.log target_paths: $TRAVIS_BUILD_NUMBER/$TRAVIS_JOB_NUMBER install: - - travis_retry travis_wait 90 mvn -B -q install $MVN_SKIP -PbuildDockerImage -pl :alfresco-governance-services-enterprise-repo,:alfresco-governance-services-enterprise-share -am + - travis_retry travis_wait 90 mvn -B -q install ${MVN_SKIP} -PbuildDockerImage -pl :alfresco-governance-services-enterprise-repo,:alfresco-governance-services-enterprise-share -am - travis_retry travis_wait 30 mvn -B -U -q clean install ${MVN_SKIP} -pl :alfresco-governance-services-automation-ui -am - - bash scripts/startAlfresco.sh $ENTERPRISE_SHARE_PATH true - - bash scripts/waitForAlfrescoToStart.sh - - bash scripts/dockerLimitMemory.sh + - bash travis/scripts/startAlfresco.sh rm-enterprise/rm-enterprise-share true + - bash travis/scripts/waitForAlfrescoToStart.sh + - bash travis/scripts/dockerLimitMemory.sh - sudo free -m -t script: - travis_wait 90 xvfb-run --server-args="-screen 0 1920x1080x24" mvn -B test -pl :alfresco-governance-services-automation-ui -Dskip.automationtests=false -DsuiteXmlFile=enterpriseLevel2Tests.xml -Dshare.url=${SHARE_URL} -Dalfresco.url=${ALFRESCO_URL} ${WEBDRIVER_ARGUMENTS} - after_script: bash scripts/getLogs.sh + after_script: bash travis/scripts/getLogs.sh - <<: *enterprise_shared_UI_configuration name: "Enterprise Classification Level 2 UI Tests" @@ -198,11 +211,11 @@ jobs: - travis_retry travis_wait 90 mvn -B -U -q clean install ${MVN_SKIP} -PbuildDockerImage -pl :alfresco-governance-services-enterprise-repo,:alfresco-governance-services-enterprise-share -am - travis_retry travis_wait 30 mvn -B -U -q clean install ${MVN_SKIP} -pl :alfresco-governance-services-automation-ui -am before_script: - - bash scripts/create-worm-bucket.sh - - bash scripts/start-compose.sh "${ENTERPRISE_SHARE_PATH}/docker-compose-worm-support-ui.yml" - - bash scripts/waitForAlfrescoToStart.sh + - bash travis/scripts/create-worm-bucket.sh + - bash travis/scripts/start-compose.sh "rm-enterprise/rm-enterprise-share/docker-compose-worm-support-ui.yml" + - bash travis/scripts/waitForAlfrescoToStart.sh script: - travis_wait 90 xvfb-run --server-args="-screen 0 1920x1080x24" mvn -B test -pl :alfresco-governance-services-automation-ui -DsuiteXmlFile=wormTestSuite.xml -Dskip.automationtests=false -Dshare.url=${SHARE_URL} -Dalfresco.url=${ALFRESCO_URL} ${WEBDRIVER_ARGUMENTS} after_script: - - bash scripts/getLogs.sh - - bash scripts/cleanup.sh + - bash travis/scripts/getLogs.sh + - bash travis/scripts/cleanup.sh diff --git a/scripts/check-existing-tags.sh b/travis/scripts/check-existing-tags.sh similarity index 100% rename from scripts/check-existing-tags.sh rename to travis/scripts/check-existing-tags.sh diff --git a/scripts/cleanImages.sh b/travis/scripts/cleanImages.sh old mode 100755 new mode 100644 similarity index 100% rename from scripts/cleanImages.sh rename to travis/scripts/cleanImages.sh diff --git a/scripts/cleanup.sh b/travis/scripts/cleanup.sh similarity index 100% rename from scripts/cleanup.sh rename to travis/scripts/cleanup.sh diff --git a/travis/scripts/community_release.sh b/travis/scripts/community_release.sh new file mode 100644 index 0000000000..07d8f70e77 --- /dev/null +++ b/travis/scripts/community_release.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash +set -e + +# Use full history for release +git checkout -B "${TRAVIS_BRANCH}" + +git config user.email "${GIT_EMAIL}" + +if [ -z ${RELEASE_VERSION} ] || [ -z ${DEVELOPMENT_VERSION} ]; then + echo "Please provide a Release and Development version" + exit 1 +fi + +mvn -B \ + -Dusername="${GIT_USERNAME}" \ + -Dpassword="${GIT_PASSWORD}" \ + -DreleaseVersion=${RELEASE_VERSION} \ + -DdevelopmentVersion=${DEVELOPMENT_VERSION} \ + -DscmCommentPrefix="[maven-release-plugin][skip ci] " \ + -DuseReleaseProfile=false \ + "-Darguments=-DskipTests -P\!enterprise -Prelease-community,community-release" \ + release:clean release:prepare release:perform diff --git a/scripts/create-worm-bucket.sh b/travis/scripts/create-worm-bucket.sh similarity index 100% rename from scripts/create-worm-bucket.sh rename to travis/scripts/create-worm-bucket.sh diff --git a/scripts/delete-test-buckets-lambda.py b/travis/scripts/delete-test-buckets-lambda.py similarity index 100% rename from scripts/delete-test-buckets-lambda.py rename to travis/scripts/delete-test-buckets-lambda.py diff --git a/scripts/dockerLimitMemory.sh b/travis/scripts/dockerLimitMemory.sh similarity index 100% rename from scripts/dockerLimitMemory.sh rename to travis/scripts/dockerLimitMemory.sh diff --git a/scripts/getLogs.sh b/travis/scripts/getLogs.sh similarity index 100% rename from scripts/getLogs.sh rename to travis/scripts/getLogs.sh diff --git a/scripts/pushDockerDigestTag.sh b/travis/scripts/pushDockerDigestTag.sh old mode 100755 new mode 100644 similarity index 100% rename from scripts/pushDockerDigestTag.sh rename to travis/scripts/pushDockerDigestTag.sh diff --git a/scripts/set-release-variables.sh b/travis/scripts/set-release-variables.sh old mode 100755 new mode 100644 similarity index 100% rename from scripts/set-release-variables.sh rename to travis/scripts/set-release-variables.sh diff --git a/scripts/source_clear.sh b/travis/scripts/source_clear.sh similarity index 100% rename from scripts/source_clear.sh rename to travis/scripts/source_clear.sh diff --git a/scripts/start-compose.sh b/travis/scripts/start-compose.sh old mode 100755 new mode 100644 similarity index 100% rename from scripts/start-compose.sh rename to travis/scripts/start-compose.sh diff --git a/scripts/startAlfresco.sh b/travis/scripts/startAlfresco.sh similarity index 100% rename from scripts/startAlfresco.sh rename to travis/scripts/startAlfresco.sh diff --git a/scripts/waitForAlfrescoToStart.sh b/travis/scripts/waitForAlfrescoToStart.sh old mode 100755 new mode 100644 similarity index 100% rename from scripts/waitForAlfrescoToStart.sh rename to travis/scripts/waitForAlfrescoToStart.sh diff --git a/scripts/zip-artifacts-release.sh b/travis/scripts/zip-artifacts-release.sh similarity index 100% rename from scripts/zip-artifacts-release.sh rename to travis/scripts/zip-artifacts-release.sh diff --git a/scripts/zip-artifacts-staging.sh b/travis/scripts/zip-artifacts-staging.sh old mode 100755 new mode 100644 similarity index 100% rename from scripts/zip-artifacts-staging.sh rename to travis/scripts/zip-artifacts-staging.sh