2023-01-30 03:27:11 -06:00
|
|
|
"""
|
|
|
|
This module has functions for Drone services to be used in pipelines.
|
|
|
|
"""
|
|
|
|
|
2023-06-12 08:41:18 -05:00
|
|
|
load(
|
|
|
|
"scripts/drone/utils/images.star",
|
|
|
|
"images",
|
|
|
|
)
|
|
|
|
|
2021-12-15 06:48:59 -06:00
|
|
|
def integration_test_services_volumes():
|
|
|
|
return [
|
2023-01-30 03:27:11 -06:00
|
|
|
{"name": "postgres", "temp": {"medium": "memory"}},
|
2023-05-04 12:42:48 -05:00
|
|
|
{"name": "mysql57", "temp": {"medium": "memory"}},
|
|
|
|
{"name": "mysql80", "temp": {"medium": "memory"}},
|
2022-12-07 01:13:57 -06:00
|
|
|
]
|
|
|
|
|
2023-04-05 03:55:55 -05:00
|
|
|
def integration_test_services():
|
2021-09-07 02:21:49 -05:00
|
|
|
services = [
|
|
|
|
{
|
2023-01-30 03:27:11 -06:00
|
|
|
"name": "postgres",
|
2023-09-12 10:19:06 -05:00
|
|
|
"image": images["postgres_alpine"],
|
2023-01-30 03:27:11 -06:00
|
|
|
"environment": {
|
|
|
|
"POSTGRES_USER": "grafanatest",
|
|
|
|
"POSTGRES_PASSWORD": "grafanatest",
|
|
|
|
"POSTGRES_DB": "grafanatest",
|
|
|
|
"PGDATA": "/var/lib/postgresql/data/pgdata",
|
2021-09-07 02:21:49 -05:00
|
|
|
},
|
2023-01-30 03:27:11 -06:00
|
|
|
"volumes": [
|
|
|
|
{"name": "postgres", "path": "/var/lib/postgresql/data/pgdata"},
|
2022-12-07 01:13:57 -06:00
|
|
|
],
|
2021-09-07 02:21:49 -05:00
|
|
|
},
|
|
|
|
{
|
2023-05-04 12:42:48 -05:00
|
|
|
"name": "mysql57",
|
2023-09-12 10:19:06 -05:00
|
|
|
"image": images["mysql5"],
|
2023-01-30 03:27:11 -06:00
|
|
|
"environment": {
|
|
|
|
"MYSQL_ROOT_PASSWORD": "rootpass",
|
|
|
|
"MYSQL_DATABASE": "grafana_tests",
|
|
|
|
"MYSQL_USER": "grafana",
|
|
|
|
"MYSQL_PASSWORD": "password",
|
2021-09-07 02:21:49 -05:00
|
|
|
},
|
2023-05-04 12:42:48 -05:00
|
|
|
"volumes": [{"name": "mysql57", "path": "/var/lib/mysql"}],
|
2023-06-14 18:00:45 -05:00
|
|
|
"commands": ["docker-entrypoint.sh mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci"],
|
2023-05-04 12:42:48 -05:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "mysql80",
|
2023-09-12 10:19:06 -05:00
|
|
|
"image": images["mysql8"],
|
2023-05-04 12:42:48 -05:00
|
|
|
"environment": {
|
|
|
|
"MYSQL_ROOT_PASSWORD": "rootpass",
|
|
|
|
"MYSQL_DATABASE": "grafana_tests",
|
|
|
|
"MYSQL_USER": "grafana",
|
|
|
|
"MYSQL_PASSWORD": "password",
|
|
|
|
},
|
|
|
|
"volumes": [{"name": "mysql80", "path": "/var/lib/mysql"}],
|
|
|
|
"commands": ["docker-entrypoint.sh mysqld --default-authentication-plugin=mysql_native_password"],
|
2021-09-07 02:21:49 -05:00
|
|
|
},
|
2023-10-05 13:09:26 -05:00
|
|
|
{
|
2023-10-17 05:21:45 -05:00
|
|
|
"name": "mimir_backend",
|
2023-10-05 13:09:26 -05:00
|
|
|
"image": images["mimir"],
|
|
|
|
"environment": {},
|
2024-01-22 08:25:50 -06:00
|
|
|
"commands": ["/bin/mimir -target=backend -alertmanager.grafana-alertmanager-compatibility-enabled"],
|
2023-10-05 13:09:26 -05:00
|
|
|
},
|
2023-04-05 03:55:55 -05:00
|
|
|
{
|
|
|
|
"name": "redis",
|
2023-09-12 10:19:06 -05:00
|
|
|
"image": images["redis_alpine"],
|
2023-04-05 03:55:55 -05:00
|
|
|
"environment": {},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "memcached",
|
2023-09-12 10:19:06 -05:00
|
|
|
"image": images["memcached_alpine"],
|
2023-04-05 03:55:55 -05:00
|
|
|
"environment": {},
|
|
|
|
},
|
2021-09-07 02:21:49 -05:00
|
|
|
]
|
|
|
|
|
|
|
|
return services
|
|
|
|
|
|
|
|
def ldap_service():
|
|
|
|
return {
|
2023-01-30 03:27:11 -06:00
|
|
|
"name": "ldap",
|
2023-09-12 10:19:06 -05:00
|
|
|
"image": images["openldap"],
|
2023-01-30 03:27:11 -06:00
|
|
|
"environment": {
|
|
|
|
"LDAP_ADMIN_PASSWORD": "grafana",
|
|
|
|
"LDAP_DOMAIN": "grafana.org",
|
|
|
|
"SLAPD_ADDITIONAL_MODULES": "memberof",
|
2021-09-07 02:21:49 -05:00
|
|
|
},
|
|
|
|
}
|