Starting Gitea repositories baseline loading implementation.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2024-04-14 14:48:27 -05:00
parent 626cd86175
commit 06f59c71be
5 changed files with 75 additions and 0 deletions

View File

@ -0,0 +1,14 @@
Extension { #name : #Gofer }
{ #category : #'*ExoRepo' }
Gofer >> repositories [
"Answer the configured monticello repositories."
| result |
result := OrderedCollection withAll: repositories.
packageCacheRepository ifNotNil: [ result addFirst: packageCacheRepository ].
^ result asArray collect: [:each |
(each class = MCHttpRepository and: [each location beginsWith: 'gitea'])
ifTrue: [ MCRepository fromUrl: each location ] ifFalse: [ each ]
].
]

View File

@ -14,6 +14,21 @@ MCGiteabRepository class >> basicFromUrl: aZnUrl [
^ self location: aZnUrl asString
]
{ #category : #'*ExoRepo' }
MCGiteabRepository class >> createRepositoryFromSpec: aMetacelloRepositorySpec on: anIceMetacelloPharoPlatform [
^ anIceMetacelloPharoPlatform createGiteaRepository: aMetacelloRepositorySpec
]
{ #category : #accessing }
MCGiteabRepository class >> isAvailableFor: type [
^ type = 'gitea'
]
{ #category : #private }
MCGiteabRepository class >> projectZipUrlFor: projectPath versionString: versionString [
^ 'https://' , projectPath , '/archive/' , versionString , '.zip'
]
{ #category : #accessing }
MCGiteabRepository class >> urlSchemes [
^ #(gitea)
@ -39,6 +54,23 @@ MCGiteabRepository >> branches [
^ response
]
{ #category : #accessing }
MCGiteabRepository >> calculateRepositoryDirectory [
| directory |
directory := self class
projectDirectoryFrom: self projectPath, '/', self repoPath
version: self projectVersion.
self repoPath isEmpty ifFalse: [
directory := directory parent ].
^ directory
]
{ #category : #accessing }
MCGiteabRepository >> location: aString [
]
{ #category : #accessing }
MCGiteabRepository >> projectVersion [
(projectVersion == nil or: [ projectVersion isEmpty ])

View File

@ -0,0 +1,6 @@
Extension { #name : #MCGiteabRepository }
{ #category : #'*ExoRepo' }
MCGiteabRepository class >> createRepositoryFromSpec: aMetacelloRepositorySpec on: anIceMetacelloPharoPlatform [
^ anIceMetacelloPharoPlatform createGiteaRepository: aMetacelloRepositorySpec
]

View File

@ -0,0 +1,15 @@
Extension { #name : #MetacelloCommonMCSpecLoader }
{ #category : #'*ExoRepo' }
MetacelloCommonMCSpecLoader >> linearLoadPackageSpecs: packageSpecs repositories: repositories [
| gofer sanitizedRepos |
gofer := MetacelloGofer new.
sanitizedRepos := OrderedCollection withAll: repositories.
sanitizedRepos := sanitizedRepos collect: [:each |
(each class = MCHttpRepository and: [each location beginsWith: 'gitea'])
ifTrue: [ MCRepository fromUrl: each location ] ifFalse: [ each ]
].
sanitizedRepos do: [:repo | gofer repository: repo ].
packageSpecs do: [:pkg | pkg loadUsing: self gofer: gofer ].
]

View File

@ -1,5 +1,13 @@
Extension { #name : #MetacelloPlatform }
{ #category : #'*ExoRepo' }
MetacelloPlatform >> createGiteaRepository: aRepositorySpec [
| cl |
cl := MCGiteabRepository.
^ cl location: aRepositorySpec description
]
{ #category : #'*ExoRepo' }
MetacelloPlatform >> extractTypeFromDescription: description [
description == nil