From 1730c49f51a745b1416f7ce0e982fd2858a2e782 Mon Sep 17 00:00:00 2001 From: Eduard Date: Thu, 29 Mar 2018 23:05:49 +0300 Subject: [PATCH 1/3] Update README.md --- README.md | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 118d60a..427afe6 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ Various GitLab hooks. For more information please read a series of articles on C - [Part II: GitLab workflow](https://community.intersystems.com/post/continuous-delivery-your-intersystems-solution-using-gitlab-part-ii-gitlab-workflow) - [Part III: GitLab installation and configuration](https://community.intersystems.com/post/continuous-delivery-your-intersystems-solution-using-gitlab-part-iii-gitlab-installation-and) - [Part IV: CD configuration](https://community.intersystems.com/post/continuous-delivery-your-intersystems-solution-using-gitlab-part-iv-cd-configuration) +- [Part V: Why containers?](https://community.intersystems.com/post/continuous-delivery-your-intersystems-solution-using-gitlab-part-v-why-containers) # Installation @@ -24,8 +25,19 @@ Available settings: | Setting | Sample Value | Description | |---------|------------------------|-------------------------------------------------------------------------------------------------| | ext | $lb("xml") | List of files extensions to load and compile. | -| tests | MyApp/Tests | Path relative from the repo root to the test suite. | +| tests | MyApp/Tests | Path relative from the repo root to the test suite. | | commit | | Do not set. Current commit hash. | -| init | Package.Class:Method | Code called before loading files. | +| hooks | MyApp/Hooks/ | Path relative from the repo root to the hooks. | | delete | Package.Class:Method | Code called to delete files from project. Should accept one argument - list of files to delete. | | url | http://127.0.0.1:57772 | Server root. | + + +## Hooks + +There are two types of hooks available: + +- **Global** - executed each time the CI is run. Extend `isc.git.hook.Global`. +- **Local** - executed once. Extend `isc.git.hook.Local`. + +Hooks of the same type are executed in collation order. To create a hook extend either or `isc.git.hook.Global` or `isc.git.hook.Local` and implement `onBefore` and/or `onAfter` methods. + From 5d7037aedd681ec2e76e046c8f8a593b77f73e5f Mon Sep 17 00:00:00 2001 From: Eduard Date: Thu, 29 Mar 2018 23:16:58 +0300 Subject: [PATCH 2/3] Tips and tricks --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 427afe6..e740c9a 100644 --- a/README.md +++ b/README.md @@ -41,3 +41,12 @@ There are two types of hooks available: Hooks of the same type are executed in collation order. To create a hook extend either or `isc.git.hook.Global` or `isc.git.hook.Local` and implement `onBefore` and/or `onAfter` methods. +## Tips & Tricks + +Various tricks for GitLab CI. + +### Namespaces + +Use `CI_COMMIT_REF_NAME` (resolves to branch) environment variable to use several namespaces on one server. + +I.e. `csession ensemble -U ${CI_COMMIT_REF_NAME} "##class(isc.git.GitLab).loadDiff()"` From da3e9aaa84667c5b5d83b50d83fa20b2fe80d370 Mon Sep 17 00:00:00 2001 From: Eduard Date: Thu, 29 Mar 2018 23:22:28 +0300 Subject: [PATCH 3/3] Update README.md --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index e740c9a..c5298a0 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,14 @@ There are two types of hooks available: Hooks of the same type are executed in collation order. To create a hook extend either or `isc.git.hook.Global` or `isc.git.hook.Local` and implement `onBefore` and/or `onAfter` methods. +### Execution order: + +1. Global hooks, before. +2. Local hooks, before. +3. Code load and compile. +4. Local hooks, after. +5. Global hooks, after. + ## Tips & Tricks Various tricks for GitLab CI.