From 19a3d52995731176841f16ceb0ff26b29a389bc0 Mon Sep 17 00:00:00 2001 From: Tim Nelson Date: Fri, 22 Nov 2024 15:32:26 +1100 Subject: [PATCH] Separated example files so that the new parameters only appear in a new separate example file --- createDumpSanitisedDB.gql | 54 +-------- createDumpSanitisedDB_setDBVariables.gql | 134 +++++++++++++++++++++++ 2 files changed, 135 insertions(+), 53 deletions(-) create mode 100644 createDumpSanitisedDB_setDBVariables.gql diff --git a/createDumpSanitisedDB.gql b/createDumpSanitisedDB.gql index e0aebec..217b8fc 100644 --- a/createDumpSanitisedDB.gql +++ b/createDumpSanitisedDB.gql @@ -62,59 +62,7 @@ mutation createDumpSanitisedDB { displayName: "OPTIONAL: if you want to provide an organization base for the backup image name to parse", type: STRING optional: true - }, - # Database hostname - { - name: "BUILDER_MTK_DUMP_HOSTNAME", - displayName: "OPTIONAL: The database hostname you want to use", - type: STRING - optional: true - }, - { - name: "BUILDER_MTK_DUMP_HOSTNAME_NAME", - displayName: "OPTIONAL: The name of the variable that contains the database hostname you want to use", - type: STRING - optional: true - }, - # Database name - { - name: "BUILDER_MTK_DUMP_DATABASE", - displayName: "OPTIONAL: The database name you want to use", - type: STRING - optional: true - }, - { - name: "BUILDER_MTK_DUMP_DATABASE_NAME", - displayName: "OPTIONAL: The name of the variable that contains the database name you want to use", - type: STRING - optional: true - }, - # Database username - { - name: "BUILDER_MTK_DUMP_USERNAME", - displayName: "OPTIONAL: The database username you want to use", - type: STRING - optional: true - }, - { - name: "BUILDER_MTK_DUMP_USERNAME_NAME", - displayName: "OPTIONAL: The name of the variable that contains the database username you want to use", - type: STRING - optional: true - }, - # Database password - { - name: "BUILDER_MTK_DUMP_PASSWORD", - displayName: "OPTIONAL: The database password you want to use", - type: STRING - optional: true - }, - { - name: "BUILDER_MTK_DUMP_PASSWORD_NAME", - displayName: "OPTIONAL: The name of the variable that contains the database password you want to use", - type: STRING - optional: true - }, + } ] } ){ diff --git a/createDumpSanitisedDB_setDBVariables.gql b/createDumpSanitisedDB_setDBVariables.gql new file mode 100644 index 0000000..ea336ab --- /dev/null +++ b/createDumpSanitisedDB_setDBVariables.gql @@ -0,0 +1,134 @@ +mutation createDumpSanitisedDB { + addAdvancedTaskDefinition( + input:{ + name: "Sanitised Database Image Build" + description: "Test making a sanitised database dump image" + confirmationText: "Are you sure you wish to create a sanitised database dump now?" + type: IMAGE + permission: MAINTAINER + image: "uselagoon/database-image-task:v0.0.1" + project: 123 + advancedTaskDefinitionArguments: [ + { + name: "BUILDER_DOCKER_COMPOSE_SERVICE_NAME", + displayName: "OPTIONAL: The name of the docker-compose service to backup (defaults to mariadb)", + type: STRING + optional: true + }, + { + name: "BUILDER_BACKUP_IMAGE_NAME", + displayName: "The name of the resulting image to build without tag (eg, for dockerhub myproject/image, or for custom registry quay.io/myproject/image, can also be a pattern like '${registry}/${organization}/${project}/${environment}/${service}-data')", + type: STRING + # defaultValue: "${registry}/${organization}/${project}/${environment}/${service}-data" + }, + { + name: "BUILDER_IMAGE_NAME", + displayName: "OPTIONAL: The name of the builder source image to do the initial db import (defaults to mariadb:10.6)", + type: STRING + optional: true + }, + { + name: "BUILDER_CLEAN_IMAGE_NAME", + displayName: "OPTIONAL: The name of the clean source image that will be built into (defaults to uselagoon/mariadb-10.6-drupal:latest)", + type: STRING + optional: true + }, + { + name: "BUILDER_MTK_YAML_BASE64", + displayName: "OPTIONAL: The base64 encoded value of the mtk dump file to use (defaults to no config)", + type: STRING + optional: true + }, + { + name: "BUILDER_REGISTRY_USERNAME", + displayName: "The username to log in to registry with", + type: STRING + # defaultValue: "username" + }, + { + name: "BUILDER_REGISTRY_PASSWORD", + displayName: "The password to log in to registry with", + type: STRING + # defaultValue: "password" + }, + { + name: "BUILDER_REGISTRY_HOST", + displayName: "OPTIONAL: If not using dockerhub, define the registry to use (eg quay.io)", + type: STRING + optional: true + }, + { + name: "BUILDER_REGISTRY_ORGANIZATION", + displayName: "OPTIONAL: if you want to provide an organization base for the backup image name to parse", + type: STRING + optional: true + }, + # Database hostname + { + name: "BUILDER_MTK_DUMP_HOSTNAME", + displayName: "OPTIONAL: The database hostname you want to use", + type: STRING + optional: true + }, + { + name: "BUILDER_MTK_DUMP_HOSTNAME_NAME", + displayName: "OPTIONAL: The name of the variable that contains the database hostname you want to use", + type: STRING + optional: true + }, + # Database name + { + name: "BUILDER_MTK_DUMP_DATABASE", + displayName: "OPTIONAL: The database name you want to use", + type: STRING + optional: true + }, + { + name: "BUILDER_MTK_DUMP_DATABASE_NAME", + displayName: "OPTIONAL: The name of the variable that contains the database name you want to use", + type: STRING + optional: true + }, + # Database username + { + name: "BUILDER_MTK_DUMP_USERNAME", + displayName: "OPTIONAL: The database username you want to use", + type: STRING + optional: true + }, + { + name: "BUILDER_MTK_DUMP_USERNAME_NAME", + displayName: "OPTIONAL: The name of the variable that contains the database username you want to use", + type: STRING + optional: true + }, + # Database password + { + name: "BUILDER_MTK_DUMP_PASSWORD", + displayName: "OPTIONAL: The database password you want to use", + type: STRING + optional: true + }, + { + name: "BUILDER_MTK_DUMP_PASSWORD_NAME", + displayName: "OPTIONAL: The name of the variable that contains the database password you want to use", + type: STRING + optional: true + } + ] + } + ){ + ... on AdvancedTaskDefinitionImage { + id + name + description + image + confirmationText + advancedTaskDefinitionArguments { + type + name + displayName + } + } + } +}