1- # Repo Manager (repm): Dynamic Repository Management
1+ # Combostrap Dev files - development flow
22
33## About
44
5- This repository helps to init and update git combostrap repositories .
5+ This repository contains ` devfiles ` .
66
7- ## Concept / How it works
7+ ` dotfiles ` configure application files, ` devfiles ` configure a development flow.
88
9- It uses the following software to manage common repositories stuff:
9+ With them, you can:
10+ * init a new repo
11+ * update an existing one
12+ and get instantly a consistent development environment across git repositories.
13+
14+
15+ ## QuickStart in three commands
16+
17+ ``` bash
18+ cd your-git-repo
19+ copier copy https://github.com/combostrap/devfiles .
20+ direnv reload
21+ ```
22+
23+ For a step by step, see [ the detailed steps] ( #steps )
24+
25+ ## How it works
26+
27+ ### Core Component
28+
29+ It uses the following core components to manage common repositories stuff:
1030
1131* [ copier] ( https://copier.readthedocs.io/ ) for project templating and upgrade
12- * [ direnv] ( https://direnv.net/ ) for project setup and environment
13- * [ pre-commit] ( https://pre-commit.com/ ) for files check and normalization
14- * [ common scripts] ( #common-scripts ) are made available by cloning this repo and putting them in the ` PATH ` .
32+ * [ direnv] ( https://direnv.net/ ) for setup (project and environment)
33+ * [ dev scripts] ( #dev-scripts ) for development flow
34+
35+ ### Utility components
1536
16- ## Where are the artifacts
37+ The utility components are used in the scripts or as configuration:
1738
18- * The ` copier ` template is located at [ copier template] ( copier-template )
19- * The ` pre-commit `
20- * config is part of the template at [ .pre-commit-config.yaml] ( copier-template/.pre-commit-config.yaml )
21- * setup is performed with direnv via [ .envrc] ( copier-template/.envrc.jinja )
22- * extra ` git hooks ` are available at [ git-hooks] ( git-hooks )
23- * The common dev scripts are in the [ bin] ( bin )
39+ * [ pre-commit] ( https://pre-commit.com/ ) for files check and normalization
40+ * [ jreleaser] ( #jreleaser ) for release management
41+ * [ pass] ( #pass---local-secret-management ) for secrets management
42+ * [ git-cliff] ( https://git-cliff.org/ ) for change log and version bump
43+ * [ go task] ( #task-distribution ) for common tasks distribution
44+ * [ editorconfig] ( #code-styling-editor-config ) for code styling
45+ * [ commitlint] ( #commit-message-validation-commitlint ) for commit message validation
46+ * [ markdown-link-check] ( #markdown-link-check ) for Markdown link validation
2447
2548## Steps
2649
@@ -35,15 +58,14 @@ Install:
3558
3659### Copy or update this copier template
3760
38- * for a new git repo
61+ * to install the latest ` devfiles ` in a git repo (empty or not)
3962
4063``` bash
41- # Optionally
42- # cd your_repo && git init
43- copier copy https://github.com/combostrap/repo-manager .
64+ # Optionally cd your_repo && git init
65+ copier copy https://github.com/combostrap/devfiles .
4466```
4567
46- * to update a git repo
68+ * to update a git repo with the last ` devfiles ` version
4769
4870``` bash
4971copier update .
@@ -55,8 +77,8 @@ The [.envrc](copier-template/.envrc.jinja) file is the main entry for `setup` an
5577
5678It will:
5779
58- * install the git hooks with ` pre-commit `
59- * [ install the common scripts] ( #common -scripts )
80+ * install the git hooks with [ pre-commit] ( #git-hooks-and-pre-commit )
81+ * [ install the common scripts] ( #dev -scripts )
6082
6183If you open your terminal, ` direnv ` should execute ` .envrc ` .
6284If not:
@@ -67,20 +89,61 @@ direnv reload
6789
6890## Features and configuration
6991
92+ ### Copier Template
93+
94+ The ` copier ` template is located at [ copier template] ( copier-template )
95+
96+ ### Pass - Local Secret Management
97+
98+ Pass ([ pass] ( https://www.passwordstore.org/ ) or [ gopass] ( https://www.gopass.pw/ ) ) is used for secret management.
99+
100+ All secrets are located under the organization name.
101+
102+ Example for a GitHub token:
103+
104+ ``` bash
105+ pass " $ORGANISATION_PATH_NAME /github/release-token"
106+ ```
107+
108+ The secrets are not stored as global shell variables.
109+ We create wrapper scripts so that the secret is only available while running the script.
110+
111+ Example of wrappers:
112+
113+ * [ jreleaser] ( dev-scripts/common/jreleaser )
114+ * [ mvnw (maven)] ( dev-scripts/package-manager/maven/mvnw )
115+
116+ ### JReleaser
117+
118+ For release management, we use [ jreleaser] ( https://jreleaser.org/ ) .
119+
120+ We distribute with this template, a [ jreleaser] ( dev-scripts/common/jreleaser ) wrapper script
121+ to pass the needed secrets with [ pass] ( #pass---local-secret-management )
122+
70123### Git User Configuration
71124
72125To set the git user, you can set in your ` .bashrc ` the following env:
73126
74127| Env |
75128| -----------------------------------------|
76- | ` REPM_${ORGANIZATION_NAME}_EMAIL ` |
77- | ` REPM_${ORGANIZATION_NAME}_SIGNING_KEY ` |
129+ | ` DEVF_${ORGANIZATION_NAME}_EMAIL ` |
130+ | ` DEVF_${ORGANIZATION_NAME}_SIGNING_KEY ` |
131+
132+ See the [ Git User Configuration Script] ( dev-scripts/common/git-config-user )
78133
79- See the [ Git User Configuration Script ] ( bin/git-config-user )
134+ ### Code Styling (Editor Config )
80135
81- ### Editor Config for code styling
136+ The [ editorconfig ] ( https://editorconfig.org/ ) file is [ .editorconfig ] ( copier-template/.editorconfig )
82137
83- Install the [ root editor config] ( copier-template/.editorconfig )
138+ ### Commit Message Validation (CommitLint)
139+
140+ [ commitlint] ( https://commitlint.js.org/ ) configuration is located
141+ at [ commitlint.config.js] ( copier-template/.config/commitlint.config.js )
142+
143+ ### Markdown Link-Check
144+
145+ [ markdown-link-check] ( https://github.com/tcort/markdown-link-check ) for Markdown link validation
146+ configuration is located at [ markdown-link-check.config.json] ( copier-template/.config/markdown-link-check.config.json )
84147
85148### Copy .gitignore and .gitattributes if not found
86149
@@ -97,20 +160,24 @@ A License is installed
97160For project only configuration, you can add your own ` direnv ` scripts in the ` PROJECT_ROOT/direnv.d ` directory.
98161All ` .sh ` files present in this directory will be sourced.
99162
100- #### Common Scripts
163+ #### Dev Scripts
101164
102- Common scripts located in the [ bin] ( bin ) directory are made available:
165+ Dev scripts located in the [ dev-scripts] ( dev-scripts ) directory.
166+
167+ They are made available:
103168
104169* by cloning this repo
105- * and put the [ bin] ( bin ) in the ` PATH `
170+ * and put in the PATH:
171+ * the [ common-scripts directory] ( dev-scripts/common )
172+ * the [ package-manager directory] ( dev-scripts/package-manager )
106173
107174The code is in the [ envrc] ( copier-template/.envrc.jinja ) and can be configured by setting the
108175following variable in your shell profile, ` ~/.bashrc ` , or ` ~/.config/direnv/direnvrc ` , or ` ~/.envrc.local ` .
109176
110- | Environment | Default Value | Description |
111- | ---------------------------------| -------------------------------------------- | -------- -----------------------------------------------------------------|
112- | ` REPM_ ${ORGANIZATION_NAME}_DIR` | ` $PROJET_ROOT/../repo-manager ` | The local file system location of the resource manager repository clone |
113- | ` REPM_ ${ORGANIZATION_NAME}_URI` | https://github.com/combostrap/repo-manager | The URI location of the resource manager repository |
177+ | Environment | Default Value | Description |
178+ | ---------------------------------| ----------------------------------------| -----------------------------------------------------------------|
179+ | ` DEVF_ ${ORGANIZATION_NAME}_DIR` | ` $PROJET_ROOT/../devfiles ` | The local file system location of the devfiles repository clone |
180+ | ` DEVF_ ${ORGANIZATION_NAME}_URI` | https://github.com/combostrap/devfiles | The URI location of the devfiles repository |
114181
115182#### Scripts Environment variable
116183
@@ -123,6 +190,14 @@ In your scripts, you can use the following env:
123190| ` ORGANISATION_ENV_NAME ` | The organization name in a env format |
124191| ` ORGANISATION_PATH_NAME ` | The organization name in a file path format |
125192
193+ ### Git Hooks and Pre-commit
194+
195+ The ` pre-commit ` :
196+
197+ * config is part of the template at [ .pre-commit-config.yaml] ( copier-template/.pre-commit-config.yaml )
198+ * setup is performed with direnv via [ .envrc] ( copier-template/.envrc.jinja )
199+ * extra ` git hooks ` are available at [ git-hooks] ( git-hooks )
200+
126201### Prepare your next commit
127202
128203You can check the files in you next commit with:
@@ -144,3 +219,7 @@ task update
144219# equivalent to
145220copier update .
146221```
222+
223+ ### Task Distribution
224+
225+ The [ go task] ( https://github.com/go-task/task ) file is [ Taskfile.yaml] ( copier-template/Taskfile.yaml )
0 commit comments