-
Notifications
You must be signed in to change notification settings - Fork 541
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
57 changed files
with
1,584 additions
and
583 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
Licensed to the Apache Software Foundation (ASF) under one or more | ||
contributor license agreements. See the NOTICE file distributed with | ||
this work for additional information regarding copyright ownership. | ||
The ASF licenses this file to You under the Apache License, Version 2.0 | ||
(the "License"); you may not use this file except in compliance with | ||
the License. You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package devops | ||
|
||
import ( | ||
"github.com/apache/incubator-devlake/core/models/domainlayer" | ||
"time" | ||
) | ||
|
||
type CicdRelease struct { | ||
domainlayer.DomainEntity | ||
PublishedAt time.Time `json:"publishedAt"` | ||
|
||
CicdScopeId string `gorm:"index;type:varchar(255)"` | ||
|
||
Name string `gorm:"type:varchar(255)"` | ||
DisplayTitle string `gorm:"type:varchar(255)"` | ||
Description string `json:"description"` | ||
URL string `json:"url"` | ||
|
||
IsDraft bool `json:"isDraft"` | ||
IsLatest bool `json:"isLatest"` | ||
IsPrerelease bool `json:"isPrerelease"` | ||
|
||
AuthorID string `json:"id" gorm:"type:varchar(255)"` | ||
|
||
RepoId string `gorm:"type:varchar(255)"` | ||
//RepoUrl string `gorm:"index;not null"` | ||
|
||
TagName string `json:"tagName"` | ||
CommitSha string `gorm:"uniqueIndex;type:varchar(255)"` | ||
//CommitMsg string | ||
//RefName string `gorm:"type:varchar(255)"` | ||
} | ||
|
||
func (CicdRelease) TableName() string { | ||
return "cicd_releases" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
69 changes: 69 additions & 0 deletions
69
backend/core/models/migrationscripts/20240514_add_cicd_release.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/* | ||
Licensed to the Apache Software Foundation (ASF) under one or more | ||
contributor license agreements. See the NOTICE file distributed with | ||
this work for additional information regarding copyright ownership. | ||
The ASF licenses this file to You under the Apache License, Version 2.0 | ||
(the "License"); you may not use this file except in compliance with | ||
the License. You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package migrationscripts | ||
|
||
import ( | ||
"github.com/apache/incubator-devlake/core/models/migrationscripts/archived" | ||
"time" | ||
|
||
"github.com/apache/incubator-devlake/core/context" | ||
"github.com/apache/incubator-devlake/core/errors" | ||
"github.com/apache/incubator-devlake/core/plugin" | ||
) | ||
|
||
var _ plugin.MigrationScript = (*addCicdRelease)(nil) | ||
|
||
type cicdRelease20240514 struct { | ||
archived.DomainEntity | ||
PublishedAt time.Time `json:"publishedAt"` | ||
|
||
CicdScopeId string `gorm:"index;type:varchar(255)"` | ||
|
||
Name string `gorm:"type:varchar(255)"` | ||
DisplayTitle string `gorm:"type:varchar(255)"` | ||
Description string `json:"description"` | ||
URL string `json:"url"` | ||
|
||
IsDraft bool `json:"isDraft"` | ||
IsLatest bool `json:"isLatest"` | ||
IsPrerelease bool `json:"isPrerelease"` | ||
|
||
AuthorID string `json:"id" gorm:"type:varchar(255)"` | ||
|
||
RepoId string `gorm:"type:varchar(255)"` | ||
|
||
TagName string `json:"tagName"` | ||
} | ||
|
||
func (cicdRelease20240514) TableName() string { | ||
return "cicd_releases" | ||
} | ||
|
||
type addCicdRelease struct{} | ||
|
||
func (*addCicdRelease) Up(basicRes context.BasicRes) errors.Error { | ||
return basicRes.GetDal().AutoMigrate(cicdRelease20240514{}) | ||
} | ||
|
||
func (*addCicdRelease) Version() uint64 { | ||
return 20240514181200 | ||
} | ||
|
||
func (*addCicdRelease) Name() string { | ||
return "add cicd_releases table" | ||
} |
49 changes: 49 additions & 0 deletions
49
backend/core/models/migrationscripts/20240515_add_commit_sha_to_cicd_release.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
Licensed to the Apache Software Foundation (ASF) under one or more | ||
contributor license agreements. See the NOTICE file distributed with | ||
this work for additional information regarding copyright ownership. | ||
The ASF licenses this file to You under the Apache License, Version 2.0 | ||
(the "License"); you may not use this file except in compliance with | ||
the License. You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package migrationscripts | ||
|
||
import ( | ||
"github.com/apache/incubator-devlake/core/context" | ||
"github.com/apache/incubator-devlake/core/errors" | ||
"github.com/apache/incubator-devlake/core/plugin" | ||
"github.com/apache/incubator-devlake/helpers/migrationhelper" | ||
) | ||
|
||
var _ plugin.MigrationScript = (*addCommitShaToCicdRelease)(nil) | ||
|
||
type cicdRelease20240515 struct { | ||
CommitSha string | ||
} | ||
|
||
func (cicdRelease20240515) TableName() string { | ||
return "cicd_releases" | ||
} | ||
|
||
type addCommitShaToCicdRelease struct{} | ||
|
||
func (*addCommitShaToCicdRelease) Up(basicRes context.BasicRes) errors.Error { | ||
return migrationhelper.AutoMigrateTables(basicRes, &cicdRelease20240515{}) | ||
} | ||
|
||
func (*addCommitShaToCicdRelease) Version() uint64 { | ||
return 20240515194901 | ||
} | ||
|
||
func (*addCommitShaToCicdRelease) Name() string { | ||
return "add commit_sha to cicd_releases" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.