Skip to content

Commit

Permalink
Offline repo for on-prem - EAP, JWS (#56) (apache#1696)
Browse files Browse the repository at this point in the history
* Offline repo for on-prem - EAP, JWS

* Peer review
  • Loading branch information
mramendi authored and sterobin committed Jul 1, 2019
1 parent 3618967 commit e869d59
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 6 deletions.
1 change: 1 addition & 0 deletions assemblies/assembly_install-on-eap/main.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ include::{enterprise-dir}/installation/run-standalone-properties-con.adoc[levelo
include::{enterprise-dir}/admin-and-config/maven-repo-using-con.adoc[leveloffset=+1]
include::{enterprise-dir}/admin-and-config/maven-external-configure-proc.adoc[leveloffset=+2]
include::{enterprise-dir}/admin-and-config/maven-managing-dependencies-proc.adoc[leveloffset=+2]
include::{enterprise-dir}/openshift/offline-repo-proc.adoc[leveloffset=+1]
include::{enterprise-dir}/installation/git-import-proc.adoc[leveloffset=+1]
include::{enterprise-dir}/installation/install-testing-proc.adoc[leveloffset=+1]

Expand Down
1 change: 1 addition & 0 deletions assemblies/assembly_install-on-jws/main.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ include::{enterprise-dir}/admin-and-config/maven-settings-configuration-ref.adoc
include::{enterprise-dir}/admin-and-config/maven-managing-dependencies-proc.adoc[leveloffset=+2]
//include::{enterprise-dir}/admin-and-config/maven-integrated-dependencies-ref.adoc[leveloffset=+2]
//include::{enterprise-dir}/admin-and-config/-testing-dependencies-ref.adoc[leveloffset=+2]
include::{enterprise-dir}/openshift/offline-repo-proc.adoc[leveloffset=+1]
include::{enterprise-dir}/installation/git-import-proc.adoc[leveloffset=+1]
//include::{enterprise-dir}/installation/install-testing-proc.adoc[leveloffset=+1]

Expand Down
90 changes: 84 additions & 6 deletions doc-content/enterprise-only/openshift/offline-repo-proc.adoc
Original file line number Diff line number Diff line change
@@ -1,16 +1,42 @@
[id='offline-repo-proc']
:offline_onprem!:
ifeval::["{context}"=="install-on-eap"]
:offline_onprem:
endif::[]
ifeval::["{context}"=="install-on-jws"]
:offline_onprem:
endif::[]

= Preparing a Maven mirror repository for offline use

If your {OPENSHIFT} environment does not have outgoing access to the public Internet, you must prepare a Maven repository with a mirror of all the necessary artifacts and make this repository available to your environment.
If your
ifdef::offline_onprem[]
{PRODUCT} deployment
endif::offline_onprem[]
ifndef::offline_onprem[]
{OPENSHIFT} environment
endif::offline_onprem[]
does not have outgoing access to the public Internet, you must prepare a Maven repository with a mirror of all the necessary artifacts and make this repository available to your environment.

You do not need to complete this procedure if your {OPENSHIFT} environment is connected to the Internet.
[NOTE]
====
You do not need to complete this procedure if your
ifdef::offline_onprem[]
{PRODUCT} deployment
endif::offline_onprem[]
ifndef::offline_onprem[]
{OPENSHIFT} environment
endif::offline_onprem[]
is connected to the Internet.
====

.Prerequisites

* A computer that has outgoing access to the public Internet.

.Procedure

ifndef::offline_onprem[]
ifeval::["{context}"=="openshift-immutable"]
. Prepare a Maven release repository to which you can write. The repository must allow read access without authentication. Your OpenShift environment must have access to this repository. You can deploy a Nexus repository manager in the OpenShift environment. For instructions about setting up Nexus on OpenShift, see https://access.redhat.com/documentation/en-us/openshift_container_platform/3.11/html/developer_guide/tutorials#nexus-setting-up-nexus[Setting up Nexus]. Use this repository as a mirror repository.
ifdef::PAM[]
Expand All @@ -27,19 +53,22 @@ ifeval::["{context}"!="openshift-immutable"]
Alternatively, if you use a custom external repository (for example, Nexus) for your services, you can use the same repository as a mirror repository.
endif::[]
+
endif::offline_onprem[]
. On the computer that has an outgoing connection to the public Internet, complete the following steps:
.. Download the latest version of the http://release-engineering.github.io/offliner/[Offliner tool].
.. Download the `{PRODUCT_FILE}-offliner.txt` product deliverable file from the {PRODUCT_DOWNLOAD_LINK}[Software Downloads] page of the Red Hat Customer Portal.
.. Enter the following command to download the required artifacts using the Offliner tool:
.. Enter the following command to use the Offliner tool to download the required artifacts:
+
[subs="attributes,verbatim,macros"]
----
java -jar offliner-<version>.jar -r https://maven.repository.redhat.com/ga/ -d /home/user/temp rhpam-7.3.1-offliner.txt
java -jar offliner-<version>.jar -r https://maven.repository.redhat.com/ga/ -d /home/user/temp {PRODUCT_FILE}-offliner.txt
----
+
Replace `/home/user/temp` with an empty temporary directory on the computer and `<version>` with the version of the Offliner tool.
Replace `/home/user/temp` with an empty temporary directory and `<version>` with the version of the Offliner tool.
ifndef::offline_onprem[]
.. Upload all artifacts from the temporary directory to the Maven mirror repository that you prepared. You can use the https://github.com/simpligility/maven-repository-tools/tree/master/maven-repository-provisioner[Maven Repository Provisioner] utility to upload the artifacts.
. If you developed any services outside {CENTRAL} and they have additional dependencies, upload the dependencies to the mirror repository. If you developed the services as Maven projects, you can use the following steps to prepare these dependencies automatically. Complete the steps on the computer that has an outgoing connection to the public Internet.
endif::offline_onprem[]
. If you developed any services outside {CENTRAL} and they have additional dependencies, add the dependencies to the mirror repository. If you developed the services as Maven projects, you can use the following steps to prepare these dependencies automatically. Complete the steps on the computer that has an outgoing connection to the public Internet.
.. Clear the local Maven cache directory (`~/.m2/repository`).
.. Build the source of your projects using the `mvn clean install` command.
.. For every project, enter the following command to ensure that Maven downloads all runtime dependencies for all the artifacts generated by the project:
Expand All @@ -51,4 +80,53 @@ mvn -e -DskipTests dependency:go-offline -f /path/to/project/pom.xml --batch-mod
+
Replace `/path/to/project/pom.xml` with the correct path to the `pom.xml` file of the project.
+
ifndef::offline_onprem[]
.. Upload all artifacts from the local Maven cache directory (`~/.m2/repository`) to the Maven mirror repository that you prepared. You can use the https://github.com/simpligility/maven-repository-tools/tree/master/maven-repository-provisioner[Maven Repository Provisioner] utility to upload the artifacts.
endif::offline_onprem[]
ifdef::offline_onprem[]
.. Copy the contents of the local Maven cache directory (`~/.m2/repository`) to the temporary directory that you are using.
. Copy the contents of the temporary directory to a directory the computer on which you deployed {PRODUCT}. This directory becomes the offline Maven mirror repository.
. Create and configure a `settings.xml` file for your {PRODUCT} deployment, according to instructions in
ifeval::["{context}"=="install-on-eap"]
<<maven-external-configure-proc_install-on-eap>>.
endif::[]
ifeval::["{context}"=="install-on-jws"]
<<maven-settings-configuration-ref>>.
endif::[]
. Make the following changes in the `settings.xml` file:
** Under the `<profile>` tag, if a `<repositories>` or `<pluginRepositores>` tag is absent, add the tags as necessary.
** Under `<repositories>` add the following sequence:
+
[source,xml]
----
<repository>
<id>offline-repository</id>
<url>file:///path/to/repo</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
----
+
Replace `/path/to/repo` with the full path to the local Maven mirror repository directory.
** Under `<pluginRepositories>` add the following sequence:
+
[source,xml]
----
<repository>
<id>offline-plugin-repository</id>
<url>file:///path/to/repo</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
----
+
Replace `/path/to/repo` with the full path to the local Maven mirror repository directory.
endif::offline_onprem[]

0 comments on commit e869d59

Please sign in to comment.