Migrate Jenkins-3 migtate

Migrate all configuration files

  1. Login jerry’s machine, cd /var/lib/Jenkins/

Migrate Jenkins-3 migtate

  1. Pack all the configuration files

Migrate Jenkins-3 migtate

  1. scp these files into EECloud OS

Migrate Jenkins-3 migtate

I don’t remember that if I have written SSH setting in preparation doc or other,

If here report the issue, you should go into EECloud first, set the SSH service accept password login, or you can add the public key into EECloud(this way you don’t need to enter the password every time)

  1. switch to EECloud server

Migrate Jenkins-3 migtate

 

  1. sudo mv no-space-jobs-plugins.tar.gz /var/lib/Jenkins

 

  1. decompress this tar file in the /var/lib/Jenkins

Migrate Jenkins-3 migtate

  1. change owner and group

chown -R jenkins:jenkins /var/lib/Jenkins

 

  1. restart Jenkins server

systemctl restart jenkins.service

 

 

Migrate all the plugins

To check the status of Jenkins, if all thing works well, then migrate all the plugins refer to the guide of part of Migration all the configuration.

The plugins are under /var/lib/Jenkins/plugins/

 

 

Migrate some dependency package and Selenium script

Selenium scripts are under

Migrate Jenkins-3 migtate

 

  1. pack all the file under /usr/share/SalesForceDataCompareWithSelenium on 50 sever(135.251.46.50:)

tar -zcvf selenium-scripts.tar.gz ./*

  1. sudo scp selenium-scripts.tar.gz [email protected]<EECloudIP>:selenium-scirpts.tar.gz
  2. switch to EECloud

mkdir -p /usr/share/SalesForceDataCompareWithSelenium

mv selenium-scripts.tar.gz /usr/share/SalesForceDataCompareWithSelenium

tar -xvf selenium-scripts.tar.gz

originally, the firefox starting is too slow, I changed timeout to 60s(default), it’s 30s, but now, the start become quickly, it’s maybe the issue of EECloud.

 

 

Migrate all post-refresh jobs

vim /var/lib/Jenkins/config.xml

copy all post-refresh jobs to one file(string), then remove <string> lable. Migrate Jenkins-3 migtate

sed -i ‘s/<string>//g’;sed -i ‘s/<\/string>//g’ string

then

sed -i ‘s/^[ \t]*//g’ string

cat string | tr ‘\n’ ‘ ’

you will get like this:

Migrate Jenkins-3 migtate

 

Then pack all these post-refresh jobs to tar.gz file, scp it to EECloud

decompress; so on

 

Now, these post-refresh job connect to 50 to run the selenium script, before restarting Jenkins,

we need to delete all the 50 lable

Migrate Jenkins-3 migtate

 

sed -i ’/test-50/d’ ./jobs/*/config.xml

then restart jenkins

 

Some other dependency are under /var/lib/scripts/

Migrate Jenkins-3 migtate

We need to move these files to EE Cloud, of course, the same directory.

 

Migrate rest of jobs

If the post-refresh jobs work well, we can continue to migrate rest of jobs.

Here the most of the steps are the same as the post-refresh jobs migration.

Notice: this part, there is some job will run automatically, so before migrating, we should disable all the jobs. then after verifying, enable them.

How to disable the jobs in one shot, just run below command.

Migrate Jenkins-3 migtate

 

for name in names; do sed -i ‘/canRoam/{n; s/false/true/;}’ $name/config.xml; done