This cli is for assembling various git repo templates into usable git repos.
patwill never overwrite files or directories unless you tell it to.patwill place a.patfile in the target directory to indicate it has been processed bypat.patwill skip processing directories that have a.patfile in it unless you specify an override.patallows you to process individual files or directories by specifying them as an option.patallows for multiple source and destination repositories all having unique references.patsupports github and bitbucket.patrequiresgit,hub(for github), andgomplateto be installed and available in the system path.patsupports specification processing a single file or a directory structure of files.
Clone an existing repo you have in your github account. If you don't have one, just create one with a README.md file.
$ hub clone {username}/{repo_name}hub will ask for your github username, then your github password. Hub will not store this password. It uses these credentials to establish a personal access token.
Delete the files you pulled down
$ rm -fr {repo_name}- Navigate to https://github.com and login
- Click on your profile icon in the upper left corner to get dropdown list, choose "Settings"
- Click "Developer settings" on left hand list
- Click "Personal access tokens"
- Click on "hub for {username}@{machinename}" link
- Scroll down on permissions list, and check "delete_repo" permissions
- Scroll to bottom and click "Update token"
Please refer to the following article that explains this credential mechanism https://confluence.atlassian.com/bitbucketserver/permanently-authenticating-with-git-repositories-776639846.html
https://github.com/hairyhenderson/gomplate https://docs.gomplate.ca/installing/
$ brew install git hub gomplateDownload pat darwin binary from https://github.com/ssmythe/pat/releases Note: rename VERSION to whatever the version number is of the release
$ sudo mv ~/Downloads/pat-darwin-amd64-VERSION /usr/local/bin/pat
$ sudo chmod +x /usr/local/bin/pat$ git --version
$ hub --version
$ gomplate --version
$ pat --version$ yum -y install git hub gomplateDownload pat linux binary from https://github.com/ssmythe/pat/releases Note: rename VERSION to whatever the version number is of the release
$ sudo mv ~/Downloads/pat-linux-amd64-VERSION /usr/local/bin/pat
$ sudo chmod +x /usr/local/bin/pat$ git --version
$ hub --version
$ gomplate --version
$ pat --versionDownload Chocolatey from https://chocolatey.org/
C:\>choco -y install git hubDownload gomplate for Windows from https://github.com/hairyhenderson/gomplate/releases Rename the executable to "gomplate.exe" Move it into your C:\Windows\System32 directory (or some other directory that's on your system path, if you prefer)
Download pat windows binary from https://github.com/ssmythe/pat/releases Rename the executable to "gomplate.exe" Move it into your C:\Windows\System32 directory (or some other directory that's on your system path, if you prefer)
C:\>git --version
C:\>hub --version
C:\>gomplate --version
C:\>pat --versionvariables:
project: foo
component: bar
sourcerepos:
- name: templates
repo: bitbucket.org/foo/pat_test_templates
destrepos:
- name: component
repo: bitbucket.org/foo/pat_test_component
- name: job_dsl_dev
repo: bitbucket.org/foo/pat_test_job_dsl_dev
- name: job_dsl_nonprod
repo: bitbucket.org/foo/pat_test_job_dsl_nonprod
- name: job_dsl_prod
repo: bitbucket.org/foo/pat_test_job_dsl_prod
templates:
- name: reference
sourcerepo: templates
sourcepath: reference_app/bash/
destrepos: [ component ]
destpath: ./
- name: ansible
sourcerepo: templates
sourcepath: iasc/ansible_openshift_springboot_service/
destrepos: [ component ]
destpath: ansible/
- name: openshift
sourcerepo: templates
sourcepath: iasc/openshift_objects/
destrepos: [ component ]
destpath: openshift/
- name: view
sourcerepo: templates
sourcepath: job_dsl/project_view.groovy
destrepos: [ job_dsl_dev, job_dsl_nonprod, job_dsl_prod ]
destpath: view-foo.groovy
- name: job
sourcerepo: templates
sourcepath: job_dsl/component_job_echo.groovy
destrepos: [ job_dsl_dev, job_dsl_nonprod, job_dsl_prod ]
destpath: job-foo.bar-echo.groovy