Skip to content

Commit

Permalink
fix: fix lose migrate (#207)
Browse files Browse the repository at this point in the history
  • Loading branch information
CorrectRoadH authored Jan 24, 2025
1 parent cc80b33 commit e9c73a1
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ v0.3.5.1 ${DOWNLOAD_DOMAIN}IceWhaleTech/CasaOS-AppManagement/releases/download/v
v0.3.6 ${DOWNLOAD_DOMAIN}IceWhaleTech/CasaOS-AppManagement/releases/download/v0.4.0-alpha7/linux-${ARCH}-casaos-app-management-migration-tool-v0.4.0-alpha7.tar.gz
v0.3.7 ${DOWNLOAD_DOMAIN}IceWhaleTech/CasaOS-AppManagement/releases/download/v0.4.0-alpha7/linux-${ARCH}-casaos-app-management-migration-tool-v0.4.0-alpha7.tar.gz
v0.3.8 ${DOWNLOAD_DOMAIN}IceWhaleTech/CasaOS-AppManagement/releases/download/v0.4.0-alpha7/linux-${ARCH}-casaos-app-management-migration-tool-v0.4.0-alpha7.tar.gz
v0.4.5 ${DOWNLOAD_DOMAIN}IceWhaleTech/CasaOS-AppManagement/releases/download/v0.4.16/linux-${ARCH}-casaos-app-management-migration-tool-v0.4.16.tar.gz
2 changes: 1 addition & 1 deletion cmd/migration-tool/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func main() {

migrationTools := []interfaces.MigrationTool{
// NewMigrationDummy(),
NewMigration044AndOlder(),
NewMigration0415AndOlder(),
NewMigration0412AndOlder(),
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ var replaceUrl = []UrlReplacement{
},
{
OldUrl: "https://casaos.oss-cn-shanghai.aliyuncs.com/IceWhaleTech/_appstore/archive/refs/heads/main.zip",
NewUrl: "https://casaos.oss-cn-shanghai.aliyuncs.com/store/main.zip",
NewUrl: "https://cdn.jsdelivr.net/gh/IceWhaleTech/CasaOS-AppStore@gh-pages/store/main.zip",
},
}

type migrationTool044AndOlder struct{}
type migrationTool0415AndOlder struct{}

func (u *migrationTool044AndOlder) IsMigrationNeeded() (bool, error) {
func (u *migrationTool0415AndOlder) IsMigrationNeeded() (bool, error) {
_logger.Info("Checking if migration is needed...")

// read string from AppManagementConfigFilePath
Expand All @@ -53,11 +53,11 @@ func (u *migrationTool044AndOlder) IsMigrationNeeded() (bool, error) {
return false, nil
}

func (u *migrationTool044AndOlder) PreMigrate() error {
func (u *migrationTool0415AndOlder) PreMigrate() error {
return nil
}

func (u *migrationTool044AndOlder) Migrate() error {
func (u *migrationTool0415AndOlder) Migrate() error {
// replace string in AppManagementConfigFilePath
// replace https://github.com/IceWhaleTech/_appstore/archive/refs/heads/main.zip to https://casaos-appstore.github.io/casaos-appstore/linux-all-appstore.zip
file, err := os.OpenFile(config.AppManagementConfigFilePath, os.O_RDWR, 0644)
Expand Down Expand Up @@ -92,10 +92,10 @@ func (u *migrationTool044AndOlder) Migrate() error {
return nil
}

func (u *migrationTool044AndOlder) PostMigrate() error {
func (u *migrationTool0415AndOlder) PostMigrate() error {
return nil
}

func NewMigration044AndOlder() interfaces.MigrationTool {
return &migrationTool044AndOlder{}
func NewMigration0415AndOlder() interfaces.MigrationTool {
return &migrationTool0415AndOlder{}
}
2 changes: 1 addition & 1 deletion common/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package common

const (
AppManagementServiceName = "app-management"
AppManagementVersion = "0.4.5"
AppManagementVersion = "0.4.16"

AppsDirectoryName = "Apps"

Expand Down

0 comments on commit e9c73a1

Please sign in to comment.