5.2.2 Data migration of files in Git repository
The following is a conceptual diagram and procedure for data migration of files in the Git repository.
Items ① through ⑧ in the conceptual diagram correspond to Steps ① through ⑧ in the migration procedure.
(Figure) Conceptual diagram of data migration of files in Git repository
(Table) Procedure for data migration of files in Git repository
| Step | Description (Git for Windows commands are used as examples) | |
|---|---|---|
| ① | Configuring proxy, user, and e-mail address settings for the local Git environment | Configure proxy, user, and e-mail address settings to access the Ops I environment from the local host environment. <Example of Git command>
$ git config --global http.proxy
User ID:
Password@
Proxy server URL:
Port number $ git config --global https.proxy User ID: Password@ Proxy server URL: Port number $ git config --global user.name Your own username set in Ops I $ git config --global user.email Your own e-mail address set in Ops I |
| ② | Cloning the verification environment | Clone the verification environment to the local repository. The following Git command execution example creates the same files and subdirectories as in the verification environment in c:/work/opsi_git_clone/repository1. <Example of Git command>
$ cd c:/work/opsi_git_clone/repository1*1 $ git clone https://Your own username set in Ops I:GitLab access token*2@Ops I verification environment (Git) URL*3 |
| ③ | Cloning the local repository for the actual environment | Similarly to Step ②, also clone the actual environment. The following Git command execution example creates the same files and subdirectories as in the actual environment in c:/work/opsi_git_clone/repository2. <Example of Git command>
$ cd c:/work/opsi_git_clone/repository2*1 $ git clone https://Your own username set in Ops I:GitLab access token*2@Ops I verification environment (Git) URL*3 |
| ④-a | Updating files in the verification environment | Update or create files in the (cloned) verification environment directories as needed. At this point, the changes are not yet reflected in the Ops I verification environment. The subsequent tasks will reflect the changes in the Ops I verification environment. |
| ④-b | Updating files in the verification environment | Register any modified files under the current directory in the staging area by executing "git add .". Use "git status" to see if the files have been registered correctly. The following Git command execution example updates the manifest.yaml file and shows that the sample5.png file has been added. <Example of Git command>
$ cd c:/work/opsi_git_clone/repository1/development*1 $ git add .*4 $ git status On branch main Your branch is up to date with ' origin/main' . Changes to be committed: (use "git reset HEAD modified: Demo/Common/Catalog/demo_catalog/manifest.yaml new file: Demo/Common/Catalog/demo_catalog/sample5.png |
| ④-c | Updating files in the verification environment | Commit the files registered in the staging area using "git add" and reflect them in the Ops I verification environment using "git push". <Example of Git command>
$ cd c:/work/opsi_git_clone/repository1/development*1 $ git commit -m "added catalog"*5 $ git push |
| ⑤ | Verifying operation in the verification environment | Verify operation in the Ops I verification environment. |
| ⑥ | Copying updated files | If no problems were found in the operation check in Step ⑤, copy the updated files from the (cloned) verification environment directories to the (cloned) actual environment directories. |
| ⑦ | Updating files in the actual environment | Similarly to Steps ④-b and ④-c, commit the files registered in the staging area using "git add" and reflect them in the Ops I actual environment using "git push".
<Example of Git command>
$ cd c:/work/opsi_git_clone/repository2/development*1 $ git add .*4 $ git status $ git commit -m "added catalog"*5 $ git push |
| ⑧ | Starting operation | You can start operation in the actual environment, where the changes that you verified in the verification environment are reflected. |
*1: This directory is an example.
*2: For details on GitLab access tokens, see "Obtaining GitLab access tokens".
*3: For information on checking the Git URL, see "Register YAML files with GitLab (CUI)".
*4: Adds modified files as commit targets.
*5: This commit message is an example.