├── sc-list.txt ├── LICENSE ├── CacheGitHubCI ├── REST.cls.xml ├── Task.cls.xml ├── Action.cls.xml ├── Cube.cls.xml ├── Update.cls.xml ├── Install.cls.xml ├── Hook.cls.xml └── GitHub.cls.xml ├── CacheGitHubCI-RepositoryStatus.dashboard.dfi.xml ├── CacheGitHubCI-RepositoryStatus.pivot.dfi.xml └── README.md /sc-list.txt: -------------------------------------------------------------------------------- 1 | CacheGitHubCI-RepositoryStatus.dashboard.DFI 2 | CacheGitHubCI-RepositoryStatus.pivot.DFI 3 | CacheGitHubCI.PKG 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 eduard93 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /CacheGitHubCI/REST.cls.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | %CSP.REST 5 | 63594,50226.449506 6 | 7 | 8 | 10 | 11 | 12 | 13 | 14 | ]]> 15 | 16 | 17 | 18 | 1 19 | %Status 20 | 24 | 25 | 26 | 27 | 1 28 | Owner:%String,Repository:%String,Namespace=$Namespace 29 | %Status 30 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /CacheGitHubCI-RepositoryStatus.dashboard.dfi.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /CacheGitHubCI/Task.cls.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Simple update task. Use CacheGitHubCI.Hook if you need more functionality. 6 | %SYS.Task.Definition 7 | 63600,45875.997358 8 | 9 | 10 | GitHubUpdateTask 11 | 12 | 13 | 14 | 15 | Repository URL, like https://github.com/intersystems-ru/Cache-MDX2JSON 16 | %String 17 | 18 | 19 | 20 | 22 | Note, that with Username/Password, you can make up to 5,000 requests per hour. 23 | For unauthenticated requests, the rate limit allows to make up to 60 requests per hour. 24 | Unauthenticated requests are associated with an IP address.
25 | Required, if you want to create webhooks]]>
26 | %String 27 |
28 | 29 | 30 | 31 | GitHub password, corresponding to Username. Optional for public repositories. 32 | %String 33 | 34 | 35 | 36 | 37 | Namespace, where to download and compile repository 38 | %String 39 | $Namespace 40 | 41 | 42 | 43 | %Status 44 | 58 | 59 |
60 |
61 | -------------------------------------------------------------------------------- /CacheGitHubCI/Action.cls.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | %SerialObject 5 | 63599,80457.718702 6 | 7 | 8 | 9 | Type of performed action. 10 | %String 11 | 12 | 13 | 14 | 15 | 17 | For classmethod Type: classmethod,classname,arg1,...,argN
18 | For code Type: COS code. Recommended structure: Set st=##class(Some.Class).DoSomeThing(Args) Throw:('st) ##class(%Exception.StatusException).CreateFromStatus(st)"
]]>
19 | %String 20 |
21 | 22 | 23 | 24 | Namespace, to execute action. 25 | %String 26 | $Namespace 27 | 28 | 29 | 30 | 31 | Executes Action specified. 32 | %Status 33 | 48 | 49 | 50 | 51 | 1 52 | %Status 53 | 62 | 63 | 64 | 65 | 66 | Copied from %SYS.Task.RunLegacyTask 67 | 1 68 | 0 69 | 78 | 79 | 80 | 81 | %ValidateObject method to 83 | provide notification that the current object is being validated. 84 | 85 |

If this method returns an error then %ValidateObject will fail.]]> 86 | 1 87 | %Status 88 | 1 89 | 98 | 99 | 100 | 101 | %Library.CacheSerialState 102 | ^CacheGitHubCI.ActionD 103 | ActionDefaultData 104 | ^CacheGitHubCI.ActionD 105 | ^CacheGitHubCI.ActionI 106 | ActionState 107 | ^CacheGitHubCI.ActionS 108 | 109 | listnode 110 | "1" 111 | 112 | %%CLASSNAME 113 | 114 | 115 | 116 | listnode 117 | 118 | 119 | Type 120 | 121 | 122 | Params 123 | 124 | 125 | Namespace 126 | 127 | 128 | 129 | 130 | 131 | -------------------------------------------------------------------------------- /CacheGitHubCI/Cube.cls.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Cube for Continuous Integration for InterSystems Caché and GitHub. See at https://github.com/intersystems-ru/CacheGitHubCI 6 | 1 7 | %DeepSee.CubeDefinition 8 | 63624,29337.207633 9 | CacheGitHubCI.Hook 10 | 11 | 12 | 13 | 14 | 15 | 16 | Cube definition from Architect. 17 | http://www.intersystems.com/deepsee 18 | 20 | 26 | 32 | 38 | 44 | 50 | 56 | 57 | 58 | 59 |

