Skip to content

Commit

Permalink
fixes merge issue
Browse files Browse the repository at this point in the history
  • Loading branch information
bomoko committed Aug 23, 2022
1 parent bc963c4 commit 1ca44d6
Show file tree
Hide file tree
Showing 2 changed files with 97 additions and 3 deletions.
28 changes: 25 additions & 3 deletions cmd/sync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,34 @@ func Test_syncCommandRun(t *testing.T) {
},
},
runSyncProcess: func(sourceEnvironment synchers.Environment, targetEnvironment synchers.Environment, lagoonSyncer synchers.Syncer, syncerType string, dryRun bool, sshOptions synchers.SSHOptions) error {
if sshOptions.Port != "3222" {
return errors.New(fmt.Sprintf("Expecting ssh port 3222 - found: %v", sshOptions.Port))
if sshOptions.Port != "32222" {
return errors.New(fmt.Sprintf("Expecting ssh port 32222 - found: %v", sshOptions.Port))
}

if sshOptions.Host != "ssh.lagoon.amazeeio.cloud" {
return errors.New(fmt.Sprintf("Expecting ssh host ssh.lagoon.amazeeio.cloud - found: %v", sshOptions.Port))
return errors.New(fmt.Sprintf("Expecting ssh host ssh.lagoon.amazeeio.cloud - found: %v", sshOptions.Host))
}

return nil
},
wantsError: false,
},
{
name: "Tests Lagoon yaml",
lagoonYmlFile: "../test-resources/sync-test/tests-lagoon-yml/.lagoon.yml",
args: args{
cmd: nil,
args: []string{
"mariadb",
},
},
runSyncProcess: func(sourceEnvironment synchers.Environment, targetEnvironment synchers.Environment, lagoonSyncer synchers.Syncer, syncerType string, dryRun bool, sshOptions synchers.SSHOptions) error {
if sshOptions.Port != "777" {
return errors.New(fmt.Sprintf("Expecting ssh port 777 - found: %v", sshOptions.Port))
}

if sshOptions.Host != "example.ssh.lagoon.amazeeio.cloud" {
return errors.New(fmt.Sprintf("Expecting ssh host ssh.lagoon.amazeeio.cloud - found: %v", sshOptions.Host))
}

return nil
Expand Down
72 changes: 72 additions & 0 deletions test-resources/sync-test/tests-lagoon-yml/.lagoon.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Example .lagoon.yml file with lagoon-sync config added which is used by the sync tool.
docker-compose-yaml: docker-compose.yml

project: "lagoon-sync"

lagoon-sync:
ssh:
host: "example.ssh.lagoon.amazeeio.cloud"
port: "777"
privateKey: "~/.ssh/example_id_rsa"
verbose: true
mariadb:
config:
hostname: "$MARIADB_HOST"
username: "$MARIADB_USERNAME"
password: "$MARIADB_PASSWORD"
port: "$MARIADB_PORT"
database: "$MARIADB_DATABASE"
ignore-table:
- "table_to_ignore"
ignore-table-data:
- "cache_data"
- "cache_menu"
local:
config:
hostname: "mariadb"
username: "drupal"
password: "drupal"
port: "3306"
database: "drupal"
postgres:
config:
hostname: "$POSTGRES_HOST"
username: "$POSTGRES_USERNAME"
password: "$POSTGRES_PASSWORD"
port: "5432"
database: "$POSTGRES_DATABASE"
exclude-table:
- "table_to_ignore"
exclude-table-data:
- "cache_data"
- "cache_menu"
local:
config:
hostname: "postgres"
username: "drupal"
password: "drupal"
port: "3306"
database: "drupal"
mongodb:
config:
hostname: "$MONGODB_HOST"
port: "$MONGODB_SERVICE_PORT"
database: "MONGODB_DATABASE"
local:
config:
hostname: "$MONGODB_HOST"
port: "27017"
database: "local"
files:
config:
sync-directory: "/app/web/sites/default/files"
local:
config:
sync-directory: "/app/web/sites/default/files"
drupalconfig:
config:
syncpath: "./config/sync"
local:
overrides:
config:
syncpath: "./config/sync"

0 comments on commit 1ca44d6

Please sign in to comment.