Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Add Vault scripts as git subtree #153

Open
arvindh123 opened this issue Sep 25, 2024 · 0 comments
Open

Feature: Add Vault scripts as git subtree #153

arvindh123 opened this issue Sep 25, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@arvindh123
Copy link
Contributor

Is your feature request related to a problem? Please describe.

If vault script changes in magistrala repo, then it is need to manually copied to devops repo

Describe the feature you are requesting, as well as the possible use case(s) for it.

To include the files from the docker/addons/vault directory of the repository https://github.com/absmach/magistrala into a folder in your repository using git subtree, you can follow these steps:

1. Add the Remote Repository

First, add the magistrala repository as a remote in your local repository.

git remote add -f magistrala https://github.com/absmach/magistrala.git

2. Fetch the Remote Repository

Fetch the latest changes from the magistrala repository.

git fetch magistrala

3. Add the Subtree

Now, use git subtree to add the specific directory (docker/addons/vault) into a directory of your choice in your repository. For example, if you want to add it under third_party/vault or scripts/vault , you would do:

git subtree add --prefix=scripts/vault magistrala main --squash --prefix=docker/addons/vault

Here’s a breakdown of the command:

  • --prefix=scripts/vault: Specifies where the files should go in your repository.
  • magistrala: The name of the remote.
  • main: The branch of the remote repository.
  • --squash: Combines all the commits from the subtree into a single commit.
  • --prefix=docker/addons/vault: The path in the remote repository that you want to add.

4. Update the Subtree (Optional)

If you need to update the subtree later to pull in changes from the magistrala repository, you can do:

git subtree pull --prefix=scripts/vault magistrala main --squash --prefix=docker/addons/vault

This will update the files in scripts/vault with any changes from the docker/addons/vault directory of the magistrala repository.

5. Push Changes to Your Repository

Finally, commit and push the changes to your own repository.

git add .
git commit -m "Added vault files from magistrala using git subtree"
git push origin <your-branch>

This will include the files from the specified directory of the magistrala repository in your repository under the specified folder.

Indicate the importance of this feature to you.

Must-have

Anything else?

No response

@arvindh123 arvindh123 added the enhancement New feature or request label Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant