-
Notifications
You must be signed in to change notification settings - Fork 151
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: add additional information to environment services
- Loading branch information
1 parent
d0983ad
commit 0fbaf59
Showing
14 changed files
with
449 additions
and
40 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
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
27 changes: 27 additions & 0 deletions
27
services/actions-handler/handler/example-payloads/builds/buildcomplete.json
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,27 @@ | ||
{ | ||
"type": "build", | ||
"namespace": "lagoon-demo-staging", | ||
"meta": { | ||
"buildName": "lagoon-build-wxcu6", | ||
"buildPhase": "complete", | ||
"buildStatus": "complete", | ||
"buildStep": "complete", | ||
"environment": "staging", | ||
"environmentId": 5, | ||
"logLink": "https://lagoon-ui.example.com/projects/example-com/example-com-main/deployments/lagoon-build-unmdse", | ||
"project": "lagoon-demo", | ||
"projectId": 18, | ||
"remoteId": "cf1af8da-4988-4a00-b579-5ce299cb6ae7", | ||
"route": "https://example.com", | ||
"routes": ["https://active.example.com", "https://example.com", "https://main.example.com", "https://nginx-example-com-main.example.com", "https://varnish-example-com-main.example.com"], | ||
"startTime": "2022-10-28 10:26:47", | ||
"environmentServices": [ | ||
{"name":"nginx", "type":"nginx-php-persistent", "containers":[{"name":"nginx"},{"name": "php"}]}, | ||
{"name":"redis", "type":"redis", "containers":[{"name":"redis"}]}, | ||
{"name":"varnish", "type":"varnish", "containers":[{"name":"varnish"}]}, | ||
{"name":"solr", "type":"solr-php-persistent", "containers":[{"name":"solr"}]}, | ||
{"name":"cli", "type":"cli-persistent", "containers":[{"name":"cli"}]} | ||
], | ||
"clusterName": "cluster-01" | ||
} | ||
} |
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
32 changes: 32 additions & 0 deletions
32
services/api/database/migrations/20240124000000_environment_services.js
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,32 @@ | ||
/** | ||
* @param { import("knex").Knex } knex | ||
* @returns { Promise<void> } | ||
*/ | ||
exports.up = async function(knex) { | ||
return knex.schema | ||
.alterTable('environment_service', function (table) { | ||
table.string('type', 300); | ||
table.timestamp('updated').notNullable().defaultTo(knex.fn.now()); | ||
table.timestamp('created').notNullable().defaultTo(knex.fn.now()); | ||
table.unique(['name', 'environment'], {indexName: 'service_environment'}); | ||
}) | ||
.createTable('environment_service_container', function (table) { | ||
table.integer('service_id'); | ||
table.string('name', 300); | ||
table.unique(['service_id', 'name'], {indexName: 'service_container'}); | ||
}) | ||
}; | ||
|
||
/** | ||
* @param { import("knex").Knex } knex | ||
* @returns { Promise<void> } | ||
*/ | ||
exports.down = async function(knex) { | ||
return knex.schema | ||
.alterTable('environment_service', (table) => { | ||
table.dropColumn('type'); | ||
table.dropColumn('updated'); | ||
table.dropColumn('created'); | ||
}) | ||
.dropTable('service_container') | ||
}; |
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.