mirror of
https://github.com/Alfresco/acs-community-packaging.git
synced 2025-09-10 14:12:09 +00:00
Compare commits
21 Commits
25.2.0
...
acs-commun
Author | SHA1 | Date | |
---|---|---|---|
|
1e6b797d57 | ||
|
d03689f5d3 | ||
|
99fc0a330a | ||
|
16ad37b169 | ||
|
1798d0fd2b | ||
|
1bb7035e68 | ||
|
65d3a861ec | ||
|
524228771d | ||
|
0f96d69af6 | ||
|
541cb9a326 | ||
|
3401c50215 | ||
|
8d1e2a5d5f | ||
|
4441e82213 | ||
|
b95a7df236 | ||
|
a4dcd3b5b5 | ||
|
fb0d9b0b37 | ||
|
e592d0bf23 | ||
|
405dd92d8d | ||
|
48fde80eca | ||
|
a376256826 | ||
|
60cd53cd2d |
44
.travis.settings.xml
Normal file
44
.travis.settings.xml
Normal file
@@ -0,0 +1,44 @@
|
||||
<settings>
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>alfresco-internal</id>
|
||||
<activation>
|
||||
<activeByDefault>true</activeByDefault>
|
||||
</activation>
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>alfresco-internal</id>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
<snapshots>
|
||||
<enabled>true</enabled>
|
||||
</snapshots>
|
||||
<name>Alfresco Internal Repository</name>
|
||||
<url>https://artifacts.alfresco.com/nexus/content/groups/internal</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
<pluginRepositories>
|
||||
<pluginRepository>
|
||||
<id>alfresco-internal</id>
|
||||
<name>Alfresco Internal Repository</name>
|
||||
<url>https://artifacts.alfresco.com/nexus/content/groups/public</url>
|
||||
</pluginRepository>
|
||||
</pluginRepositories>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
|
||||
<servers>
|
||||
<server>
|
||||
<id>alfresco-internal</id>
|
||||
<username>${env.MAVEN_USERNAME}</username>
|
||||
<password>${env.MAVEN_PASSWORD}</password>
|
||||
</server>
|
||||
<server>
|
||||
<id>alfresco-public</id>
|
||||
<username>${env.MAVEN_USERNAME}</username>
|
||||
<password>${env.MAVEN_PASSWORD}</password>
|
||||
</server>
|
||||
</servers>
|
||||
</settings>
|
90
.travis.yml
90
.travis.yml
@@ -19,10 +19,18 @@ branches:
|
||||
only:
|
||||
- master
|
||||
- develop
|
||||
- feature/REPO-4735_Add-release-stages-2
|
||||
|
||||
stages:
|
||||
- name: test
|
||||
if: branch !=feature/REPO-4735_Add-release-stages-2
|
||||
- engineering release
|
||||
- company release
|
||||
|
||||
matrix:
|
||||
include:
|
||||
- name: "WhiteSource scan"
|
||||
- stage: test
|
||||
name: "WhiteSource scan"
|
||||
# only on master and if it is not a PR
|
||||
if: fork = false AND branch = master AND type != pull_request
|
||||
install:
|
||||
@@ -88,3 +96,83 @@ matrix:
|
||||
- ./tests/scripts/wait-for-alfresco-start.sh "http://localhost:8082/alfresco"
|
||||
script:
|
||||
- travis_wait 30 mvn install -q -f tests/tas-integration/pom.xml -Pall-tas-tests -Denvironment=default -DrunBugs=false
|
||||
- stage: Engineering Release
|
||||
name: "Maven release"
|
||||
# only on develop or master branch
|
||||
if: fork = false AND branch = feature/REPO-4735_Add-release-stages-2 AND commit_message !~ /\[no-release\]/
|
||||
# Leaving blank will auto increment the
|
||||
env:
|
||||
- release_version=repo-4735-14
|
||||
- development_version=6.3.0-alpha-6-SNAPSHOT
|
||||
- COMM_RELEASE_VERSION=
|
||||
# Fail the job if there is a docker image tag that matches the release_version (or project version in the POM if not set)
|
||||
before_install:
|
||||
- ./scripts/travis/verifyReleaseTag.sh
|
||||
- "cp .travis.settings.xml $HOME/.m2/settings.xml"
|
||||
install: skip
|
||||
script:
|
||||
# Use full history for release
|
||||
- git checkout -B "${TRAVIS_BRANCH}"
|
||||
# Add email to link commits to user
|
||||
- git config user.email "${GIT_EMAIL}"
|
||||
# Add login to quay.io
|
||||
- docker login quay.io -u ${DOCKER_USERNAME} -p ${DOCKER_PASSWORD}
|
||||
# run build release script
|
||||
# - ./scripts/travis/buildRelease.sh ${release_version} ${development_version}
|
||||
# - travis_wait 30 mvn -B -DskipTests -Darguments="-DskipTests"
|
||||
- travis_wait 30 mvn -B -DskipTests -Darguments="-DskipTests" -Prelease -DscmCommentPrefix="[maven-release-plugin][skip ci] " -Dusername="${GIT_USERNAME}" -Dpassword="${GIT_PASSWORD}" -DdevelopmentVersion=6.3.0-alpha-6-SNAPSHOT -DreleaseVersion=repo-4735-16 release:clean release:prepare release:perform
|
||||
after_failure:
|
||||
- mvn release:rollback -DscmCommentPrefix="[maven-release-plugin][skip ci] "
|
||||
# TODO: SOLUTION 1
|
||||
# Below is a potential solution for deployment of resources
|
||||
# deploy:
|
||||
# - provider: s3
|
||||
# access_key_id: ${AWS_ACCESS_KEY_ID}
|
||||
# secret_access_key: ${AWS_SECRET_ACCESS_KEY}
|
||||
# bucket: "alfresco-artefacts-staging/alfresco-content-services-community/release/${TRAVIS_BRANCH}/${TRAVIS_BUILD_NUMBER}/"
|
||||
# skip_cleanup: true
|
||||
# acl: private
|
||||
# glob: war/target/alfresco.war
|
||||
# on:
|
||||
# all_branches:true
|
||||
# condition: $TRAVIS_BRANCH =~ ^(master|develop)$
|
||||
# - provider: s3
|
||||
# access_key_id: ${AWS_ACCESS_KEY_ID}
|
||||
# secret_access_key: ${AWS_SECRET_ACCESS_KEY}
|
||||
# bucket: "alfresco-artefacts-staging/alfresco-content-services-community/release/${TRAVIS_BRANCH}/${TRAVIS_BUILD_NUMBER}/"
|
||||
# skip_cleanup: true
|
||||
# acl: private
|
||||
# glob: distribution/target/*-distribution*.zip
|
||||
# on:
|
||||
# all_branches:true
|
||||
# condition: $TRAVIS_BRANCH =~ ^(master|develop)$
|
||||
# TODO: SOLUTION 2
|
||||
# Uses AWS CLI in script
|
||||
before_deploy: pip install awscli
|
||||
deploy:
|
||||
- provider: script
|
||||
script: echo "This should only run on master and develop" #./scripts/travis/engineeringReleaseDeployment.sh ${TRAVIS_BUILD_NUMBER} ${TRAVIS_BRANCH}
|
||||
on:
|
||||
all_branches: true
|
||||
condition: $TRAVIS_BRANCH =~ ^(master|develop)$
|
||||
- provider: script
|
||||
script: echo "This should only fun on master" #./scripts/travis/companyReleaseDeployment.sh ${TRAVIS_BUILD_NUMBER} ${TRAVIS_BRANCH}
|
||||
on:
|
||||
branch: master
|
||||
# # This stage could use a script to deploy to S3, as in bamboo, or the above stage can include a deploy section.
|
||||
# - name: Push to S3 # TODO currently placeholder stage
|
||||
# install: skip
|
||||
# script:
|
||||
# - travis_wait 30 echo "This is the Push to S3 stage"
|
||||
# - stage: "Company Release"
|
||||
# # only on master branch
|
||||
# if: fork = false AND branch = feature/REPO-4735_Add-release-stages AND commit_message !~ /\[no-release\]/
|
||||
# name: "Copy to S3 Release"
|
||||
# install: skip # Nothing to build/install as we are just copying from S3 buckets
|
||||
# # TODO
|
||||
# delpoy:
|
||||
# - provider: script
|
||||
# script: ./scripts/travis/companyReleaseDeployment.sh ${TRAVIS_BUILD_NUMBER} ${TRAVIS_BRANCH}
|
||||
# on:
|
||||
# branch: master
|
||||
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>acs-community-packaging</artifactId>
|
||||
<version>6.3.0-SNAPSHOT</version>
|
||||
<version>repo-4735-16</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
@@ -5,7 +5,7 @@ FROM alfresco/alfresco-base-tomcat:8.5.43-java-11-openjdk-centos-7
|
||||
# Set default user information
|
||||
ARG GROUPNAME=Alfresco
|
||||
ARG GROUPID=1000
|
||||
ARG USERNAME=alfresco
|
||||
ARG LINUXUSERNAME=alfresco
|
||||
ARG USERID=33000
|
||||
|
||||
# Set default environment args
|
||||
@@ -73,7 +73,7 @@ RUN yum install -y fontconfig-2.13.0-4.3.el7 \
|
||||
RUN mkdir -p ${TOMCAT_DIR}/conf/Catalina/localhost && \
|
||||
mkdir -p ${TOMCAT_DIR}/alf_data && \
|
||||
groupadd -g ${GROUPID} ${GROUPNAME} && \
|
||||
useradd -u ${USERID} -G ${GROUPNAME} ${USERNAME} && \
|
||||
useradd -u ${USERID} -G ${GROUPNAME} ${LINUXUSERNAME} && \
|
||||
chgrp -R ${GROUPNAME} ${TOMCAT_DIR} && \
|
||||
chmod g+w ${TOMCAT_DIR}/logs && \
|
||||
chmod g+rx ${TOMCAT_DIR}/conf && \
|
||||
@@ -94,4 +94,4 @@ RUN mkdir -p ${TOMCAT_DIR}/conf/Catalina/localhost && \
|
||||
# Changes are also required to the docker-compose/docker-compose.yml file.
|
||||
# EXPOSE 8000
|
||||
|
||||
USER ${USERNAME}
|
||||
USER ${LINUXUSERNAME}
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>acs-community-packaging</artifactId>
|
||||
<version>6.3.0-SNAPSHOT</version>
|
||||
<version>repo-4735-16</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
21
pom.xml
21
pom.xml
@@ -2,7 +2,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>acs-community-packaging</artifactId>
|
||||
<name>Alfresco Content Services Community Packaging</name>
|
||||
<version>6.3.0-SNAPSHOT</version>
|
||||
<version>repo-4735-16</version>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<parent>
|
||||
@@ -46,10 +46,10 @@
|
||||
</profiles>
|
||||
|
||||
<scm>
|
||||
<connection>scm:git:git@github.com:Alfresco/acs-community-packaging.git</connection>
|
||||
<developerConnection>scm:git:git@github.com:Alfresco/acs-community-packaging.git</developerConnection>
|
||||
<connection>scm:git:https://github.com/Alfresco/acs-community-packaging.git</connection>
|
||||
<developerConnection>scm:git:https://github.com/Alfresco/acs-community-packaging.git</developerConnection>
|
||||
<url>https://github.com/Alfresco/acs-community-packaging</url>
|
||||
<tag>HEAD</tag>
|
||||
<tag>acs-community-packaging-repo-4735-16</tag>
|
||||
</scm>
|
||||
|
||||
<distributionManagement>
|
||||
@@ -116,6 +116,8 @@
|
||||
<dependency.tas-webdav.version>1.5</dependency.tas-webdav.version>
|
||||
<dependency.tas-ftp.version>1.4</dependency.tas-ftp.version>
|
||||
<dependency.tas-dataprep.version>2.3</dependency.tas-dataprep.version>
|
||||
|
||||
<maven.build.sourceVersion>11</maven.build.sourceVersion>
|
||||
</properties>
|
||||
|
||||
<dependencyManagement>
|
||||
@@ -543,4 +545,15 @@
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<configuration>
|
||||
<source>11</source>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>acs-community-packaging</artifactId>
|
||||
<version>6.3.0-SNAPSHOT</version>
|
||||
<version>repo-4735-16</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
<packaging>pom</packaging>
|
||||
|
41
scripts/travis/buildRelease.sh
Executable file
41
scripts/travis/buildRelease.sh
Executable file
@@ -0,0 +1,41 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
releaseVersion=$1
|
||||
developmentVersion=$2
|
||||
scm_path=$(mvn help:evaluate -Dexpression=project.scm.url -q -DforceStdout)
|
||||
|
||||
git checkout -B "${TRAVIS_BRANCH}"
|
||||
|
||||
if [ -z ${releaseVersion} ] || [ -z ${developmentVersion} ];
|
||||
then echo skip
|
||||
if ${TRAVIS_BRANCH} == "master";
|
||||
then echo "Please provide a Release and Development verison"
|
||||
exit -1
|
||||
fi
|
||||
# mvn --batch-mode \
|
||||
# -Dusername="${GIT_USERNAME}" \
|
||||
# -Dpassword="${GIT_PASSWORD}" \
|
||||
# -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} " \
|
||||
# -Prelease \
|
||||
# release:prepare release:perform
|
||||
else
|
||||
mvn --batch-mode \
|
||||
-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} " \
|
||||
-Prelease \
|
||||
release:clean release:prepare release:perform
|
||||
fi
|
16
scripts/travis/companyReleaseDeployment.sh
Executable file
16
scripts/travis/companyReleaseDeployment.sh
Executable file
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
if [ ${COMM_RELEASE_VERSION} = "" ];
|
||||
then
|
||||
exit -1
|
||||
fi
|
||||
|
||||
build_number=$1
|
||||
branch_name=$2
|
||||
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
|
||||
aws s3 cp --acl private $SOURCE/alfresco-content-services-community-distribution-$release_version.zip $DESTINATION/alfresco-content-services-community-distribution-$release_version.zip
|
16
scripts/travis/engineeringReleaseDeployment.sh
Executable file
16
scripts/travis/engineeringReleaseDeployment.sh
Executable file
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env bash
|
||||
set -env
|
||||
|
||||
build_number=$1
|
||||
branch_name=$2
|
||||
release_stage=release
|
||||
s3_location=s3://alfresco-artefacts-staging/alfresco-content-services-community/$release_stage/$branch_name/$build_number/
|
||||
echo_s3_location=https://s3.console.aws.amazon.com/s3/buckets/alfresco-artefacts-staging/alfresco-content-services-community/$release_stage
|
||||
|
||||
aws s3 cp --acl private war/target/alfresco.war $s3_location
|
||||
aws s3 cp --acl private distribution/target/*-distribution*.zip $s3_location
|
||||
|
||||
mkdir -p target
|
||||
touch target/README.txt
|
||||
|
||||
distribution_zip_name=`ls distribution/target/*-distribution*.zip | xargs -n 1 basename`
|
35
scripts/travis/verifyReleaseTag.sh
Executable file
35
scripts/travis/verifyReleaseTag.sh
Executable file
@@ -0,0 +1,35 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
alfresco_docker_image="alfresco/alfresco-content-repository-community"
|
||||
if [ -v ${release_version} ]||[ -z ${release_version} ]; then
|
||||
# if we don't have a user added release version, get the verison from the pom
|
||||
pom_version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
|
||||
if echo $pom_version | grep -q ".*-SNAPSHOT"; then
|
||||
release_version=${pom_version%-*} # remove everything after the last '-'
|
||||
else
|
||||
release_version=$pom_version
|
||||
fi
|
||||
fi
|
||||
docker_image_full_name="$alfresco_docker_image:$release_version"
|
||||
|
||||
function docker_image_exists() {
|
||||
local image_full_name="$1"; shift
|
||||
local wait_time="${1:-5}"
|
||||
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")"
|
||||
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
|
||||
else
|
||||
false
|
||||
fi
|
||||
}
|
||||
|
||||
if docker_image_exists $docker_image_full_name; then
|
||||
echo "Tag $release_version already pushed, release process will interrupt."
|
||||
exit -1
|
||||
else
|
||||
echo "The $release_version tag was not found"
|
||||
fi
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>acs-community-packaging</artifactId>
|
||||
<version>6.3.0-SNAPSHOT</version>
|
||||
<version>repo-4735-16</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
Reference in New Issue
Block a user