Compare commits

...

6 Commits

Author SHA1 Message Date
oscarzhou
6aa61db728 feat(gitops): merge RepoConfigV2 and RepoConfig 2022-11-23 09:09:30 +13:00
oscarzhou
81b56792d9 feat(gitops): add RepoConfigV2 struct 2022-11-23 09:09:30 +13:00
oscarzhou
56b35b6344 feat(gitops): merge RepoConfigV2 and RepoConfig 2022-11-23 09:09:30 +13:00
oscarzhou
bc2d39d7a8 feat(gitops): add RepoConfigV2 struct 2022-11-23 09:09:30 +13:00
oscarzhou
45ce7b5c27 chore: join the untrusted paths rather than attaching on the exiting stack path 2022-11-23 09:09:30 +13:00
oscarzhou
154470df5f feat(filesystem): allow to create repository directory under the stack 2022-11-23 09:09:30 +13:00
3 changed files with 11 additions and 2 deletions

View File

@@ -154,6 +154,12 @@ func (service *Service) GetStackProjectPath(stackIdentifier string) string {
return JoinPaths(service.wrapFileStore(ComposeStorePath), stackIdentifier)
}
// GetStackProjectGitRepositoryPath returns the absolute path on the FS for a git repository of a stack based
// on its identifier and normalized repository name.
func (service *Service) GetStackProjectGitRepositoryPath(stackIdentifier, repoName string) string {
return JoinPaths(service.wrapFileStore(ComposeStorePath), stackIdentifier, repoName)
}
// Copy copies the file on fromFilePath to toFilePath
// if toFilePath exists func will fail unless deleteIfExists is true
func (service *Service) Copy(fromFilePath string, toFilePath string, deleteIfExists bool) error {

View File

@@ -13,10 +13,12 @@ type RepoConfig struct {
URL string `example:"https://github.com/portainer/portainer.git"`
// The reference name
ReferenceName string `example:"refs/heads/branch_name"`
// Path to where the config file is in this url/refName
ConfigFilePath string `example:"docker-compose.yml"`
// Git credentials
Authentication *GitAuthentication
// Path to where the config file is in this url/refName
ConfigFilePath string `example:"docker-compose.yml"`
// Applicable when deploying with multiple stack files
AdditionalFiles []string `example:"[nz.compose.yml, uat.compose.yml]"`
// Repository hash
ConfigHash string `example:"bc4c183d756879ea4d173315338110b31004b8e0"`
}

View File

@@ -1307,6 +1307,7 @@ type (
DeleteTLSFile(folder string, fileType TLSFileType) error
DeleteTLSFiles(folder string) error
GetStackProjectPath(stackIdentifier string) string
GetStackProjectGitRepositoryPath(stackIdentifier, repoName string) string
StoreStackFileFromBytes(stackIdentifier, fileName string, data []byte) (string, error)
UpdateStoreStackFileFromBytes(stackIdentifier, fileName string, data []byte) (string, error)
RemoveStackFileBackup(stackIdentifier, fileName string) error