60 | 61 | ]]> 62 | 63 | 64 | 65 | Delay seconds.]]> 67 | 1 68 | Delay:%Integer=10 69 | 73 | 74 |
75 |
76 | -------------------------------------------------------------------------------- /CacheGitHubCI-RepositoryStatus.pivot.dfi.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /CacheGitHubCI/Update.cls.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | %Persistent 5 | 63596,55253.399026 6 | 7 | 8 | %String 9 | 10 | 11 | 12 | Hook 13 | CacheGitHubCI.Hook 14 | 15 | 16 | 17 | %TimeStamp 18 | $ZDT($NOW(),3,1,2) 19 | 20 | 21 | 22 | %TimeStamp 23 | 24 | 25 | 26 | %String 27 | 28 | 29 | 30 | %String 31 | 32 | 33 | 34 | 35 | %String 36 | 37 | 38 | 39 | %String 40 | 41 | 42 | 43 | 44 | %String 45 | 46 | 47 | 48 | 49 | %String 50 | 51 | 52 | 53 | 54 | %String 55 | 56 | 57 | 58 | 59 | %String 60 | 61 | 62 | 63 | 64 | If this method returns an error status then %Save() will fail and the transaction 71 | will be rolled back.]]> 72 | depth:%Integer=3,insert:%Integer=0,callcount:%Integer=0 73 | 1 74 | %Status 75 | 1 76 | 81 | 82 | 83 | 84 | Hook:%String 85 | 1 86 | %Status 87 | 1 88 | 92 | 93 | 94 | 95 | 1 96 | Owner:%String,Repository:%String,Namespace=$Namespace 97 | %String 98 | 107 | 108 | 109 | 110 | 1 111 | Status:%String="" 112 | %String 113 | DisplayStatus 114 | 1 115 | 119 | 120 | 121 | 122 | %Library.CacheStorage 123 | ^CacheGitHubCI.UpdateD 124 | UpdateDefaultData 125 | ^CacheGitHubCI.UpdateD 126 | ^CacheGitHubCI.UpdateI 127 | ^CacheGitHubCI.UpdateS 128 | 129 | listnode 130 | 131 | 132 | %%CLASSNAME 133 | 134 | 135 | DateTimeStart 136 | 137 | 138 | DateTimeEnd 139 | 140 | 141 | Length 142 | 143 | 144 | Commit 145 | 146 | 147 | Hook 148 | 149 | 150 | Author 151 | 152 | 153 | URL 154 | 155 | 156 | Status 157 | 158 | 159 | CompileStatus 160 | 161 | 162 | PreCompileStatus 163 | 164 | 165 | PostCompileStatus 166 | 167 | 168 | UnitTestsStatus 169 | 170 | 171 | 172 | 173 | 174 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CacheGitHubCI 2 | Continuous Integration for InterSystems Caché and GitHub. 3 | 4 | Installation 5 | ----------- 6 | 7 | 1. Import Install.cls.xml (from folder in repository or releases page) into Caché via Studio or Terminal or SMP 8 | 2. Run in terminal (any namespace): 9 | 10 | Set pVars("Namespace") = "CGCI" 11 | Set pVars("IP") = {IP} 12 | Do ##class(CacheGitHubCI.Install).setup(.pVars) 13 | 14 | where: 15 | 16 | {Namespace} is a namespace you want to install to. If it does not exist it would be created automatically. If it does exist only CacheGitHubCI package would be overwritten. 17 | {IP} is an optional parameter of address of your server (with port, if required). For example "45.45.45.45:57776", "mycacheserver.com". Required if you wish to use webhook functionality. 18 | On this step installer would create (if needed) Namespace and corresponding database, download source code from GitHub and compile it, optionally create web application (named /cgci) if one does not exist (skipping web application creation process if one does exist or no IP is provided). 19 | 20 | 3. Give the correct roles to `/cgci` webapplication for it to be able to compile desired classes. 21 | 4. Check that `^CacheGitHubCI("IP")` global is set to {IP}. Set manually, if not. 22 | 23 | 24 | Webhook Installation 25 | ----------- 26 | 27 | If you want to use webhooks functionality, additional installation steps are required. 28 | 29 | 1. Check that your server has static public {IP} address. 30 | 2. Check that your server is not under NAT/Firewall/etc. by accessing Caché System Management Portal through {IP}. 31 | 32 | Usage 33 | ----------- 34 | 35 | There are two ways to create syncing between GitHub repository and Cache instance: 36 | 37 | 1. Simple Task 38 | 2. Hook 39 | 40 | Simple Task 41 | ----------- 42 | 43 | To create task, syncing GitHub repository → Cache instance do the following: 44 | 45 | 1. Go to SMP → System Operation → Task Manager → New Task 46 | 2. Set Name as desired 47 | 3. Set Namespace to run task in to {Namespace} 48 | 4. Set Task type to GitHubUpdateTask 49 | 5. Set GitHubURL to a valid GitHub repository, eg: https://github.com/intersystems-ru/Cache-MDX2JSON 50 | 7. Set Namespace to a Namespace you want to download GitHub repository to 51 | 8. Set other parameters as desired and finish creation of the task 52 | 53 | After task runs at least once you will get GitHubURL repository contents in Namespace 54 | 55 | Hook 56 | ----------- 57 | 58 | To create more sophisticated setups you need to use CacheGitHubCI.Hook. Usage example: 59 | 60 | Set hook=##class(CacheGitHubCI.Hook).%New() // Create hook 61 | Set hook.Namespace="user" // Set namespace you want to download GitHub repository to 62 | Set hook.Owner="intersystems-ru" // Set repository owner 63 | Set hook.Repository="cache-mdx2json" // Set repository name 64 | Set hook.Branch="master" // Set repository branch 65 | Do hook.%Save() 66 | 67 | In this example we created a hook to download [MDX2JSON](https://github.com/intersystems-ru/Cache-MDX2JSON) repository into USER namespace. Now we activate it by creating a task or a webhook to update it. Task updates namespace with repository contents every X minutes (60 by default): 68 | 69 | W hook.CreateTask(60) // Create task to run every 60 minutes 70 | Do hook.%Save() 71 | 72 | Webhook updates repository only when someone pushes changes into it. To use webhook functionality you must complete steps, described in Webhook Installation part of this document. To create webhook do: 73 | 74 | Set hook.Username="GitHub Username" // Required for private repositories or if you want to use webhooks 75 | Set hook.Password="GitHub Password" 76 | W hook.CreateHook() // Creates GitHub webhook 77 | Do hook.%Save() 78 | 79 | Hook execution 80 | ----------- 81 | 82 | Every time hook gets activated (by webhook or task) it executes the following series of steps: PreCompile → Compile → PostCompile → UnitTests. You can (optionally) supply the code for PreCompile, PostCompile, UnitTests steps and results of their execution get recorded in CacheGitHubCI.Update object. Here's how to create actions: 83 | 84 | Set a1 = ##class(CacheGitHubCI.Action).%New() // Create new action 85 | Set a1.Type="code" // Set it as COS code 86 | Set a1.Params="s ^test($zdt($Now(-180)))=""started compiling""" // Set what COS code to execute 87 | Set hook.PreCompile=a1 // Set it to execute every time before downloading and compiling repository 88 | 89 | Set a2 = ##class(CacheGitHubCI.Action).%New() 90 | Set a2.Type="classmethod" // Set it as classmethod 91 | Set a2.Namespace="USER" // Set namespace to run action as USER ({Namespace} by default) 92 | Set a2.Params="MDX2JSON.REST,Test" // classmethod,classname,arg1,...,argN 93 | Set hook.PostCompile=a2 // Set it to execute every time after downloading and compiling repository 94 | 95 | Set a3 = ##class(CacheGitHubCI.Action).%New() 96 | Set a3.Type="classmethod" 97 | Set a3.Namespace="USER" 98 | Set a3.Params="MDX2JSON.REST,Test" 99 | Set hook.UnitTests=a3 // Action For UnitTest 100 | 101 | Do hook.%Save() 102 | 103 | Updates History 104 | ----------- 105 | To see the history of updates you can execute following SQL query in {Namespace}: 106 | 107 | SELECT * FROM CacheGitHubCI."Update" WHERE Hook = 'owner||repository||namespace' 108 | 109 | So, for Cache-MDX2JSON the request would look like: 110 | 111 | SELECT * FROM CacheGitHubCI."Update" WHERE Hook = 'intersystems-ru||cache-mdx2json||user' 112 | 113 | To see what’s going on with all your hooks: 114 | 115 | SELECT Namespace, Owner, Repository, LastUpdateDateTime, LastUpdateStatus FROM CacheGitHubCI.Hook 116 | 117 | LastUpdateStatus is result of latest update attempt: 118 | 119 | Successful - update successful 120 | Reverted - update error, reverted to last successful commit 121 | 122 | DeepSee 123 | ----------- 124 | 125 | There is DeepSee cube CacheGitHubCICube in {Namespace}. It updates automatically after every hook update. There is also a pivot and a dashboard providing information about available hooks and their status. 126 | 127 | Discussion 128 | ----------- 129 | See the [related discussion on InterSystems Developer Community](https://community.intersystems.com/post/git-continuous-integration-what-are-most-important-differences-between-cachegithubci-and) 130 | 131 | -------------------------------------------------------------------------------- /CacheGitHubCI/Install.cls.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 63613,47857.460994 5 | 6 | 7 | 8 | See generated code in zsetup+1^CacheGitHubCI.Install.1 9 | todo add optional parameter WEBAPP to Alter web app name if it needs to have another then namespace name 10 | INSTALLER 11 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | ]]> 46 | 47 | 48 | 49 | 50 | This is a method generator whose code is generated by XGL. 51 | Set pVars("Namespace")="CGCI" 52 | Set pVars("IP")="serverip:serverport" 53 | do ##class(CacheGitHubCI.Install).setup(.pVars) 54 | 1 55 | 1 56 | objectgenerator 57 | 58 | %Status 59 | 61 | 62 | 63 | 64 | 1 65 | pVars,pLogLevel,tInstaller 66 | %Status 67 | 82 | 83 | 84 | 85 | 86 | Determine Namespace databease resource. 87 | 1 88 | Namespace:%String="%SYS" 89 | %String 90 | 105 | 106 | 107 | 108 | 1 109 | pVars,pLogLevel,tInstaller 110 | %Status 111 | 115 | 116 | 117 | 118 | 1 119 | pVars,pLogLevel,tInstaller 120 | %Status 121 | 129 | 130 | 131 | 132 | 134 | Owner - The name of the repository owner.
135 | Repository - The name of the repository.
136 | Branch - The name of the commit/branch/tag. If skipped the repository’s default branch (usually master) would be used.
137 | Username - GitHub user, who has access to repository. Optional for public repositories.
138 | Password - GitHub password, corresponding to Username. Optional for public repositories.
139 | Note, that with Username, you can make up to 5,000 requests per hour. 140 | For unauthenticated requests, the rate limit allows to make up to 60 requests per hour. 141 | Unauthenticated requests are associated with an IP address.
142 | Namespace - Namespace, where to download and compile repository.
143 | 144 | For example in the repository: https://github.com/intersystems-ru/Cache-MDX2JSON
145 | Owner - intersystems-ru, Repository - Cache-MDX2JSON.
]]>
146 | 1 147 | Namespace=$Namespace,Owner:%String="intersystems-ru",Repository:%String="CacheGitHubCI",Branch:%String,Username:%String,Password:%String 148 | %Status 149 | 180 |
181 | 182 | 183 | 185 | Path -Internal repository path. Root is empty string
186 | Request - Authenticated/Set %Net.HttpRequest object.
187 | Links - List of links to raw files (which satisfy IsCacheFile conditions) from repository.
]]>
188 | 1 189 | 190 | %Status 191 | 220 |
221 | 222 | 223 | 224 | Check that incoming file is the one you need. 225 | See $$autoDetectType^%apiOBJ 226 | 1 227 | File:%ZEN.proxyObject 228 | %Boolean 229 | 235 | 236 | 237 | 238 | 240 | Links - List of links to raw files.
241 | Request - Authenticated/Set %Net.HttpRequest object.
242 | loadedlist - Returns an array of the items loaded. ]]>
243 | 1 244 | Links:%ListOfDataTypes,Request:%Net.HttpRequest,*Items 245 | %Status 246 | 262 |
263 |
264 |
265 | -------------------------------------------------------------------------------- /CacheGitHubCI/Hook.cls.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Hook tying GitHub repository and Cache Namespace. 6 | Create instance of the class, create webhook or task for updates and save the instance. 7 | %Persistent 8 | 63595,74765.029055 9 | 10 | 11 | 12 | The name of the repository owner. 13 | %String 14 | 15 | 16 | 17 | 18 | The name of the repository. 19 | %String 20 | 21 | 22 | 23 | 24 | Namespace, where to download and compile repository 25 | %String 26 | $Namespace 27 | 28 | 29 | 30 | 1 31 | Owner,Repository,Namespace 32 | 33 | 34 | 35 | 36 | Repository branch, usually master. Leave empty, if you want to receive default branch. 37 | %String 38 | 39 | 40 | 41 | 43 | Note, that with Username/Password, you can make up to 5,000 requests per hour. 44 | For unauthenticated requests, the rate limit allows to make up to 60 requests per hour. 45 | Unauthenticated requests are associated with an IP address.
46 | Required, if you want to create webhooks]]>
47 | %String 48 |
49 | 50 | 51 | 52 | GitHub password, corresponding to Username. Optional for public repositories. 53 | %String 54 | 55 | 56 | 57 | 58 | Id of GitHub webhook. Set with CreateHook method. 59 | %String 60 | 61 | 62 | 63 | 64 | Id of Cache Task. Set with CreateTask method. 65 | %String 66 | 67 | 68 | 69 | 70 | Updates history 71 | CacheGitHubCI.Update 72 | list 73 | 74 | 75 | 76 | 77 | What to do before compiling repository 78 | CacheGitHubCI.Action 79 | 80 | 81 | 82 | 83 | What to do after compiling repository 84 | CacheGitHubCI.Action 85 | 86 | 87 | 88 | 89 | What to do for Unit Testing 90 | CacheGitHubCI.Action 91 | 92 | 93 | 94 | 95 | DateTime of latest update attempt 96 | %TimeStamp 97 | 98 | 99 | 100 | 102 | successful - update successful
103 | reverted - update error, reverted to last successful commit ]]>
104 | %String 105 |
106 | 107 | 108 | 109 | Set main variables, if provided. 110 | Owner:%String,Repository:%String,Branch:%String,Username:%String,Password:%String,Namespace=$Namespace 111 | 1 112 | %Status 113 | 1 114 | 124 | 125 | 126 | 127 | value:%String 128 | %Status 129 | 133 | 134 | 135 | 136 | value:%String 137 | %Status 138 | 142 | 143 | 144 | 145 | value:%String 146 | %Status 147 | 152 | 153 | 154 | 155 | 156 | Create GitHub webhook, if we have admin access to repository. 157 | %Status 158 | 166 | 167 | 168 | 169 | 170 | Delete GitHub webhook, if one exists. 171 | %Status 172 | 179 | 180 | 181 | 182 | min minutes]]> 184 | min:%Integer=60 185 | %Status 186 | 210 | 211 | 212 | 213 | 214 | Delete update task 215 | %Status 216 | 222 | 223 | 224 | 225 | 226 | Check repository and update local namespace 227 | 1 228 | Owner:%String,Repository:%String,Namespace=$Namespace 229 | %Status 230 | 0) && (commit.sha = hook.Updates.GetPrevious("").Commit)) { 240 | Set hook.LastUpdateDateTime = $ZDT($NOW(),3,1,2) 241 | Do hook.%Save() 242 | Return $$$OK 243 | } 244 | 245 | Set update = ##class(CacheGitHubCI.Update).%New(hook.%Id()) 246 | Set update.Commit = commit.sha 247 | Set update.Author = commit.author.login 248 | Set update.URL = commit.url 249 | 250 | Set update.PreCompileStatus = hook.PreCompile.Execute() 251 | Set update.CompileStatus = ##class(CacheGitHubCI.GitHub).Update(hook.Owner,hook.Repository,hook.Branch,hook.Username,hook.Password,hook.Namespace) 252 | Set update.PostCompileStatus = hook.PostCompile.Execute() 253 | Set update.UnitTestsStatus = hook.UnitTests.Execute() 254 | 255 | Do hook.Updates.Insert(update) 256 | Do hook.%Save() 257 | 258 | Set st = $$$ADDSC($$$ADDSC($$$ADDSC(update.PreCompileStatus,update.CompileStatus),update.PostCompileStatus),update.UnitTestsStatus) 259 | If $$$ISERR(st) { 260 | Set hook.LastUpdateStatus = "Reverted" 261 | Set successcommit = ##class(CacheGitHubCI.Update).GetLastSuccessfulCommit(Owner,Repository,Namespace) 262 | do hook.PreCompile.Execute() 263 | do ##class(CacheGitHubCI.GitHub).Update(hook.Owner,hook.Repository,successcommit,hook.Username,hook.Password,hook.Namespace) 264 | do hook.PostCompile.Execute() 265 | do hook.UnitTests.Execute() 266 | } Else { 267 | Set hook.LastUpdateStatus = "Successful" 268 | } 269 | 270 | Set hook.LastUpdateDateTime = $ZDT($NOW(),3,1,2) 271 | Do hook.%Save() 272 | JOB ##class(CacheGitHubCI.Cube).BuildCube() 273 | Return st 274 | ]]> 275 | 276 | 277 | 278 | 1 279 | Owner:%String,Repository:%String,Namespace=$Namespace 280 | CacheGitHubCI.Hook 281 | 298 | 299 | 300 | 301 | %Library.CacheStorage 302 | ^CacheGitHubCI.HookD 303 | HookDefaultData 304 | ^CacheGitHubCI.HookD 305 | ^CacheGitHubCI.HookI 306 | ^CacheGitHubCI.HookS 307 | 308 | listnode 309 | 310 | 311 | %%CLASSNAME 312 | 313 | 314 | Branch 315 | 316 | 317 | Username 318 | 319 | 320 | Password 321 | 322 | 323 | HookId 324 | 325 | 326 | Owner 327 | 328 | 329 | Repository 330 | 331 | 332 | Namespace 333 | 334 | 335 | Updates 336 | 337 | 338 | TaskId 339 | 340 | 341 | PreCompile 342 | 343 | 344 | PostCompile 345 | 346 | 347 | UnitTests 348 | 349 | 350 | PreCompileStatus 351 | 352 | 353 | PostCompileStatus 354 | 355 | 356 | UnitTestsStatus 357 | 358 | 359 | LastUpdateDateTime 360 | 361 | 362 | LastUpdateStatus 363 | 364 | 365 | 366 |
367 |
368 | -------------------------------------------------------------------------------- /CacheGitHubCI/GitHub.cls.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | %RegisteredObject 5 | 63595,74968.945813 6 | 7 | 8 | 1 9 | %String 10 | 14 | 15 | 16 | 17 | 1 18 | Username:%String,Password:%String 19 | %Net.HttpRequest 20 | 41 | 42 | 43 | 44 | 1 45 | Owner:%String,Repository:%String,Username:%String="",Password:%String="",Namespace=$Namespace,*HookId 46 | %Status 47 | 74 | 75 | 76 | 77 | 1 78 | Owner:%String,Repository:%String,Username:%String="",Password:%String="",HookId:%Integer 79 | %Status 80 | 94 | 95 | 96 | 97 | 1 98 | Owner:%String,Repository:%String,Username:%String="",Password:%String="",Namespace=$Namespace,*Hooks 99 | %Status 100 | 114 | 115 | 116 | 117 | 1 118 | Owner:%String,Repository:%String,Branch:%String="master",Username:%String="",Password:%String="",*Commit:%ZEN.proxyObject 119 | %Status 120 | 135 | 136 | 137 | 138 | 140 | Owner - The name of the repository owner.
141 | Repository - The name of the repository.
142 | Branch - The name of the commit/branch/tag. If skipped the repository’s default branch (usually master) would be used.
143 | Username - GitHub user, who has access to repository. Optional for public repositories.
144 | Password - GitHub password, corresponding to Username. Optional for public repositories.
145 | Note, that with Username, you can make up to 5,000 requests per hour. 146 | For unauthenticated requests, the rate limit allows to make up to 60 requests per hour. 147 | Unauthenticated requests are associated with an IP address.
148 | Namespace - Namespace, where to download and compile repository.
149 | 150 | For example in the repository: https://github.com/intersystems-ru/Cache-MDX2JSON
151 | Owner - intersystems-ru, Repository - Cache-MDX2JSON.
]]>
152 | 1 153 | Owner:%String,Repository:%String,Branch:%String="",Username:%String="",Password:%String="",Namespace=$Namespace 154 | %Status 155 | 172 |
173 | 174 | 175 | 177 | Path -Internal repository path. Root is empty string
178 | Request - Authenticated/Set %Net.HttpRequest object.
179 | Links - List of links to raw files (which satisfy IsCacheFile conditions) from repository.
]]>
180 | 1 181 | 182 | %Status 183 | 214 |
215 | 216 | 217 | 218 | Check that incoming file is the one you need. 219 | 1 220 | File:%ZEN.proxyObject 221 | %Boolean 222 | 228 | 229 | 230 | 231 | 233 | Links - List of links to raw files.
234 | Request - Authenticated/Set %Net.HttpRequest object.
235 | loadedlist - Returns an array of the items loaded. ]]>
236 | 1 237 | Links:%ListOfDataTypes,Request:%Net.HttpRequest,*Items 238 | %Status 239 | 266 |
267 |
268 |
269 | --------------------------------------------------------------------------------