Create a project repository

Create a project repositoryΒΆ

An MCP cluster deployment configuration is stored in a Git repository created on a per-customer basis. This section instructs you on how to manually create and prepare your project repository for an MCP deployment.

Before you start this procedure, create a Git repository in your version control system, such as GitHub.

To create a project repository manually:

  1. Log in to any computer.

  2. Create an empty directory and change to that directory. In the example below, it is mcpdoc.

  3. Initialize your project repository:

    git init
    

    Example of system response:

    Initialized empty Git repository in /Users/crh/Dev/mcpdoc/.git/
    
  4. Add your repository to the directory you have created:

    git remote add origin <YOUR-GIT-REPO-URL>
    
  5. Verify that Git and your local repository are set up correctly by creating and pushing a test file to your project repository. Run the following example commands:

    Note

    The example commands below require the Git and GitHub credentials to be created and configured for your project repository.

    git remote add origin https://github.com/example_account/mcpdoc.git
    git config --local user.email "example@example.com"
    git config --local user.name "example_gituser"
    git config -l
    
    echo "#. mcpdoc" >> README.md
    git add README.md
    git commit -m "first commit"
    git push -u origin master
    
  6. Create the following directories for your deployment metadata model:

    mkdir -p classes/cluster
    mkdir nodes
    
  7. Add the Reclass variable to your bash profile by verifying your current directory using pwd and adding the string that exports the Reclass variable with the output value of the pwd command:

    pwd
    vim ~/.bash_profile
    export RECLASS_REPO=<PATH_TO_YOUR_DEV_DIRECTORY>
    

    Example of system response:

    /Users/crh/Dev/mcpdoc/
    
    "~/.bash_profile" 13L, 450C
    export RECLASS_REPO="/Users/crh/Dev/mcpdoc/"
    
  8. Log out and log back in.

  9. Verify that your ~/.bash_profile is sourced:

    echo $RECLASS_REPO
    

    The command must show the value of your RECLASS_REPO variable.

    Example of system response:

    /Users/crh/Dev/mcpdoc/
    
  10. Add the Mirantis Reclass module to your repository as a submodule:

    git submodule add https://github.com/Mirantis/reclass-system-salt-model ./classes/system/
    

    Example of system response:

    Cloning into '<PATH_TO_YOUR_DEV_DIRECTORY>/classes/system'...
    remote: Counting objects: 8923, done.
    remote: Compressing objects: 100% (214/214), done.
    remote: Total 8923 (delta 126), reused 229 (delta 82), pack-reused 8613
    Receiving objects: 100% (8923/8923), 1.15 MiB | 826.00 KiB/s, done.
    Resolving deltas: 100% (4482/4482), done.
    Checking connectivity... done.
    
  11. Update the submodule:

    git submodule sync
    git submodule update --init --recursive --remote
    
  12. Add your changes to a new commit:

    git add -A
    
  13. Commit your changes:

    git commit
    
  14. Add your commit message.

    Example of system response:

    [master (root-commit) 9466ada] Initial Commit
     2 files changed, 4 insertions(+)
     create mode 100644 .gitmodules
     create mode 160000 classes/system
    
  15. Push your changes:

    git push
    
  16. Proceed to Create a deployment metadata model.