In this scenario, the /opt/cloudbees/sda/conf/repository/wrapper.conf file has these settings:
-
set.default.INSTALL_DIRECTORY=/opt/cloudbees/sda -
set.default.DATA_DIRECTORY=/opt/cloudbees/sda
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/cloudbees/sda/conf/repository/server.properties 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.
|
-
Publish the artifact under the
/opt/cloudbees/sda/repository-data/<artifact_name>/<version>directory:ectool publishArtifactVersion --artifactName <artifact_name> --version <version> --fromDirectory <directory> --compress 0Example: To publish an artifact under the
/opt/cloudbees/sda/repository-data/jdoe/2001/1.0.0directory, enter:ectool publishArtifactVersion --artifactName "jdoe:2001" --version "1.0.0" --fromDirectory /tmp/job1 --compress 0The
from Directory(/tmp/job1) contains the files to be uploaded. -
Stop the repository server:
-
If you are using systemd, run:
sudo systemctl stop commanderRepository -
As a
rootuser, run:/etc/init.d/commanderRepository stop
-
-
Move the artifact repository data from the
/DATA_DIRECTORYdirectory to the/NEW_DATA_DIRECTORYdirectory:mv /opt/cloudbees/sda/repository-data/NEW_DATA_DIRECTORY -
In
/opt/cloudbees/sda/conf/repository/wrapper.conf, changeset.default.DATA_DIRECTORY=/opt/cloudbees/sdatoset.default.DATA_DIRECTORY=/NEW_DATA_DIRECTORY.Example: Change
set.default.DATA_DIRECTORY=/opt/cloudbees/sdatoset.default.DATA_DIRECTORY=/vagrant_data. -
Create a
logs/repository/subdirectory underNEW_DATA_DIRECTORY.Example: Create
/vagrant_data/logs/repositoryusing the following commands:mkdir /vagrant_data/logsmkdir /vagrant_data/logs/repository -
Copy
/opt/cloudbees/sda/conf/repository/server.propertiesand/opt/cloudbees/sda/conf/repository/keystoreto theNEW_DATA_DIRECTORY/conf/repositorydirectory.Example: Copy the directories to the
/vagrant_data/conf/repositoryusing the following commands.mkdir /vagrant_data/confmkdir /vagrant_data/conf/repositorycp /opt/cloudbees/sda/conf/repository/server.properties/ vagrant_data/conf/repositorycp /opt/cloudbees/sda/conf/repository/keystore/ vagrant_data/conf/repository -
In
/etc/init.d/commanderRepository, changeDATADIR=/opt/cloudbees/sdatoDATADIR=/NEW_DATA_DIRECTORY.Example: Change
DATADIR=/opt/cloudbees/sdatoDATADIR=/vagrant_data. -
Start the repository server:
-
If you are using systemd, run:
sudo systemctl start commanderRepository -
As a
rootuser, run:/etc/init.d/commanderRepository start
-
-
Check if CloudBees CD/RO has started using the artifact repository in the new network location:
netstat -aon | grep 8200Example:
vagrant@commander1:~$ netstat -aon | grep 8200tcp 0 0 0.0.0.0:8200 0.0.0.0:* LISTEN off (0.00/0/0)This shows that the
DATA_DIRECTORYrepository has moved to/vagrant_data.The repository
service.log,repository.logandrepository.pidfiles will be created in the/vagrant_data/logs/repositorydirectory. -
Publish a new artifact and check if it is published:
ectool getArtifactVersions | grep artifactVersionName