Moving the Artifact Repository in Linux

In this scenario, the /opt/electriccloud/electriccommander/conf/repository/wrapper.conf file has these settings:

  • set.default.INSTALL_DIRECTORY=/opt/Electric Cloud/ElectricCommander

  • set.default.DATA_DIRECTORY=/opt/Electric Cloud/ElectricCommander

If the Linux server where the current artifact repository is stored is full and you want to move it to a new device with more disk space, map the artifact repository to a new network location.

In this procedure, the set.default.DATA_DIRECTORY value will change to the NEW_DATA_DIRECTORY value. The REPOSITORY_BACKING_STORE value in /opt/electriccloud/electriccommander/conf/repository/ will remain the same, relative to the DATA_DIRECTORY, which will be NEW_DATA_DIRECTORY.

In the example, the DATA_DIRECTORY will be changed to /vagrant_data, and the REPOSITORY_BACKING_STORE value will be relative to this directory.

The REPOSITORY_BACKING_STORE value is always relative to the DATA_DIRECTORY and cannot be set to a fully qualified absolute path. The solution in will not work until you change the DATA_DIRECTORY as described in this procedure.

  1. Publish the artifact under the /opt/electriccloud/electriccommander/repository-data/<artifact_name>/<version> directory:

    ectool publishArtifactVersion --artifactName <artifact_name> --version <version> --fromDirectory <directory> --compress 0

    Example: To publish an artifact under the /opt/electriccloud/electriccommander/repository-data/jdoe/2001/1.0.0 directory, enter:

    ectool publishArtifactVersion --artifactName "jdoe:2001" --version "1.0.0" --fromDirectory /tmp/job1 --compress 0

    The from Directory ( /tmp/job1 ) contains the files to be uploaded.

  2. Stop the repository server:

    /etc/init.d/commanderRepository stop

  3. Move the artifact repository data from the /DATA_DIRECTORY directory to the /NEW_DATA_DIRECTORY directory:

    mv /opt/electriccloud/electriccommander/repository-data/NEW_DATA_DIRECTORY

  4. In /opt/electriccloud/electriccommander/conf/repository/wrapper.conf, change set.default.DATA_DIRECTORY=/opt/Electric Cloud/ElectricCommander to set.default.DATA_DIRECTORY=/NEW_DATA_DIRECTORY.

    Example: Change set.default.DATA_DIRECTORY=/opt/Electric Cloud/ElectricCommander to set.default.DATA_DIRECTORY=/vagrant_data.

  5. Create a logs/repository/ subdirectory under NEW_DATA_DIRECTORY.

    Example: Create /vagrant_data/logs/repository using the following commands:

    mkdir /vagrant_data/logs
    mkdir /vagrant_data/logs/repository
  6. Copy /opt/electriccloud/electriccommander/conf/repository/ and /opt/electriccloud/electriccommander/conf/repository/keystore to the NEW_DATA_DIRECTORY/conf/repository directory.

    Example: Copy the directories to the /vagrant_data/conf/repository using the following commands.

    mkdir /vagrant_data/conf
    mkdir /vagrant_data/conf/repository
    cp /opt/electriccloud/electriccommander/conf/repository/
    cp /opt/electriccloud/electriccommander/conf/repository/keystore/
  7. In /etc/init.d/commanderRepository, change DATADIR=/opt/Electric Cloud/ElectricCommander to DATADIR=/NEW_DATA_DIRECTORY.

    Example: Change DATADIR=/opt/Electric Cloud/ElectricCommander to DATADIR=/vagrant_data.

  8. Start the repository server:

    /etc/init.d/commanderRepository start
  9. Check if CloudBees Flow has started using the artifact repository in the new network location:

    netstat -aon | grep 8200


    vagrant@commander1:~$ netstat -aon | grep 8200
    tcp        0      0  *               LISTEN      off (0.00/0/0)

    This shows that the DATA_DIRECTORY repository has moved to /vagrant_data.

    The repository service.log, repository.log and files will be created in the /vagrant_data/logs/repository directory.

  10. Publish a new artifact and check if it is published:

    ectool getArtifactVersions | grep artifactVersionName
Copyright © 2010-2020 CloudBees, Inc.Online version published by CloudBees, Inc. under the Creative Commons Attribution-ShareAlike 4.0 license.CloudBees and CloudBees DevOptics are registered trademarks and CloudBees Core, CloudBees Flow, CloudBees Flow Deploy, CloudBees Flow DevOps Insight, CloudBees Flow DevOps Foresight, CloudBees Flow Release, CloudBees Accelerator, CloudBees Accelerator ElectricInsight, CloudBees Accelerator Electric Make, CloudBees CodeShip, CloudBees Jenkins Enterprise, CloudBees Jenkins Platform, CloudBees Jenkins Operations Center, and DEV@cloud are trademarks of CloudBees, Inc. Most CloudBees products are commonly referred to by their short names — Accelerator, Automation Platform, Flow, Deploy, Foresight, Release, Insight, and eMake — throughout various types of CloudBees product-specific documentation. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Jenkins is a registered trademark of the non-profit Software in the Public Interest organization. Used with permission. See here for more info about the Jenkins project. The registered trademark Jenkins® is used pursuant to a sublicense from the Jenkins project and Software in the Public Interest, Inc. Read more at Apache, Apache Ant, Apache Maven, Ant and Maven are trademarks of The Apache Software Foundation. Used with permission. No endorsement by The Apache Software Foundation is implied by the use of these marks.Other names may be trademarks of their respective owners. Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this content, and CloudBees was aware of a trademark claim, the designations have been printed in caps or initial caps. While every precaution has been taken in the preparation of this content, the publisher and authors assume no responsibility for errors or omissions, or for damages resulting from the use of the information contained herein.