mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
Merge remote-tracking branch 'origin/master' into feature/APPS-276_RestrictionsForWORM_no
This commit is contained in:
@@ -44,6 +44,11 @@
|
|||||||
<username>${env.DOCKERHUB_USERNAME}</username>
|
<username>${env.DOCKERHUB_USERNAME}</username>
|
||||||
<password>${env.DOCKERHUB_PASSWORD}</password>
|
<password>${env.DOCKERHUB_PASSWORD}</password>
|
||||||
</server>
|
</server>
|
||||||
|
<server>
|
||||||
|
<id>quay.io</id>
|
||||||
|
<username>${env.QUAY_USERNAME}</username>
|
||||||
|
<password>${env.QUAY_PASSWORD}</password>
|
||||||
|
</server>
|
||||||
<server>
|
<server>
|
||||||
<id>alfresco-internal</id>
|
<id>alfresco-internal</id>
|
||||||
<username>${env.MAVEN_USERNAME}</username>
|
<username>${env.MAVEN_USERNAME}</username>
|
||||||
@@ -54,5 +59,10 @@
|
|||||||
<username>${env.MAVEN_USERNAME}</username>
|
<username>${env.MAVEN_USERNAME}</username>
|
||||||
<password>${env.MAVEN_PASSWORD}</password>
|
<password>${env.MAVEN_PASSWORD}</password>
|
||||||
</server>
|
</server>
|
||||||
|
<server>
|
||||||
|
<id>alfresco-internal-snapshots</id>
|
||||||
|
<username>${env.MAVEN_USERNAME}</username>
|
||||||
|
<password>${env.MAVEN_PASSWORD}</password>
|
||||||
|
</server>
|
||||||
</servers>
|
</servers>
|
||||||
</settings>
|
</settings>
|
||||||
|
58
.travis.yml
58
.travis.yml
@@ -1,22 +1,28 @@
|
|||||||
|
import:
|
||||||
|
- source: travis-env-vars.yml
|
||||||
os: linux
|
os: linux
|
||||||
dist: xenial
|
dist: xenial
|
||||||
language: java
|
language: java
|
||||||
jdk:
|
jdk:
|
||||||
- openjdk11
|
- openjdk11
|
||||||
|
|
||||||
|
services:
|
||||||
|
- docker
|
||||||
|
|
||||||
branches:
|
branches:
|
||||||
only:
|
only:
|
||||||
- /release\/V2.7.*/
|
- master
|
||||||
- /feature-2.7\/.*/
|
- /feature\/.*/
|
||||||
- /merge-2.7\/.*/
|
- /merge\/.*/
|
||||||
- /hotfix-2.7\/.*/
|
- /hotfix\/.*/
|
||||||
|
|
||||||
cache:
|
cache:
|
||||||
directories:
|
directories:
|
||||||
- $HOME/.m2
|
- $HOME/.m2
|
||||||
|
|
||||||
# the cache can grow constantly
|
# the cache can grow constantly
|
||||||
before_cache:
|
before_cache:
|
||||||
- rm -rf $HOME/.m2/repository/org/alfresco/alfresco-rm*
|
- rm -rf $HOME/.m2/repository/org/alfresco/alfresco-governance-services*
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
- "cp .travis.settings.xml $HOME/.m2/settings.xml"
|
- "cp .travis.settings.xml $HOME/.m2/settings.xml"
|
||||||
@@ -32,18 +38,28 @@ stages:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
include:
|
include:
|
||||||
- name: "Build Community"
|
- name: "Build AGS Community"
|
||||||
stage: Build AGS
|
stage: Build AGS
|
||||||
|
before_script: source scripts/setUpMavenPhase.sh
|
||||||
script:
|
script:
|
||||||
- echo "Build Community"
|
- 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 Enterprise"
|
|
||||||
|
- name: "Build AGS Enterprise"
|
||||||
stage: Build AGS
|
stage: Build AGS
|
||||||
|
before_script: source scripts/setUpMavenPhase.sh
|
||||||
|
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
|
||||||
script:
|
script:
|
||||||
- echo "Build Enterprise"
|
- 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: "Benchmark"
|
|
||||||
|
- name: "Build AGS Benchmark"
|
||||||
stage: Build AGS
|
stage: Build AGS
|
||||||
|
before_script: source scripts/setUpMavenPhase.sh
|
||||||
|
install:
|
||||||
|
- travis_retry travis_wait 80 mvn -B -q clean install $MVN_SKIP -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
|
||||||
script:
|
script:
|
||||||
- echo "Benchmark"
|
- 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: "Community Integrations Tests on MySQL"
|
- name: "Community Integrations Tests on MySQL"
|
||||||
stage: Tests
|
stage: Tests
|
||||||
@@ -55,18 +71,38 @@ jobs:
|
|||||||
- echo "Enterprise Integrations Tests on MySQL"
|
- echo "Enterprise Integrations Tests on MySQL"
|
||||||
- name: "Community Rest API Tests"
|
- name: "Community Rest API Tests"
|
||||||
stage: Tests
|
stage: Tests
|
||||||
|
before_install:
|
||||||
|
- travis_retry travis_wait 90 mvn -B -q install $MVN_SKIP -PbuildDockerImage -pl :alfresco-governance-services-community-repo -am
|
||||||
|
install:
|
||||||
|
- bash scripts/startAlfresco.sh $COMMUNITY_REPO_PATH
|
||||||
|
- bash scripts/waitForAlfrescoToStart.sh
|
||||||
script:
|
script:
|
||||||
- echo "Community Rest API Tests"
|
- echo "Community Rest API Tests"
|
||||||
- name: "Enterprise Rest API Tests"
|
- name: "Enterprise Rest API Tests"
|
||||||
stage: Tests
|
stage: Tests
|
||||||
|
before_install:
|
||||||
|
- travis_retry travis_wait 90 mvn -B -q install $MVN_SKIP -PbuildDockerImage -pl :alfresco-governance-services-enterprise-repo -am
|
||||||
|
install:
|
||||||
|
- bash scripts/startAlfresco.sh $ENTERPRISE_REPO_PATH
|
||||||
|
- bash scripts/waitForAlfrescoToStart.sh
|
||||||
script:
|
script:
|
||||||
- echo "Enterprise Rest API Tests"
|
- echo "Enterprise Rest API Tests"
|
||||||
- name: "Community UI Tests ..."
|
- name: "Community UI Tests ..."
|
||||||
stage: Tests
|
stage: Tests
|
||||||
|
before_install:
|
||||||
|
- travis_retry travis_wait 90 mvn -B -q install $MVN_SKIP -PbuildDockerImage -pl :alfresco-governance-services-community-repo,:alfresco-governance-services-community-share -am
|
||||||
|
install:
|
||||||
|
- bash scripts/startAlfresco.sh $COMMUNITY_SHARE_PATH
|
||||||
|
- bash scripts/waitForAlfrescoToStart.sh
|
||||||
script:
|
script:
|
||||||
- echo "Community UI Tests ..."
|
- echo "Community UI Tests ..."
|
||||||
- name: "Enterprise UI Tests ..."
|
- name: "Enterprise UI Tests ..."
|
||||||
stage: Tests
|
stage: Tests
|
||||||
|
before_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
|
||||||
|
install:
|
||||||
|
- bash scripts/startAlfresco.sh $ENTERPRISE_SHARE_PATH
|
||||||
|
- bash scripts/waitForAlfrescoToStart.sh
|
||||||
script:
|
script:
|
||||||
- echo "Enterprise UI Tests ..."
|
- echo "Enterprise UI Tests ..."
|
||||||
|
|
||||||
|
1
pom.xml
1
pom.xml
@@ -468,6 +468,7 @@
|
|||||||
<id>start</id>
|
<id>start</id>
|
||||||
<phase>pre-integration-test</phase>
|
<phase>pre-integration-test</phase>
|
||||||
<goals>
|
<goals>
|
||||||
|
<goal>stop</goal>
|
||||||
<goal>start</goal>
|
<goal>start</goal>
|
||||||
</goals>
|
</goals>
|
||||||
<configuration>
|
<configuration>
|
||||||
|
@@ -289,13 +289,15 @@ public abstract class CopyMoveLinkFileToBaseAction extends RMActionExecuterAbstr
|
|||||||
// get the create parameter
|
// get the create parameter
|
||||||
Boolean createValue = (Boolean)action.getParameterValue(PARAM_CREATE_RECORD_PATH);
|
Boolean createValue = (Boolean)action.getParameterValue(PARAM_CREATE_RECORD_PATH);
|
||||||
final boolean create = createValue == null ? false : createValue.booleanValue();
|
final boolean create = createValue == null ? false : createValue.booleanValue();
|
||||||
|
QName type = getNodeService().getType(actionedUponNodeRef);
|
||||||
|
final boolean isRecord = getDictionaryService().isSubClass(type, ContentModel.TYPE_CONTENT);
|
||||||
|
|
||||||
// create or resolve the specified path
|
// create or resolve the specified path
|
||||||
path = getTransactionService().getRetryingTransactionHelper().doInTransaction(new RetryingTransactionHelper.RetryingTransactionCallback<NodeRef>()
|
path = getTransactionService().getRetryingTransactionHelper().doInTransaction(new RetryingTransactionHelper.RetryingTransactionCallback<NodeRef>()
|
||||||
{
|
{
|
||||||
public NodeRef execute() throws Throwable
|
public NodeRef execute() throws Throwable
|
||||||
{
|
{
|
||||||
return createOrResolvePath(action, context, actionedUponNodeRef, Arrays.asList(pathElementsArray), targetisUnfiledRecords, create, false);
|
return createOrResolvePath(action, context, actionedUponNodeRef, isRecord, Arrays.asList(pathElementsArray), targetisUnfiledRecords, create, false);
|
||||||
}
|
}
|
||||||
}, false, true);
|
}, false, true);
|
||||||
}
|
}
|
||||||
@@ -308,13 +310,14 @@ public abstract class CopyMoveLinkFileToBaseAction extends RMActionExecuterAbstr
|
|||||||
* @param action Action to use for reporting if anything goes wrong
|
* @param action Action to use for reporting if anything goes wrong
|
||||||
* @param parent Parent of path to be created
|
* @param parent Parent of path to be created
|
||||||
* @param actionedUponNodeRef The node subject to the file/move/copy action
|
* @param actionedUponNodeRef The node subject to the file/move/copy action
|
||||||
|
* @param isRecord true if node is a CONTENT SubType
|
||||||
* @param pathElements The elements of the path to be created
|
* @param pathElements The elements of the path to be created
|
||||||
* @param targetisUnfiledRecords true if the target is within unfiled records
|
* @param targetisUnfiledRecords true if the target is within unfiled records
|
||||||
* @param create true if the path should be creeated if it does not exist
|
* @param create true if the path should be creeated if it does not exist
|
||||||
* @param creating true if we have already created the parent and therefore can skip the check to see if the next path element already exists
|
* @param creating true if we have already created the parent and therefore can skip the check to see if the next path element already exists
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private NodeRef createOrResolvePath(Action action, NodeRef parent, NodeRef actionedUponNodeRef, List<String> pathElements, boolean targetisUnfiledRecords, boolean create, boolean creating)
|
private NodeRef createOrResolvePath(Action action, NodeRef parent, NodeRef actionedUponNodeRef, boolean isRecord, List<String> pathElements, boolean targetisUnfiledRecords, boolean create, boolean creating)
|
||||||
{
|
{
|
||||||
NodeRef nodeRef = null;
|
NodeRef nodeRef = null;
|
||||||
String childName = pathElements.get(0);
|
String childName = pathElements.get(0);
|
||||||
@@ -328,7 +331,7 @@ public abstract class CopyMoveLinkFileToBaseAction extends RMActionExecuterAbstr
|
|||||||
if(create)
|
if(create)
|
||||||
{
|
{
|
||||||
creating = true;
|
creating = true;
|
||||||
boolean lastAsFolder = lastPathElement && (getDictionaryService().isSubClass(getNodeService().getType(actionedUponNodeRef), ContentModel.TYPE_CONTENT) || RecordsManagementModel.TYPE_NON_ELECTRONIC_DOCUMENT.equals(getNodeService().getType(actionedUponNodeRef)));
|
boolean lastAsFolder = lastPathElement && isRecord;
|
||||||
nodeRef = createChild(action, parent, childName, targetisUnfiledRecords, lastAsFolder);
|
nodeRef = createChild(action, parent, childName, targetisUnfiledRecords, lastAsFolder);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -348,7 +351,7 @@ public abstract class CopyMoveLinkFileToBaseAction extends RMActionExecuterAbstr
|
|||||||
}
|
}
|
||||||
if(pathElements.size() > 1)
|
if(pathElements.size() > 1)
|
||||||
{
|
{
|
||||||
nodeRef = createOrResolvePath(action, nodeRef, actionedUponNodeRef, pathElements.subList(1, pathElements.size()), targetisUnfiledRecords, create, creating);
|
nodeRef = createOrResolvePath(action, nodeRef, actionedUponNodeRef, isRecord, pathElements.subList(1, pathElements.size()), targetisUnfiledRecords, create, creating);
|
||||||
}
|
}
|
||||||
return nodeRef;
|
return nodeRef;
|
||||||
}
|
}
|
||||||
|
28
scripts/setUpMavenPhase.sh
Normal file
28
scripts/setUpMavenPhase.sh
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
echo "Branch name: ${TRAVIS_BRANCH}"
|
||||||
|
echo "Pull request: ${TRAVIS_PULL_REQUEST}"
|
||||||
|
echo "Travis job name: ${TRAVIS_JOB_NAME}"
|
||||||
|
branchName=${TRAVIS_BRANCH}
|
||||||
|
imageTag=${branchName:8}
|
||||||
|
echo "Image tag: ${imageTag}"
|
||||||
|
|
||||||
|
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="${imageTag}-latest"
|
||||||
|
else
|
||||||
|
export MAVEN_PHASE="verify"
|
||||||
|
export BUILD_PROFILE="buildDockerImage"
|
||||||
|
export IMAGE_TAG="latest"
|
||||||
|
fi
|
7
scripts/startAlfresco.sh
Normal file
7
scripts/startAlfresco.sh
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# fail script immediately on any errors in external commands and print the lines
|
||||||
|
set -ev
|
||||||
|
|
||||||
|
cd $1
|
||||||
|
docker login quay.io -u ${QUAY_USERNAME} -p ${QUAY_PASSWORD}
|
||||||
|
docker-compose up -d
|
10
travis-env-vars.yml
Normal file
10
travis-env-vars.yml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
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'
|
Reference in New Issue
Block a user