fix: coop-cloud
-> toolshed
This commit is contained in:
parent
d2931e3af0
commit
81cdc843ec
@ -10,7 +10,7 @@ steps:
|
|||||||
- name: make test
|
- name: make test
|
||||||
image: golang:1.22
|
image: golang:1.22
|
||||||
environment:
|
environment:
|
||||||
CATL_URL: https://git.coopcloud.tech/coop-cloud/recipes-catalogue-json.git
|
CATL_URL: https://git.coopcloud.tech/toolshed/recipes-catalogue-json.git
|
||||||
commands:
|
commands:
|
||||||
- mkdir -p $HOME/.abra
|
- mkdir -p $HOME/.abra
|
||||||
- git clone $CATL_URL $HOME/.abra/catalogue
|
- git clone $CATL_URL $HOME/.abra/catalogue
|
||||||
@ -50,7 +50,7 @@ steps:
|
|||||||
username: 3wordchant
|
username: 3wordchant
|
||||||
password:
|
password:
|
||||||
from_secret: git_coopcloud_tech_token_3wc
|
from_secret: git_coopcloud_tech_token_3wc
|
||||||
repo: git.coopcloud.tech/coop-cloud/abra
|
repo: git.coopcloud.tech/toolshed/abra
|
||||||
tags: dev
|
tags: dev
|
||||||
registry: git.coopcloud.tech
|
registry: git.coopcloud.tech
|
||||||
when:
|
when:
|
||||||
@ -74,7 +74,7 @@ steps:
|
|||||||
request_pty: true
|
request_pty: true
|
||||||
script:
|
script:
|
||||||
- |
|
- |
|
||||||
wget https://git.coopcloud.tech/coop-cloud/abra/raw/branch/main/scripts/tests/run-ci-int -O run-ci-int
|
wget https://git.coopcloud.tech/toolshed/abra/raw/branch/main/scripts/tests/run-ci-int -O run-ci-int
|
||||||
chmod +x run-ci-int
|
chmod +x run-ci-int
|
||||||
sh run-ci-int
|
sh run-ci-int
|
||||||
when:
|
when:
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# `abra`
|
# `abra`
|
||||||
|
|
||||||
[](https://build.coopcloud.tech/coop-cloud/abra)
|
[](https://build.coopcloud.tech/toolshed/abra)
|
||||||
[](https://goreportcard.com/report/git.coopcloud.tech/coop-cloud/abra)
|
[](https://goreportcard.com/report/git.coopcloud.tech/toolshed/abra)
|
||||||
[](https://pkg.go.dev/coopcloud.tech/abra)
|
[](https://pkg.go.dev/coopcloud.tech/abra)
|
||||||
|
|
||||||
The Co-op Cloud utility belt 🎩🐇
|
The Co-op Cloud utility belt 🎩🐇
|
||||||
|
@ -13,7 +13,7 @@ func TestParseCmdArgs(t *testing.T) {
|
|||||||
}{
|
}{
|
||||||
// `--` is not parsed when passed in from the command-line e.g. -- foo bar baz
|
// `--` is not parsed when passed in from the command-line e.g. -- foo bar baz
|
||||||
// so we need to eumlate that as missing when testing if bash args are passed in
|
// so we need to eumlate that as missing when testing if bash args are passed in
|
||||||
// see https://git.coopcloud.tech/coop-cloud/organising/issues/336 for more
|
// see https://git.coopcloud.tech/toolshed/organising/issues/336 for more
|
||||||
{[]string{"foo.com", "app", "test"}, false, ""},
|
{[]string{"foo.com", "app", "test"}, false, ""},
|
||||||
{[]string{"foo.com", "app", "test", "foo"}, true, "foo "},
|
{[]string{"foo.com", "app", "test", "foo"}, true, "foo "},
|
||||||
{[]string{"foo.com", "app", "test", "foo", "bar", "baz"}, true, "foo bar baz "},
|
{[]string{"foo.com", "app", "test", "foo", "bar", "baz"}, true, "foo bar baz "},
|
||||||
|
@ -168,7 +168,7 @@ keys configured on your account.`,
|
|||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
sshURL := fmt.Sprintf(config.SSH_URL_TEMPLATE, config.CATALOGUE_JSON_REPO_NAME)
|
sshURL := fmt.Sprintf(config.TOOLSHED_SSH_URL_TEMPLATE, config.CATALOGUE_JSON_REPO_NAME)
|
||||||
if err := gitPkg.CreateRemote(repo, "origin-ssh", sshURL, internal.Dry); err != nil {
|
if err := gitPkg.CreateRemote(repo, "origin-ssh", sshURL, internal.Dry); err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
@ -97,16 +97,17 @@ func (a Abra) GetCatalogueDir() string { return path.Join(a.GetAbraDir(), "catal
|
|||||||
var config = LoadAbraConfig()
|
var config = LoadAbraConfig()
|
||||||
|
|
||||||
var (
|
var (
|
||||||
ABRA_DIR = config.GetAbraDir()
|
ABRA_DIR = config.GetAbraDir()
|
||||||
SERVERS_DIR = config.GetServersDir()
|
SERVERS_DIR = config.GetServersDir()
|
||||||
RECIPES_DIR = config.GetRecipesDir()
|
RECIPES_DIR = config.GetRecipesDir()
|
||||||
VENDOR_DIR = config.GetVendorDir()
|
VENDOR_DIR = config.GetVendorDir()
|
||||||
BACKUP_DIR = config.GetBackupDir()
|
BACKUP_DIR = config.GetBackupDir()
|
||||||
CATALOGUE_DIR = config.GetCatalogueDir()
|
CATALOGUE_DIR = config.GetCatalogueDir()
|
||||||
RECIPES_JSON = path.Join(config.GetCatalogueDir(), "recipes.json")
|
RECIPES_JSON = path.Join(config.GetCatalogueDir(), "recipes.json")
|
||||||
REPOS_BASE_URL = "https://git.coopcloud.tech/coop-cloud"
|
REPOS_BASE_URL = "https://git.coopcloud.tech/coop-cloud"
|
||||||
CATALOGUE_JSON_REPO_NAME = "recipes-catalogue-json"
|
CATALOGUE_JSON_REPO_NAME = "recipes-catalogue-json"
|
||||||
SSH_URL_TEMPLATE = "ssh://git@git.coopcloud.tech:2222/coop-cloud/%s.git"
|
TOOLSHED_SSH_URL_TEMPLATE = "ssh://git@git.coopcloud.tech:2222/toolshed/%s.git"
|
||||||
|
RECIPES_SSH_URL_TEMPLATE = "ssh://git@git.coopcloud.tech:2222/coop-cloud/%s.git"
|
||||||
|
|
||||||
// NOTE(d1): please note, this was done purely out of laziness on our part
|
// NOTE(d1): please note, this was done purely out of laziness on our part
|
||||||
// AFAICR. it's easy to punt the value into the label because that is what is
|
// AFAICR. it's easy to punt the value into the label because that is what is
|
||||||
|
@ -8,7 +8,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"coopcloud.tech/abra/pkg/log"
|
"coopcloud.tech/abra/pkg/log"
|
||||||
"git.coopcloud.tech/coop-cloud/godotenv"
|
"git.coopcloud.tech/toolshed/godotenv"
|
||||||
)
|
)
|
||||||
|
|
||||||
// envVarModifiers is a list of env var modifier strings. These are added to
|
// envVarModifiers is a list of env var modifier strings. These are added to
|
||||||
|
@ -150,7 +150,7 @@ func Get(name string) Recipe {
|
|||||||
}
|
}
|
||||||
|
|
||||||
gitURL := fmt.Sprintf("%s/%s.git", config.REPOS_BASE_URL, name)
|
gitURL := fmt.Sprintf("%s/%s.git", config.REPOS_BASE_URL, name)
|
||||||
sshURL := fmt.Sprintf(config.SSH_URL_TEMPLATE, name)
|
sshURL := fmt.Sprintf(config.RECIPES_SSH_URL_TEMPLATE, name)
|
||||||
if strings.Contains(name, "/") {
|
if strings.Contains(name, "/") {
|
||||||
u, err := url.Parse(name)
|
u, err := url.Parse(name)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -21,8 +21,8 @@ func TestGet(t *testing.T) {
|
|||||||
recipe: Recipe{
|
recipe: Recipe{
|
||||||
Name: "foo",
|
Name: "foo",
|
||||||
Dir: path.Join(cfg.GetAbraDir(), "/recipes/foo"),
|
Dir: path.Join(cfg.GetAbraDir(), "/recipes/foo"),
|
||||||
GitURL: "https://git.coopcloud.tech/coop-cloud/foo.git",
|
GitURL: "https://git.coopcloud.tech/toolshed/foo.git",
|
||||||
SSHURL: "ssh://git@git.coopcloud.tech:2222/coop-cloud/foo.git",
|
SSHURL: "ssh://git@git.coopcloud.tech:2222/toolshed/foo.git",
|
||||||
ComposePath: path.Join(cfg.GetAbraDir(), "recipes/foo/compose.yml"),
|
ComposePath: path.Join(cfg.GetAbraDir(), "recipes/foo/compose.yml"),
|
||||||
ReadmePath: path.Join(cfg.GetAbraDir(), "recipes/foo/README.md"),
|
ReadmePath: path.Join(cfg.GetAbraDir(), "recipes/foo/README.md"),
|
||||||
SampleEnvPath: path.Join(cfg.GetAbraDir(), "recipes/foo/.env.sample"),
|
SampleEnvPath: path.Join(cfg.GetAbraDir(), "recipes/foo/.env.sample"),
|
||||||
@ -35,8 +35,8 @@ func TestGet(t *testing.T) {
|
|||||||
Name: "foo",
|
Name: "foo",
|
||||||
EnvVersion: "1.2.3",
|
EnvVersion: "1.2.3",
|
||||||
Dir: path.Join(cfg.GetAbraDir(), "/recipes/foo"),
|
Dir: path.Join(cfg.GetAbraDir(), "/recipes/foo"),
|
||||||
GitURL: "https://git.coopcloud.tech/coop-cloud/foo.git",
|
GitURL: "https://git.coopcloud.tech/toolshed/foo.git",
|
||||||
SSHURL: "ssh://git@git.coopcloud.tech:2222/coop-cloud/foo.git",
|
SSHURL: "ssh://git@git.coopcloud.tech:2222/toolshed/foo.git",
|
||||||
ComposePath: path.Join(cfg.GetAbraDir(), "recipes/foo/compose.yml"),
|
ComposePath: path.Join(cfg.GetAbraDir(), "recipes/foo/compose.yml"),
|
||||||
ReadmePath: path.Join(cfg.GetAbraDir(), "recipes/foo/README.md"),
|
ReadmePath: path.Join(cfg.GetAbraDir(), "recipes/foo/README.md"),
|
||||||
SampleEnvPath: path.Join(cfg.GetAbraDir(), "recipes/foo/.env.sample"),
|
SampleEnvPath: path.Join(cfg.GetAbraDir(), "recipes/foo/.env.sample"),
|
||||||
@ -100,7 +100,7 @@ func TestGetVersionLabelLocalDoesNotUseTimeoutLabel(t *testing.T) {
|
|||||||
// returns it. hopefully this won't fail too often! if you're here because
|
// returns it. hopefully this won't fail too often! if you're here because
|
||||||
// of a failure, just update the `defaultTimeoutLabel` value & permalink
|
// of a failure, just update the `defaultTimeoutLabel` value & permalink
|
||||||
// below
|
// below
|
||||||
// https://git.coopcloud.tech/coop-cloud/traefik/src/commit/ac3a47fe8ca3ef92db84f64cfedfbb348000faee/.env.sample#L2
|
// https://git.coopcloud.tech/toolshed/traefik/src/commit/ac3a47fe8ca3ef92db84f64cfedfbb348000faee/.env.sample#L2
|
||||||
defaultTimeoutLabel := "300"
|
defaultTimeoutLabel := "300"
|
||||||
assert.NotEqual(t, label, defaultTimeoutLabel)
|
assert.NotEqual(t, label, defaultTimeoutLabel)
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
ABRA_VERSION="0.9.0-beta"
|
ABRA_VERSION="0.9.0-beta"
|
||||||
ABRA_RELEASE_URL="https://git.coopcloud.tech/api/v1/repos/coop-cloud/abra/releases/tags/$ABRA_VERSION"
|
ABRA_RELEASE_URL="https://git.coopcloud.tech/api/v1/repos/toolshed/abra/releases/tags/$ABRA_VERSION"
|
||||||
RC_VERSION="0.8.0-rc1-beta"
|
RC_VERSION="0.8.0-rc1-beta"
|
||||||
RC_VERSION_URL="https://git.coopcloud.tech/api/v1/repos/coop-cloud/abra/releases/tags/$RC_VERSION"
|
RC_VERSION_URL="https://git.coopcloud.tech/api/v1/repos/toolshed/abra/releases/tags/$RC_VERSION"
|
||||||
|
|
||||||
for arg in "$@"; do
|
for arg in "$@"; do
|
||||||
if [ "$arg" == "--rc" ]; then
|
if [ "$arg" == "--rc" ]; then
|
||||||
@ -40,7 +40,7 @@ function install_abra_release {
|
|||||||
if ! type "wget" > /dev/null 2>&1; then
|
if ! type "wget" > /dev/null 2>&1; then
|
||||||
echo "'wget' is not installed, cannot proceed..."
|
echo "'wget' is not installed, cannot proceed..."
|
||||||
echo "perhaps try installing manually via the releases URL?"
|
echo "perhaps try installing manually via the releases URL?"
|
||||||
echo "https://git.coopcloud.tech/coop-cloud/abra/releases"
|
echo "https://git.coopcloud.tech/toolshed/abra/releases"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ echo "========================================================================"
|
|||||||
echo "CLONING ABRA"
|
echo "CLONING ABRA"
|
||||||
echo "========================================================================"
|
echo "========================================================================"
|
||||||
rm -rf abra
|
rm -rf abra
|
||||||
git clone ssh://git@git.coopcloud.tech:2222/coop-cloud/abra.git
|
git clone ssh://git@git.coopcloud.tech:2222/toolshed/abra.git
|
||||||
cd abra
|
cd abra
|
||||||
git checkout main
|
git checkout main
|
||||||
echo "========================================================================"
|
echo "========================================================================"
|
||||||
|
@ -27,18 +27,18 @@ teardown(){
|
|||||||
|
|
||||||
# bats test_tags=slow
|
# bats test_tags=slow
|
||||||
@test "deploy remote recipe" {
|
@test "deploy remote recipe" {
|
||||||
run sed -i 's/TYPE=abra-test-recipe:.*/TYPE=git.coopcloud.tech\/coop-cloud\/abra-test-recipe/g' \
|
run sed -i 's/TYPE=abra-test-recipe:.*/TYPE=git.coopcloud.tech\/toolshed\/abra-test-recipe/g' \
|
||||||
"$ABRA_DIR/servers/$TEST_SERVER/$TEST_APP_DOMAIN.env"
|
"$ABRA_DIR/servers/$TEST_SERVER/$TEST_APP_DOMAIN.env"
|
||||||
assert_success
|
assert_success
|
||||||
|
|
||||||
run $ABRA app deploy "$TEST_APP_DOMAIN" --no-input --no-converge-checks
|
run $ABRA app deploy "$TEST_APP_DOMAIN" --no-input --no-converge-checks
|
||||||
assert_success
|
assert_success
|
||||||
assert_output --partial "git.coopcloud.tech/coop-cloud/abra-test-recipe"
|
assert_output --partial "git.coopcloud.tech/toolshed/abra-test-recipe"
|
||||||
}
|
}
|
||||||
|
|
||||||
# bats test_tags=slow
|
# bats test_tags=slow
|
||||||
@test "deploy remote recipe with version" {
|
@test "deploy remote recipe with version" {
|
||||||
run sed -i 's/TYPE=abra-test-recipe:.*/TYPE=git.coopcloud.tech\/coop-cloud\/abra-test-recipe:0.2.0+1.21.0/g' \
|
run sed -i 's/TYPE=abra-test-recipe:.*/TYPE=git.coopcloud.tech\/toolshed\/abra-test-recipe:0.2.0+1.21.0/g' \
|
||||||
"$ABRA_DIR/servers/$TEST_SERVER/$TEST_APP_DOMAIN.env"
|
"$ABRA_DIR/servers/$TEST_SERVER/$TEST_APP_DOMAIN.env"
|
||||||
assert_success
|
assert_success
|
||||||
|
|
||||||
@ -49,7 +49,7 @@ teardown(){
|
|||||||
|
|
||||||
# bats test_tags=slow
|
# bats test_tags=slow
|
||||||
@test "deploy remote recipe with chaos commit" {
|
@test "deploy remote recipe with chaos commit" {
|
||||||
run sed -i 's/TYPE=abra-test-recipe:.*/TYPE=git.coopcloud.tech\/coop-cloud\/abra-test-recipe:1e83340e/g' \
|
run sed -i 's/TYPE=abra-test-recipe:.*/TYPE=git.coopcloud.tech\/toolshed\/abra-test-recipe:1e83340e/g' \
|
||||||
"$ABRA_DIR/servers/$TEST_SERVER/$TEST_APP_DOMAIN.env"
|
"$ABRA_DIR/servers/$TEST_SERVER/$TEST_APP_DOMAIN.env"
|
||||||
assert_success
|
assert_success
|
||||||
|
|
||||||
@ -60,14 +60,14 @@ teardown(){
|
|||||||
|
|
||||||
# bats test_tags=slow
|
# bats test_tags=slow
|
||||||
@test "remote recipe version written to env" {
|
@test "remote recipe version written to env" {
|
||||||
run sed -i 's/TYPE=abra-test-recipe:.*/TYPE=git.coopcloud.tech\/coop-cloud\/abra-test-recipe/g' \
|
run sed -i 's/TYPE=abra-test-recipe:.*/TYPE=git.coopcloud.tech\/toolshed\/abra-test-recipe/g' \
|
||||||
"$ABRA_DIR/servers/$TEST_SERVER/$TEST_APP_DOMAIN.env"
|
"$ABRA_DIR/servers/$TEST_SERVER/$TEST_APP_DOMAIN.env"
|
||||||
assert_success
|
assert_success
|
||||||
|
|
||||||
run $ABRA app deploy "$TEST_APP_DOMAIN" --no-input --no-converge-checks
|
run $ABRA app deploy "$TEST_APP_DOMAIN" --no-input --no-converge-checks
|
||||||
assert_success
|
assert_success
|
||||||
|
|
||||||
run grep -q "TYPE=git.coopcloud.tech\/coop-cloud\/abra-test-recipe:$(_latest_release)" \
|
run grep -q "TYPE=git.coopcloud.tech\/toolshed\/abra-test-recipe:$(_latest_release)" \
|
||||||
"$ABRA_DIR/servers/$TEST_SERVER/$TEST_APP_DOMAIN.env"
|
"$ABRA_DIR/servers/$TEST_SERVER/$TEST_APP_DOMAIN.env"
|
||||||
assert_success
|
assert_success
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@ _fetch_recipe() {
|
|||||||
run mkdir -p "$ABRA_DIR/recipes"
|
run mkdir -p "$ABRA_DIR/recipes"
|
||||||
assert_success
|
assert_success
|
||||||
|
|
||||||
run git clone "https://git.coopcloud.tech/coop-cloud/$TEST_RECIPE" "$ABRA_DIR/recipes/$TEST_RECIPE"
|
run git clone "https://git.coopcloud.tech/toolshed/$TEST_RECIPE" "$ABRA_DIR/recipes/$TEST_RECIPE"
|
||||||
assert_success
|
assert_success
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@ -33,7 +33,7 @@ _ensure_latest_version(){
|
|||||||
|
|
||||||
_ensure_catalogue(){
|
_ensure_catalogue(){
|
||||||
if [[ ! -d "$ABRA_DIR/catalogue" ]]; then
|
if [[ ! -d "$ABRA_DIR/catalogue" ]]; then
|
||||||
run git clone https://git.coopcloud.tech/coop-cloud/recipes-catalogue-json.git $ABRA_DIR/catalogue
|
run git clone https://git.coopcloud.tech/toolshed/recipes-catalogue-json.git $ABRA_DIR/catalogue
|
||||||
assert_success
|
assert_success
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user