From 9e122378086e4005e56cdf875a6d5be51266ee11 Mon Sep 17 00:00:00 2001 From: Roxana Lucanu-Ghetu Date: Tue, 19 Jun 2018 16:37:52 +0300 Subject: [PATCH 1/9] RM-6372 Intermediate stuff --- .../rm-community-repo/.maven-dockerignore | 1 + rm-community/rm-community-repo/Dockerfile | 6 + .../rm-community-repo/docker-compose.yml | 69 ++++++++ rm-community/rm-community-repo/pom.xml | 163 ++++++++++++++++++ 4 files changed, 239 insertions(+) create mode 100644 rm-community/rm-community-repo/.maven-dockerignore create mode 100644 rm-community/rm-community-repo/Dockerfile create mode 100644 rm-community/rm-community-repo/docker-compose.yml diff --git a/rm-community/rm-community-repo/.maven-dockerignore b/rm-community/rm-community-repo/.maven-dockerignore new file mode 100644 index 0000000000..18bb2a12d0 --- /dev/null +++ b/rm-community/rm-community-repo/.maven-dockerignore @@ -0,0 +1 @@ +target/docker/** \ No newline at end of file diff --git a/rm-community/rm-community-repo/Dockerfile b/rm-community/rm-community-repo/Dockerfile new file mode 100644 index 0000000000..16ad3116ba --- /dev/null +++ b/rm-community/rm-community-repo/Dockerfile @@ -0,0 +1,6 @@ +FROM alfresco/alfresco-content-repository-community:latest + +COPY target/alfresco-rm-community-repo-*.amp /usr/local/tomcat/amps + +RUN java -jar /usr/local/tomcat/alfresco-mmt/alfresco-mmt*.jar install \ + /usr/local/tomcat/amps/alfresco-rm-community-repo-*.amp /usr/local/tomcat/webapps/alfresco -nobackup -force diff --git a/rm-community/rm-community-repo/docker-compose.yml b/rm-community/rm-community-repo/docker-compose.yml new file mode 100644 index 0000000000..24d5867a77 --- /dev/null +++ b/rm-community/rm-community-repo/docker-compose.yml @@ -0,0 +1,69 @@ +version: "3" + +# The acs-community-deployment project contains the product version of docker-compose. +# +# This version is for testing and development use. For testing and debug we need to have a more open version. +# For remote debug we need the CATALINA_OPTS and to expose port 8000. + +services: + alfresco: + image: acs-rm:latest + environment: + CATALINA_OPTS : " + -agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n + " + JAVA_OPTS : " + -Ddb.driver=org.postgresql.Driver + -Ddb.username=alfresco + -Ddb.password=alfresco + -Ddb.url=jdbc:postgresql://postgres:5432/alfresco + -Dsolr.host=solr6 + -Dsolr.port=8983 + -Dsolr.secureComms=none + -Dsolr.base.url=/solr + -Dindex.subsystem.name=solr6 + -Dalfresco.restApi.basicAuthScheme=true + -Dimap.server.enabled=true + -Dftp.enabled=true + -Dftp.dataPortFrom=30000 + -Dftp.dataPortTo=30099 + -Dcifs.enabled=true + " + ports: + - 8082:8080 + - 8000:8000 + - 445:445 + - 143:143 + - "21:21" + - "30000-30099:30000-30099" + + share: + image: alfresco/alfresco-share:6.0.a + environment: + - REPO_HOST=alfresco + - REPO_PORT=8080 + ports: + - 8080:8080 + + postgres: + image: library/postgres:10.1 + environment: + - POSTGRES_PASSWORD=alfresco + - POSTGRES_USER=alfresco + - POSTGRES_DB=alfresco + ports: + - 5432:5432 + + solr6: + image: alfresco/alfresco-search-services:1.1.1 + environment: + #Solr needs to know how to register itself with Alfresco + - SOLR_ALFRESCO_HOST=alfresco + - SOLR_ALFRESCO_PORT=8080 + #Alfresco needs to know how to call solr + - SOLR_SOLR_HOST=solr6 + - SOLR_SOLR_PORT=8983 + #Create the default alfresco and archive cores + - SOLR_CREATE_ALFRESCO_DEFAULTS=alfresco,archive + ports: + - 8083:8983 #Browser port diff --git a/rm-community/rm-community-repo/pom.xml b/rm-community/rm-community-repo/pom.xml index 87d41dd0bb..a4ec3bc0ad 100644 --- a/rm-community/rm-community-repo/pom.xml +++ b/rm-community/rm-community-repo/pom.xml @@ -32,6 +32,11 @@ 6.51 6.35 6.0.0-rc5 + alfresco/ags-repo-community + quay.io + latest + 3.5.37 + @@ -154,6 +159,13 @@ + + ${image.name} + + ${project.basedir}/ + + + @@ -349,6 +361,22 @@ + + io.fabric8 + fabric8-maven-plugin + ${dependency.fabric8.version} + + + + ${image.name} + + ${project.basedir}/ + + + + + + @@ -654,5 +682,140 @@ + + communityDocker + + + + io.fabric8 + fabric8-maven-plugin + ${dependency.fabric8.version} + + + build-image + install + + build + + + + + + + + + internal + + + + io.fabric8 + fabric8-maven-plugin + ${dependency.fabric8.version} + + + + ${image.name}:${image.tag} + ${image.registry} + + ${project.basedir}/ + + + + + + + build-push-image + install + + build + push + + + + + + + + + + master + + + + io.fabric8 + fabric8-maven-plugin + ${dependency.fabric8.version} + + + + ${image.name} + ${image.registry} + + ${project.basedir}/ + + + + ${image.name} + + ${project.basedir}/ + + + + + + + build-push-image + install + + build + push + + + + + + + + + + release + + + + io.fabric8 + fabric8-maven-plugin + ${dependency.fabric8.version} + + + + ${image.name}:${project.version} + ${image.registry} + + ${project.basedir}/ + + + + ${image.name}:${project.version} + + ${project.basedir}/ + + + + + + + build-push-image + deploy + + build + push + + + + + + + + \ No newline at end of file From 6caf496e56e5e0480bb3edb92d90e31a6f6d7a63 Mon Sep 17 00:00:00 2001 From: Roxana Lucanu-Ghetu Date: Wed, 20 Jun 2018 17:14:01 +0300 Subject: [PATCH 2/9] RM-6372 Profile changes --- .../rm-community-repo/docker-compose.yml | 2 +- rm-community/rm-community-repo/pom.xml | 110 +----------------- 2 files changed, 2 insertions(+), 110 deletions(-) diff --git a/rm-community/rm-community-repo/docker-compose.yml b/rm-community/rm-community-repo/docker-compose.yml index 24d5867a77..a30accc666 100644 --- a/rm-community/rm-community-repo/docker-compose.yml +++ b/rm-community/rm-community-repo/docker-compose.yml @@ -7,7 +7,7 @@ version: "3" services: alfresco: - image: acs-rm:latest + image: alfresco/ags-repo-community:latest environment: CATALINA_OPTS : " -agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n diff --git a/rm-community/rm-community-repo/pom.xml b/rm-community/rm-community-repo/pom.xml index 22a5fcc01a..decb12fed7 100644 --- a/rm-community/rm-community-repo/pom.xml +++ b/rm-community/rm-community-repo/pom.xml @@ -362,22 +362,6 @@ - - io.fabric8 - fabric8-maven-plugin - ${dependency.fabric8.version} - - - - ${image.name} - - ${project.basedir}/ - - - - - - @@ -630,7 +614,6 @@ - wipeDB @@ -684,22 +667,12 @@ - communityDocker + buildDockerImage io.fabric8 fabric8-maven-plugin - ${dependency.fabric8.version} - - - build-image - install - - build - - - @@ -711,33 +684,10 @@ io.fabric8 fabric8-maven-plugin - ${dependency.fabric8.version} - - - - ${image.name}:${image.tag} - ${image.registry} - - ${project.basedir}/ - - - - - - - build-push-image - install - - build - push - - - - master @@ -745,39 +695,10 @@ io.fabric8 fabric8-maven-plugin - ${dependency.fabric8.version} - - - - ${image.name} - ${image.registry} - - ${project.basedir}/ - - - - ${image.name} - - ${project.basedir}/ - - - - - - - build-push-image - install - - build - push - - - - release @@ -785,38 +706,9 @@ io.fabric8 fabric8-maven-plugin - ${dependency.fabric8.version} - - - - ${image.name}:${project.version} - ${image.registry} - - ${project.basedir}/ - - - - ${image.name}:${project.version} - - ${project.basedir}/ - - - - - - - build-push-image - deploy - - build - push - - - - \ No newline at end of file From d0fed54c0d9ed887eea1fbd5ece19224d109de58 Mon Sep 17 00:00:00 2001 From: Roxana Lucanu-Ghetu Date: Wed, 20 Jun 2018 17:36:52 +0300 Subject: [PATCH 3/9] RM-6372 Removed unwanted properties and image from pom. --- rm-community/rm-community-repo/pom.xml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/rm-community/rm-community-repo/pom.xml b/rm-community/rm-community-repo/pom.xml index decb12fed7..e5bc2ec355 100644 --- a/rm-community/rm-community-repo/pom.xml +++ b/rm-community/rm-community-repo/pom.xml @@ -33,9 +33,6 @@ 6.35 6.0.0-rc5 alfresco/ags-repo-community - quay.io - latest - 3.5.37 @@ -159,13 +156,6 @@ - - ${image.name} - - ${project.basedir}/ - - - ${skip.integrationtests} From 7e81bd4f6e78be94d93a2523504d5a7a0fe6a8c8 Mon Sep 17 00:00:00 2001 From: Rodica Sutu Date: Wed, 20 Jun 2018 17:52:28 +0300 Subject: [PATCH 4/9] fix the date-time string not changed to a simple date --- .../api/util/CustomDateTimeSerializer.java | 4 +- .../api/util/CustomLocalDateDeserializer.java | 74 +++++++++++++++++++ .../api/util/CustomLocalDateSerializer.java | 6 +- 3 files changed, 79 insertions(+), 5 deletions(-) create mode 100644 rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/util/CustomLocalDateDeserializer.java diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/util/CustomDateTimeSerializer.java b/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/util/CustomDateTimeSerializer.java index 2d75f5ec5d..631ccee679 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/util/CustomDateTimeSerializer.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/util/CustomDateTimeSerializer.java @@ -33,8 +33,8 @@ import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.databind.ser.std.StdSerializer; import org.joda.time.DateTime; -import org.joda.time.format.DateTimeFormat; import org.joda.time.format.DateTimeFormatter; +import org.joda.time.format.ISODateTimeFormat; /** * Custom Date Time serializer for formatting org.joda.time.DateTime @@ -45,7 +45,7 @@ import org.joda.time.format.DateTimeFormatter; public class CustomDateTimeSerializer extends StdSerializer { /** Date time format */ - private final static DateTimeFormatter DATE_TIME_FORMAT = DateTimeFormat.forPattern("yyyy-MM-dd'T'HH:mm:ss.SSSZ"); + private final static DateTimeFormatter DATE_TIME_FORMAT = ISODateTimeFormat.dateTime(); public CustomDateTimeSerializer() { diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/util/CustomLocalDateDeserializer.java b/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/util/CustomLocalDateDeserializer.java new file mode 100644 index 0000000000..ef8133a114 --- /dev/null +++ b/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/util/CustomLocalDateDeserializer.java @@ -0,0 +1,74 @@ +/* + * #%L + * Alfresco Records Management Module + * %% + * Copyright (C) 2005 - 2018 Alfresco Software Limited + * %% + * This file is part of the Alfresco software. + * - + * If the software was purchased under a paid Alfresco license, the terms of + * the paid license agreement will prevail. Otherwise, the software is + * provided under the following open source license terms: + * - + * Alfresco is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * - + * Alfresco is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * - + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + * #L% + */ +package org.alfresco.rm.rest.api.util; + +import java.io.IOException; + +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; + +import org.joda.time.LocalDate; +import org.joda.time.format.DateTimeFormatter; +import org.joda.time.format.ISODateTimeFormat; + + +/** + * Custom Local Date deserializer converting a string to org.joda.time.LocalDate when the time is optional; + * + * @author Rodica Sutu + * @since 3.0 + */ +public class CustomLocalDateDeserializer extends StdDeserializer +{ + /** Date time format with time optional */ + private final static DateTimeFormatter LOCAL_DATE_OPTIONAL_TIME_PARSER = ISODateTimeFormat.localDateOptionalTimeParser(); + + public CustomLocalDateDeserializer() + { + super(LocalDate.class); + } + + /** + * Custom deserialize method to convert string to the org.joda.time.LocalDate type with LOCAL_DATE_OPTIONAL_TIME_PARSER + * + * @param jp local date value + * @param ctxt + * @throws IOException + */ + @Override + public LocalDate deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException + { + String str = jp.getText().trim(); + if (str.length() == 0) + { + return null; + } + return LOCAL_DATE_OPTIONAL_TIME_PARSER.parseLocalDate(str); + } +} + diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/util/CustomLocalDateSerializer.java b/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/util/CustomLocalDateSerializer.java index f10fd69cd4..b3aa93c66a 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/util/CustomLocalDateSerializer.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/util/CustomLocalDateSerializer.java @@ -33,8 +33,8 @@ import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.databind.ser.std.StdSerializer; import org.joda.time.LocalDate; -import org.joda.time.format.DateTimeFormat; import org.joda.time.format.DateTimeFormatter; +import org.joda.time.format.ISODateTimeFormat; /** * Custom Local Date serializer for formatting org.joda.time.LocalDate @@ -44,8 +44,8 @@ import org.joda.time.format.DateTimeFormatter; */ public class CustomLocalDateSerializer extends StdSerializer { - /** Local date format */ - private final static DateTimeFormatter DATE_FORMAT = DateTimeFormat.forPattern("yyyy-MM-dd"); + /** Local date format yyyy-MM-dd*/ + private final static DateTimeFormatter DATE_FORMAT = ISODateTimeFormat.date(); public CustomLocalDateSerializer() { From dfdab3c6965a6e5ea48ae2b5b66fe5f69bd3ebd3 Mon Sep 17 00:00:00 2001 From: Roxana Lucanu-Ghetu Date: Thu, 21 Jun 2018 10:55:31 +0300 Subject: [PATCH 5/9] RM-6372 Removed share from Dockerfile and force option --- rm-community/rm-community-repo/Dockerfile | 4 ++-- rm-community/rm-community-repo/docker-compose.yml | 8 -------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/rm-community/rm-community-repo/Dockerfile b/rm-community/rm-community-repo/Dockerfile index 16ad3116ba..0b60061ad4 100644 --- a/rm-community/rm-community-repo/Dockerfile +++ b/rm-community/rm-community-repo/Dockerfile @@ -1,6 +1,6 @@ FROM alfresco/alfresco-content-repository-community:latest -COPY target/alfresco-rm-community-repo-*.amp /usr/local/tomcat/amps +COPY target/alfresco-rm-community-repo-*.amp /usr/local/tomcat/amps/ RUN java -jar /usr/local/tomcat/alfresco-mmt/alfresco-mmt*.jar install \ - /usr/local/tomcat/amps/alfresco-rm-community-repo-*.amp /usr/local/tomcat/webapps/alfresco -nobackup -force + /usr/local/tomcat/amps/alfresco-rm-community-repo-*.amp /usr/local/tomcat/webapps/alfresco -nobackup diff --git a/rm-community/rm-community-repo/docker-compose.yml b/rm-community/rm-community-repo/docker-compose.yml index a30accc666..dd25d6719d 100644 --- a/rm-community/rm-community-repo/docker-compose.yml +++ b/rm-community/rm-community-repo/docker-compose.yml @@ -37,14 +37,6 @@ services: - "21:21" - "30000-30099:30000-30099" - share: - image: alfresco/alfresco-share:6.0.a - environment: - - REPO_HOST=alfresco - - REPO_PORT=8080 - ports: - - 8080:8080 - postgres: image: library/postgres:10.1 environment: From 1fecb6f981c8a5681f3d3e96d0850315dcde8aa9 Mon Sep 17 00:00:00 2001 From: Roxana Lucanu-Ghetu Date: Thu, 21 Jun 2018 13:38:28 +0300 Subject: [PATCH 6/9] RM-6372 Code review changes --- rm-community/rm-community-repo/Dockerfile | 10 +++++++--- rm-community/rm-community-repo/docker-compose.yml | 6 ++---- rm-community/rm-community-repo/pom.xml | 1 + 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/rm-community/rm-community-repo/Dockerfile b/rm-community/rm-community-repo/Dockerfile index 0b60061ad4..18d450fa30 100644 --- a/rm-community/rm-community-repo/Dockerfile +++ b/rm-community/rm-community-repo/Dockerfile @@ -1,6 +1,10 @@ + + FROM alfresco/alfresco-content-repository-community:latest -COPY target/alfresco-rm-community-repo-*.amp /usr/local/tomcat/amps/ +ARG TOMCAT_DIR=/usr/local/tomcat -RUN java -jar /usr/local/tomcat/alfresco-mmt/alfresco-mmt*.jar install \ - /usr/local/tomcat/amps/alfresco-rm-community-repo-*.amp /usr/local/tomcat/webapps/alfresco -nobackup +COPY target/alfresco-rm-community-repo-*.amp $TOMCAT_DIR/amps/ + +RUN java -jar $TOMCAT_DIR/alfresco-mmt/alfresco-mmt*.jar install \ + $TOMCAT_DIR/amps/alfresco-rm-community-repo-*.amp $TOMCAT_DIR/webapps/alfresco -nobackup diff --git a/rm-community/rm-community-repo/docker-compose.yml b/rm-community/rm-community-repo/docker-compose.yml index dd25d6719d..05ab6bd24a 100644 --- a/rm-community/rm-community-repo/docker-compose.yml +++ b/rm-community/rm-community-repo/docker-compose.yml @@ -1,12 +1,10 @@ version: "3" -# The acs-community-deployment project contains the product version of docker-compose. -# -# This version is for testing and development use. For testing and debug we need to have a more open version. # For remote debug we need the CATALINA_OPTS and to expose port 8000. services: alfresco: + # acs repo community image with ags repo community amp applied image: alfresco/ags-repo-community:latest environment: CATALINA_OPTS : " @@ -30,7 +28,7 @@ services: -Dcifs.enabled=true " ports: - - 8082:8080 + - 8080:8080 - 8000:8000 - 445:445 - 143:143 diff --git a/rm-community/rm-community-repo/pom.xml b/rm-community/rm-community-repo/pom.xml index e5bc2ec355..72a24a28a9 100644 --- a/rm-community/rm-community-repo/pom.xml +++ b/rm-community/rm-community-repo/pom.xml @@ -656,6 +656,7 @@ + buildDockerImage From 8e77c144b950997e0a1fb6d625b88b9f3659bcb7 Mon Sep 17 00:00:00 2001 From: cagache Date: Thu, 21 Jun 2018 16:27:21 +0300 Subject: [PATCH 7/9] added verify execution phase to buildDockerImage profile and changed execution phase for master profile --- pom.xml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 960c830995..aa548ce830 100644 --- a/pom.xml +++ b/pom.xml @@ -356,6 +356,13 @@ build + + build-image-verify + verify + + build + + @@ -431,7 +438,7 @@ build-push-image - install + deploy build push From 03dab3584aeb92e5504fcd743cf9c699d2c3da5a Mon Sep 17 00:00:00 2001 From: cagache Date: Thu, 21 Jun 2018 17:04:25 +0300 Subject: [PATCH 8/9] changed execution phase to deploy for internal profile --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index aa548ce830..d104a7a8ea 100644 --- a/pom.xml +++ b/pom.xml @@ -394,7 +394,7 @@ build-push-image - install + deploy build push From ffaf28d64cd2c914a32b166bebca4f004f9cf262 Mon Sep 17 00:00:00 2001 From: Roxana Lucanu-Ghetu Date: Fri, 22 Jun 2018 12:36:01 +0300 Subject: [PATCH 9/9] RM-6372 removed ARG and updated tag for acs --- rm-community/rm-community-repo/Dockerfile | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/rm-community/rm-community-repo/Dockerfile b/rm-community/rm-community-repo/Dockerfile index 18d450fa30..1ffc5a1ecb 100644 --- a/rm-community/rm-community-repo/Dockerfile +++ b/rm-community/rm-community-repo/Dockerfile @@ -1,10 +1,6 @@ +FROM alfresco/alfresco-content-repository-community:6.0.7-ga +COPY target/alfresco-rm-community-repo-*.amp /usr/local/tomcat/amps/ -FROM alfresco/alfresco-content-repository-community:latest - -ARG TOMCAT_DIR=/usr/local/tomcat - -COPY target/alfresco-rm-community-repo-*.amp $TOMCAT_DIR/amps/ - -RUN java -jar $TOMCAT_DIR/alfresco-mmt/alfresco-mmt*.jar install \ - $TOMCAT_DIR/amps/alfresco-rm-community-repo-*.amp $TOMCAT_DIR/webapps/alfresco -nobackup +RUN java -jar /usr/local/tomcat/alfresco-mmt/alfresco-mmt*.jar install \ + /usr/local/tomcat/amps/alfresco-rm-community-repo-*.amp /usr/local/tomcat/webapps/alfresco -nobackup