Compare commits

...

34 Commits

Author SHA1 Message Date
Travis CI User
ff9685ac67 [maven-release-plugin][skip ci] prepare release acs-community-packaging-repo-4735-2-1 2020-02-27 17:25:33 +00:00
David Edwards
8d3762f416 Bump release version 2020-02-27 16:59:38 +00:00
Travis CI User
ed26c7b258 [maven-release-plugin][skip ci] rollback the release of acs-community-packaging-repo-4735-16 2020-02-27 16:56:16 +00:00
Travis CI User
117b65879f [maven-release-plugin][skip ci] prepare release acs-community-packaging-repo-4735-16 2020-02-27 16:56:05 +00:00
David Edwards
068e7066bf add extra logging and remove release:clean 2020-02-27 16:54:29 +00:00
Travis CI User
6a6df0dccd [maven-release-plugin][skip ci] rollback the release of acs-community-packaging-repo-4735-16 2020-02-27 16:48:05 +00:00
Travis CI User
6ed957ca77 [maven-release-plugin][skip ci] prepare release acs-community-packaging-repo-4735-16 2020-02-27 16:47:21 +00:00
David Edwards
9c4b53bec8 Merge branch 'feature/REPO-4735_Add-release-stages-2' of github.com:Alfresco/acs-community-packaging into feature/REPO-4735_Add-release-stages-2 2020-02-27 16:20:56 +00:00
David Edwards
656c3a9c0f Update .travis.yml 2020-02-27 16:20:51 +00:00
Travis CI User
9b07a93890 [maven-release-plugin][skip ci] rollback the release of acs-community-packaging-repo-4735-16 2020-02-27 16:19:18 +00:00
Travis CI User
d0e6c6bed7 [maven-release-plugin][skip ci] prepare release acs-community-packaging-repo-4735-16 2020-02-27 16:19:05 +00:00
David Edwards
66044db9cc Comment out amp installation
Potential place for errors.
2020-02-27 16:01:53 +00:00
Travis CI User
1df4c8f7c2 [maven-release-plugin][skip ci] prepare for next development iteration 2020-02-27 13:11:34 +00:00
Travis CI User
1e6b797d57 [maven-release-plugin][skip ci] prepare release acs-community-packaging-repo-4735-16 2020-02-27 13:11:27 +00:00
David Edwards
d03689f5d3 Update release version 2020-02-27 13:09:44 +00:00
Travis CI User
99fc0a330a [maven-release-plugin][skip ci] rollback the release of acs-community-packaging-repo-4735-15 2020-02-27 12:47:50 +00:00
Travis CI User
16ad37b169 [maven-release-plugin][skip ci] prepare release acs-community-packaging-repo-4735-15 2020-02-27 12:47:04 +00:00
David Edwards
1798d0fd2b Remove detailed logging
Hit log limit in travis
2020-02-27 12:21:23 +00:00
Travis CI User
1bb7035e68 [maven-release-plugin][skip ci] prepare for next development iteration 2020-02-27 12:09:13 +00:00
Travis CI User
65d3a861ec [maven-release-plugin][skip ci] prepare release acs-community-packaging-repo-4735-15 2020-02-27 12:09:04 +00:00
David Edwards
524228771d REPO-4735 Fix java11 javadoc 8 error
(cherry picked from commit 91f66cdacc)
2020-02-27 11:40:07 +00:00
David Edwards
0f96d69af6 REPO-4735-Use https scm connection
(cherry picked from commit d8c15c846c)
2020-02-27 11:40:01 +00:00
David Edwards
541cb9a326 Create .travis.settings.xml 2020-02-27 11:35:05 +00:00
David Edwards
3401c50215 Make scripts executable 2020-02-27 11:28:40 +00:00
David Edwards
8d1e2a5d5f Add WIP scripts from original branch 2020-02-27 11:21:57 +00:00
David Edwards
4441e82213 Create verifyReleaseTag.sh 2020-02-27 11:21:35 +00:00
David Edwards
b95a7df236 Add branch to build 2020-02-27 11:17:16 +00:00
David Edwards
a4dcd3b5b5 Update .travis.yml 2020-02-27 11:12:18 +00:00
David Edwards
fb0d9b0b37 Replace USERNAME with LINUXUSERNAME to fix windows error 2020-02-27 11:05:54 +00:00
David Edwards
e592d0bf23 Add WIP release stages from original branch 2020-02-27 11:03:46 +00:00
David Edwards
405dd92d8d Disable test stage 2020-02-27 11:03:24 +00:00
David Edwards
48fde80eca Remove extra line 2020-02-27 11:03:10 +00:00
David Edwards
a376256826 Add stages to travis 2020-02-27 11:02:31 +00:00
David Edwards
60cd53cd2d Add branch to build 2020-02-27 11:01:57 +00:00
12 changed files with 267 additions and 14 deletions

44
.travis.settings.xml Normal file
View 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>

View File

@@ -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-2-1
- 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 -e -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=${release_version} 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

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>acs-community-packaging</artifactId>
<version>6.3.0-SNAPSHOT</version>
<version>repo-4735-2-1</version>
<relativePath>../pom.xml</relativePath>
</parent>

View File

@@ -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
@@ -46,8 +46,8 @@ RUN mkdir -p ${TOMCAT_DIR}/amps \
COPY target/amps ${TOMCAT_DIR}/amps
# Install amps on alfresco.war
RUN java -jar ${TOMCAT_DIR}/alfresco-mmt/alfresco-mmt*.jar install \
${TOMCAT_DIR}/amps ${TOMCAT_DIR}/webapps/alfresco -directory -nobackup -force
# RUN java -jar ${TOMCAT_DIR}/alfresco-mmt/alfresco-mmt*.jar install \
# ${TOMCAT_DIR}/amps ${TOMCAT_DIR}/webapps/alfresco -directory -nobackup -force
# Docker CMD from parent image starts the server
@@ -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}

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>acs-community-packaging</artifactId>
<version>6.3.0-SNAPSHOT</version>
<version>repo-4735-2-1</version>
<relativePath>../pom.xml</relativePath>
</parent>

21
pom.xml
View File

@@ -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-2-1</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-2-1</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>

View File

@@ -5,7 +5,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>acs-community-packaging</artifactId>
<version>6.3.0-SNAPSHOT</version>
<version>repo-4735-2-1</version>
<relativePath>../pom.xml</relativePath>
</parent>
<packaging>pom</packaging>

41
scripts/travis/buildRelease.sh Executable file
View 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

View 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

View 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`

View 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

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>acs-community-packaging</artifactId>
<version>6.3.0-SNAPSHOT</version>
<version>repo-4735-2-1</version>
<relativePath>../pom.xml</relativePath>
</parent>