Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## Setting up the Secrets Submodule
- First, `cd` into your `career_arc` repo and pull the latest changes...
- ```bash
- > cd ~/repos/career_arc
- > git pull
- ```
- Next, initalize the git submodules feature:
- ```bash
- > git submodule init
- Submodule 'secrets' (deploy@10.0.2.80:repos/secrets.git) registered for path 'secrets'
- > git submodule update
- Cloning into 'secrets'...
- remote: Counting objects: 26, done.
- remote: Compressing objects: 100% (17/17), done.
- remote: Total 26 (delta 8), reused 0 (delta 0)
- Receiving objects: 100% (26/26), 4.66 KiB | 0 bytes/s, done.
- Resolving deltas: 100% (8/8), done.
- Checking connectivity... done.
- Submodule path 'secrets': checked out '952dacab5a554d873a8127ad59808591fdb77c39'
- ```
- You'll notice that a new subdirectory called "secrets" has been added to your repo. It is the submodule in which we'll store the secrets.yml file. Let's checkout master on the submodule so that we're ready to make changes as needed:
- ```bash
- > cd secrets
- > git checkout master
- > git pull
- > cd ..
- ```
- Now we can replace the normal config/secrets.yml file with a symlink to the shared secrets file:
- ```bash
- > cd config
- > rm secrets.yml
- > ln -s ../secrets/secrets.yml secrets.yml
- > cd ..
- ```
- Lastly, we need to add a git hook to automatically update subrepos whenever we pull changes in our main repo:
- ```bash
- > vi .git/hooks/post-merge
- ```
- Paste in the contents of the post-merge script included below, then save and close the file. Next, mark the file as executable:
- ```bash
- > chmod 775 .git/hooks/post-merge
- ```
- You should now be good to go!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement