From 0557284461280a1d80c69d718993a9740301a462 Mon Sep 17 00:00:00 2001 From: decentral1se Date: Tue, 8 Feb 2022 00:57:31 +0100 Subject: [PATCH] fix: use new repo name --- cli/catalogue/catalogue.go | 72 +++++++++++++++++++------------------- pkg/config/env.go | 1 + pkg/recipe/recipe.go | 2 +- 3 files changed, 38 insertions(+), 37 deletions(-) diff --git a/cli/catalogue/catalogue.go b/cli/catalogue/catalogue.go index 3aaebe09..8546bd3d 100644 --- a/cli/catalogue/catalogue.go +++ b/cli/catalogue/catalogue.go @@ -20,40 +20,40 @@ import ( // CatalogueSkipList is all the repos that are not recipes. var CatalogueSkipList = map[string]bool{ - "abra": true, - "abra-apps": true, - "abra-aur": true, - "abra-bash": true, - "abra-capsul": true, - "abra-gandi": true, - "abra-hetzner": true, - "apps": true, - "aur-abra-git": true, - "auto-apps-json": true, - "auto-mirror": true, - "backup-bot": true, - "backup-bot-two": true, - "beta.coopcloud.tech": true, - "comrade-renovate-bot": true, - "coopcloud.tech": true, - "coturn": true, - "docker-cp-deploy": true, - "docker-dind-bats-kcov": true, - "docs.coopcloud.tech": true, - "drone-abra": true, - "example": true, - "gardening": true, - "go-abra": true, - "organising": true, - "outline-with-patch": true, - "pyabra": true, - "radicle-seed-node": true, - "recipes": true, - "stack-ssh-deploy": true, - "swarm-cronjob": true, - "tagcmp": true, - "traefik-cert-dumper": true, - "tyop": true, + "abra": true, + "abra-apps": true, + "abra-aur": true, + "abra-bash": true, + "abra-capsul": true, + "abra-gandi": true, + "abra-hetzner": true, + "apps": true, + "aur-abra-git": true, + "auto-apps-json": true, + "auto-mirror": true, + "backup-bot": true, + "backup-bot-two": true, + "beta.coopcloud.tech": true, + "comrade-renovate-bot": true, + "coopcloud.tech": true, + "coturn": true, + "docker-cp-deploy": true, + "docker-dind-bats-kcov": true, + "docs.coopcloud.tech": true, + "drone-abra": true, + "example": true, + "gardening": true, + "go-abra": true, + "organising": true, + "outline-with-patch": true, + "pyabra": true, + "radicle-seed-node": true, + "recipes-catalogue-json": true, + "stack-ssh-deploy": true, + "swarm-cronjob": true, + "tagcmp": true, + "traefik-cert-dumper": true, + "tyop": true, } var catalogueGenerateCommand = cli.Command{ @@ -215,7 +215,7 @@ keys configured on your account. logrus.Fatal(err) } - sshURL := fmt.Sprintf(config.SSH_URL_TEMPLATE, "recipes") + sshURL := fmt.Sprintf(config.SSH_URL_TEMPLATE, config.CATALOGUE_JSON_REPO_NAME) if err := gitPkg.CreateRemote(repo, "origin-ssh", sshURL, internal.Dry); err != nil { logrus.Fatal(err) } @@ -236,7 +236,7 @@ keys configured on your account. } if !internal.Dry && internal.Publish { - url := fmt.Sprintf("%s/recipes/commit/%s", config.REPOS_BASE_URL, head.Hash()) + url := fmt.Sprintf("%s/%s/commit/%s", config.REPOS_BASE_URL, config.CATALOGUE_JSON_REPO_NAME, head.Hash()) logrus.Infof("new changes published: %s", url) } diff --git a/pkg/config/env.go b/pkg/config/env.go index 44c40578..3165dfb2 100644 --- a/pkg/config/env.go +++ b/pkg/config/env.go @@ -20,6 +20,7 @@ var RECIPES_DIR = path.Join(ABRA_DIR, "recipes") var VENDOR_DIR = path.Join(ABRA_DIR, "vendor") var RECIPES_JSON = path.Join(ABRA_DIR, "catalogue", "recipes.json") var REPOS_BASE_URL = "https://git.coopcloud.tech/coop-cloud" +var CATALOGUE_JSON_REPO_NAME = "recipes-catalogue-json" var SSH_URL_TEMPLATE = "ssh://git@git.coopcloud.tech:2222/coop-cloud/%s.git" // GetServers retrieves all servers. diff --git a/pkg/recipe/recipe.go b/pkg/recipe/recipe.go index 4f18f8bf..e404ad92 100644 --- a/pkg/recipe/recipe.go +++ b/pkg/recipe/recipe.go @@ -1054,7 +1054,7 @@ func GetRecipeCatalogueVersions(recipeName string, catl RecipeCatalogue) ([]stri func EnsureCatalogue() error { catalogueDir := path.Join(config.ABRA_DIR, "catalogue") if _, err := os.Stat(catalogueDir); err != nil && os.IsNotExist(err) { - url := fmt.Sprintf("%s/%s.git", config.REPOS_BASE_URL, "recipes") + url := fmt.Sprintf("%s/%s.git", config.REPOS_BASE_URL, config.CATALOGUE_JSON_REPO_NAME) if err := gitPkg.Clone(catalogueDir, url); err != nil { return err }