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 0
Example: To publish an artifact under the
/opt/cloudbees/sda/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. -
Stop the repository server:
-
If you are using systemd, run:
sudo systemctl stop commanderRepository
-
As a
root
user, run:/etc/init.d/commanderRepository stop
-
-
Move the artifact repository data from the
/DATA_DIRECTORY
directory to the/NEW_DATA_DIRECTORY
directory:mv /opt/cloudbees/sda/repository-data/NEW_DATA_DIRECTORY
-
In
/opt/cloudbees/sda/conf/repository/wrapper.conf
, changeset.default.DATA_DIRECTORY=/opt/cloudbees/sda
toset.default.DATA_DIRECTORY=/NEW_DATA_DIRECTORY
.Example: Change
set.default.DATA_DIRECTORY=/opt/cloudbees/sda
toset.default.DATA_DIRECTORY=/vagrant_data
. -
Create a
logs/repository/
subdirectory underNEW_DATA_DIRECTORY
.Example: Create
/vagrant_data/logs/repository
using the following commands:mkdir /vagrant_data/logs
mkdir /vagrant_data/logs/repository
-
Copy
/opt/cloudbees/sda/conf/repository/server.properties
and/opt/cloudbees/sda/conf/repository/keystore
to theNEW_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/cloudbees/sda/conf/repository/server.properties/ vagrant_data/conf/repository
cp /opt/cloudbees/sda/conf/repository/keystore/ vagrant_data/conf/repository
-
In
/etc/init.d/commanderRepository
, changeDATADIR=/opt/cloudbees/sda
toDATADIR=/NEW_DATA_DIRECTORY
.Example: Change
DATADIR=/opt/cloudbees/sda
toDATADIR=/vagrant_data
. -
Start the repository server:
-
If you are using systemd, run:
sudo systemctl start commanderRepository
-
As a
root
user, 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 8200
Example:
vagrant@commander1:~$ netstat -aon | grep 8200
tcp 0 0 0.0.0.0:8200 0.0.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
andrepository.pid
files will be created in the/vagrant_data/logs/repository
directory. -
Publish a new artifact and check if it is published:
ectool getArtifactVersions | grep artifactVersionName