From a4f15fb1379f3b02a576372a2ca7c6989c0c372a Mon Sep 17 00:00:00 2001 From: Nariman Abdullin Date: Wed, 6 Sep 2023 17:11:07 +0300 Subject: [PATCH] Added copying files to minio for local run (#2557) - added a new service to copy files to minio on start --- .../buildutils/DockerStackConfiguration.kt | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/buildSrc/src/main/kotlin/com/saveourtool/save/buildutils/DockerStackConfiguration.kt b/buildSrc/src/main/kotlin/com/saveourtool/save/buildutils/DockerStackConfiguration.kt index a050863315..7dc0c47939 100644 --- a/buildSrc/src/main/kotlin/com/saveourtool/save/buildutils/DockerStackConfiguration.kt +++ b/buildSrc/src/main/kotlin/com/saveourtool/save/buildutils/DockerStackConfiguration.kt @@ -159,6 +159,23 @@ fun Project.createStackDeployTask(profile: String) { | MINIO_ROOT_USER: admin | MINIO_ROOT_PASSWORD: adminadmin | + | minio-startup: + | image: minio/mc:latest + | depends_on: + | - minio + | entrypoint: + | - /bin/sh + | - -c + | - | + | /usr/bin/mc alias set minio http://minio:9000 admin adminadmin + | /usr/bin/mc mb --ignore-existing minio/cnb + | /usr/bin/mc policy set public minio/cnb + | /usr/bin/mc cp --recursive /data/ minio/cnb/cnb/files + | volumes: + | - type: bind + | source: ${project.rootProject.layout.projectDirectory.asFile}/save-backend/src/test/resources/minio + | target: /data + | |${declareDexService().prependIndent(" ")} """.trimMargin() } else if (profile == "dev" && it.trim().startsWith("logging:")) { @@ -272,7 +289,7 @@ fun Project.createStackDeployTask(profile: String) { dependsOn(kafkaTaskName) } - val minioTaskName = registerService("minio", MINIO_STARTUP_DELAY_MILLIS) + val minioTaskName = registerService("minio-startup", MINIO_STARTUP_DELAY_MILLIS, "startMinioService") tasks.register("startMinio") { dependsOn(minioTaskName) }