Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
5f184d4
Initial commit to create a new template which uses workflow commands …
jugal-chauhan Nov 18, 2025
2941c25
Initial commit to create a new template which uses workflow commands …
jugal-chauhan Nov 18, 2025
c807a6c
Add and run unit test
jugal-chauhan Nov 18, 2025
c0a83fb
Merge remote-tracking branch 'origin/main' into jenkins-k8s-local-test
jugal-chauhan Nov 18, 2025
3badc71
Merge remote-tracking branch 'origin/jenkins-k8s-local-test' into jen…
jugal-chauhan Nov 18, 2025
7332491
Add RetryParameters and combine scripts
jugal-chauhan Nov 18, 2025
758a7d7
create workflowtemplate for full migration with workflow cli commands
jugal-chauhan Nov 18, 2025
11664f0
Fixes on structure and syntax after testing
jugal-chauhan Nov 19, 2025
e1d7b9f
initial squashed commit after merging from main
jugal-chauhan Dec 4, 2025
a78e725
Resolve merge conflicts
jugal-chauhan Dec 4, 2025
aca5b2b
Resolving merge cionflicts again
jugal-chauhan Dec 4, 2025
cdaef2d
Resolving merge cionflicts again
jugal-chauhan Dec 4, 2025
31c30b8
Merge branch 'main' into jenkins-k8s-local-test
jugal-chauhan Dec 4, 2025
18ae56f
Merge remote-tracking branch 'origin/main' into jenkins-k8s-local-test
jugal-chauhan Dec 4, 2025
55aa4cf
clean up files
jugal-chauhan Dec 4, 2025
75a9517
refreshing snapshot files
jugal-chauhan Dec 4, 2025
c1142b1
update apply workflows to use the DSL generated ones
jugal-chauhan Dec 4, 2025
ad4709f
Merge branch 'main' into jenkins-k8s-local-test
jugal-chauhan Dec 4, 2025
e00f6c9
Cleanup changes and start to build back up fullMigrationWithClusters.…
AndreKurait Dec 4, 2025
1b29688
Revert changes from main on kafka authentication and package lock
AndreKurait Dec 4, 2025
2770fba
Remove change on package-lock
AndreKurait Dec 4, 2025
8f360ae
Restore changes not needed to change
AndreKurait Dec 4, 2025
5f597d9
Fix output and package-lock
AndreKurait Dec 4, 2025
ecd1bb6
Cleanup to move test migration scripts to resources folder
AndreKurait Dec 4, 2025
32aed57
Fix submit
AndreKurait Dec 4, 2025
125e336
Add in remaining params
AndreKurait Dec 4, 2025
ee0b621
Update monitor script to check for only migration workflow
AndreKurait Dec 4, 2025
bc57b08
add back in cluster workflows and update to align model
AndreKurait Dec 5, 2025
b2d1e44
Align fullMigrationWithClusters with new workflow cli spec
AndreKurait Dec 5, 2025
2ced9d1
Update config
AndreKurait Dec 5, 2025
f1af4e4
Update service to convert schemas
AndreKurait Dec 5, 2025
eaa456c
Update test logic with snapshotrepo
AndreKurait Dec 6, 2025
6d3e2d7
Update for working integ tests with fixes to approvals, sdk auth, wor…
AndreKurait Dec 7, 2025
4979aad
Lint and update migrationAssistantWithArgo templates
AndreKurait Dec 7, 2025
772c67c
Remove output dir from inputs
AndreKurait Dec 7, 2025
b634d78
Fix linting
AndreKurait Dec 7, 2025
f526bd5
Update dependent folders
AndreKurait Dec 7, 2025
088ea2f
Fix migrationConsole/build.gradle
AndreKurait Dec 7, 2025
8efa4b7
Reduce resource usage
AndreKurait Dec 7, 2025
e0f6957
Update testIds for elasticsearch5x test
AndreKurait Dec 8, 2025
cd10b8d
Increase testMigrationWithWorkflowCli duration
AndreKurait Dec 8, 2025
08de953
Increase timeout
AndreKurait Dec 8, 2025
6adfc80
Update jenkins to use minikube registry
AndreKurait Dec 8, 2025
3dd0115
Add Kyverno policies for dev environment resource management
AndreKurait Dec 9, 2025
b4e8920
Revert hardcoded resource request changes in schemaUtilities.ts
AndreKurait Dec 9, 2025
70c691e
Revert README-Minikube.md changes
AndreKurait Dec 9, 2025
1a7edba
Fix Kyverno policy deployment and image configuration for k8s integra…
AndreKurait Dec 9, 2025
5b1206e
Fix linting and update test snapshots
AndreKurait Dec 9, 2025
3e92092
Update Kyverno chart version to 3.5.2
AndreKurait Dec 10, 2025
af2621d
Use templated image values for Kyverno chart configuration
AndreKurait Dec 10, 2025
9965a26
Revert localTesting.sh changes except for helm --wait --timeout 10m
AndreKurait Dec 10, 2025
c812d52
Move image pullPolicy to valuesDev.yaml, remove always_pull_images op…
AndreKurait Dec 10, 2025
781090f
Revert backfill_rfs.py and test_backfill_rfs_queries.py to main
AndreKurait Dec 10, 2025
86911f0
Run all tests in elasticsearch5xK8sLocalTest, remove --always-pull-im…
AndreKurait Dec 10, 2025
f55bba9
Remove --always-pull-images from k8sMatrixTest.groovy
AndreKurait Dec 10, 2025
63b16be
Merge branch 'main' into k8s-integ
AndreKurait Dec 10, 2025
5b28392
Add audit annotations to Kyverno zero-resource-requests policy
AndreKurait Dec 10, 2025
ae1f7de
Add cleanup stage to delete MA registry before starting minikube tests
AndreKurait Dec 10, 2025
131e781
Add kubectl delete namespace before delete-only to avoid helm hook co…
AndreKurait Dec 10, 2025
30697a5
Simplify cleanup to just delete ma namespace
AndreKurait Dec 10, 2025
64368db
Add pipenv install --deploy before running E2E tests
AndreKurait Dec 10, 2025
6aa0106
Fix helm hook delete policy to prevent 'already exists' error on retry
AndreKurait Dec 10, 2025
671c71d
Fix kyverno cleanup job image registry concatenation
AndreKurait Dec 10, 2025
256631d
Improve Gradle build with lazy task configuration and incremental bui…
AndreKurait Dec 10, 2025
2f51876
Refactor Helm chart hook policies and Kyverno configuration
AndreKurait Dec 10, 2025
be34607
Update integration tests and workflow configurations
AndreKurait Dec 10, 2025
b0ca36e
Update NPM dependencies and fix optional dependencies
AndreKurait Dec 10, 2025
203e3c0
Add README documentation for Migration Assistant Helm chart
AndreKurait Dec 10, 2025
6bbafa9
Address Greg's review comments on PR #2032
AndreKurait Dec 10, 2025
92c0520
Fix x86/linux-x64 build failure by allowing optional npm dependencies
AndreKurait Dec 10, 2025
4727542
Add workflow status handlers and increase retry limit for test migrat…
AndreKurait Dec 10, 2025
b14ded7
Fix Gradle configuration cache serialization errors for Sync tasks
AndreKurait Dec 10, 2025
b65aa8b
Fix image reference pattern in fullMigrationWithClusters workflow
AndreKurait Dec 10, 2025
8740d6d
Fix cluster config validation error when no auth is specified
AndreKurait Dec 10, 2025
8a8779c
Remove implementation_plan.md
AndreKurait Dec 10, 2025
9693974
Remove developer_mode from testAutomation and migrationAssistantWithArgo
AndreKurait Dec 10, 2025
bc145f8
Update k8s integration test configurations and workflow templates
AndreKurait Dec 11, 2025
2da81b8
Update build configurations and workflow templates
AndreKurait Dec 11, 2025
9e533bc
Fix jq transformation to always remove name, proxy, snapshotRepo fields
AndreKurait Dec 11, 2025
0de1b52
Fix jq transformation to add no_auth when no auth config present
AndreKurait Dec 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions DocumentsFromSnapshotMigration/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ clean.doFirst {
delete dockerBuildDir
}

task copyDockerRuntimeJars (type: Sync) {
tasks.register('copyDockerRuntimeJars', Sync) {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
description = 'Copy runtime JARs and app jar to docker build directory'

Expand All @@ -84,6 +84,11 @@ task copyDockerRuntimeJars (type: Sync) {
from configurations.runtimeClasspath
from tasks.named('jar')
include '*.jar'

// Explicit inputs for incremental build support
inputs.files(configurations.runtimeClasspath)
inputs.files(tasks.named('jar'))
outputs.dir(buildDir)
}

DockerServiceProps[] dockerServices = [
Expand All @@ -94,7 +99,7 @@ DockerServiceProps[] dockerServices = [
] as DockerServiceProps[]

for (dockerService in dockerServices) {
task "buildDockerImage_${dockerService.projectName}" (type: DockerBuildImage) {
tasks.register("buildDockerImage_${dockerService.projectName}", DockerBuildImage) {
def hash = CommonUtils.calculateDockerHash(project.fileTree("docker/${dockerService.projectName}"))
for (dep in dockerService.taskDependencies) {
dependsOn dep
Expand All @@ -108,7 +113,7 @@ for (dockerService in dockerServices) {
}
}

task buildDockerImages {
tasks.register('buildDockerImages') {
for (dockerService in dockerServices) {
dependsOn "buildDockerImage_${dockerService.projectName}"
}
Expand Down
8 changes: 4 additions & 4 deletions RFS/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,28 @@ configurations {
lucene9
}

task shadowLucene5(type: com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) {
tasks.register('shadowLucene5', com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) {
mergeServiceFiles()
configurations = [project.configurations.lucene5]
archiveClassifier.set('lucene5-shadow')
relocate 'org.apache.lucene', 'shadow.lucene5.org.apache.lucene'
}

task shadowLucene6(type: com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) {
tasks.register('shadowLucene6', com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) {
mergeServiceFiles()
configurations = [project.configurations.lucene6]
archiveClassifier.set('lucene6-shadow')
relocate 'org.apache.lucene', 'shadow.lucene6.org.apache.lucene'
}

task shadowLucene7(type: com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) {
tasks.register('shadowLucene7', com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) {
mergeServiceFiles()
configurations = [project.configurations.lucene7]
archiveClassifier.set('lucene7-shadow')
relocate 'org.apache.lucene', 'shadow.lucene7.org.apache.lucene'
}

task shadowLucene9(type: com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) {
tasks.register('shadowLucene9', com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) {
mergeServiceFiles()
archiveClassifier.set('lucene9-shadow')
configurations = [project.configurations.lucene9]
Expand Down
33 changes: 26 additions & 7 deletions TrafficCapture/dockerSolution/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ dockerFilesForExternalServices.each { dockerImageName, projectName ->
// Now register the docker build task
tasks.register("buildDockerImage_${dockerImageName}", DockerBuildImage) {
if (projectName == migrationConsoleStagingDirName) {
// Depend on the base image from migrationConsole project
dependsOn ":migrationConsole:buildDockerImage_migrationConsoleBase"
CommonUtils.dependOnDockerImage(delegate, ":migrationConsole:buildDockerImage_migrationConsoleBase")
dependsOn syncTaskProvider

// Realize the task to get directory
Expand Down Expand Up @@ -91,15 +90,17 @@ static TaskProvider<Sync> getMigrationConsoleSyncTask(Project project, String do
from (lib.files { lib.configurations.runtimeClasspath }) {
into "${applicationDestDir}/lib"
}
from (lib.tasks.named('jar')) {
// Use map to get output files instead of task reference for configuration cache compatibility
from (lib.tasks.named('jar').map { it.outputs.files }) {
into "${applicationDestDir}/lib"
}
}

// Sync application start scripts
applications.each { app ->
def applicationDestDir = "staging/${app.name}/"
from (app.tasks.named('startScripts').get().outputs.files) {
// Use map to get output files instead of task reference for configuration cache compatibility
from (app.tasks.named('startScripts').map { it.outputs.files }) {
into "${applicationDestDir}/bin"
}
}
Expand All @@ -108,10 +109,28 @@ static TaskProvider<Sync> getMigrationConsoleSyncTask(Project project, String do
from (project.rootProject.layout.projectDirectory.file("VERSION"))

def sourceDirName = sourceDirectoryOverrides.get(projectName, projectName)
from(project.layout.projectDirectory.dir("src/main/docker/${sourceDirName}").asFileTree.matching {
def sourceDir = project.layout.projectDirectory.dir("src/main/docker/${sourceDirName}")
from(sourceDir.asFileTree.matching {
exclude("**/build/**", "**/.venv/**")
})

// Explicit inputs for incremental build support
// Track the source Dockerfile and related files
inputs.dir(sourceDir)
inputs.file(project.rootProject.layout.projectDirectory.file("VERSION"))
// Track library and application JARs
// Use map to get output files instead of task reference for configuration cache compatibility
(libraries + applications).each { lib ->
inputs.files(lib.configurations.runtimeClasspath)
inputs.files(lib.tasks.named('jar').map { it.outputs.files })
}
// Track application start scripts
// Use map to get output files instead of task reference for configuration cache compatibility
applications.each { app ->
inputs.files(app.tasks.named('startScripts').map { it.outputs.files })
}
outputs.dir(destDir)

// Collect assemble tasks from libraries and applications
def assembleTasks = (libraries + applications).collect { it.tasks.named("assemble") }
dependsOn assembleTasks
Expand Down Expand Up @@ -142,7 +161,7 @@ javaContainerServices.each { dockerImageName, projectName ->
javaContainerServices.forEach { dockerImageName, gradleProjectName ->
def projectName = project(gradleProjectName).name;
def dockerBuildDir = "build/docker/${dockerImageName}_${projectName}"
task "buildDockerImage_${dockerImageName}"(type: DockerBuildImage) {
tasks.register("buildDockerImage_${dockerImageName}", DockerBuildImage) {
dependsOn "createDockerfile_${dockerImageName}"
inputDir = project.file("${dockerBuildDir}")
images.add("migrations/${dockerImageName}:${version}".toString())
Expand All @@ -161,7 +180,7 @@ dockerCompose {
]
}

task buildDockerImages {
tasks.register('buildDockerImages') {
dependsOn tasks.named('buildDockerImage_k8s_config_map_util_scripts')
dependsOn tasks.named('buildDockerImage_elasticsearch_searchguard')
dependsOn tasks.named('buildDockerImage_migration_console')
Expand Down
20 changes: 16 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ allprojects {
}
}

task buildDockerImages() {
tasks.register('buildDockerImages') {
dependsOn(':frontend:buildDockerImage')
dependsOn(':TrafficCapture:dockerSolution:buildDockerImages')
dependsOn(':DocumentsFromSnapshotMigration:buildDockerImages')
Expand Down Expand Up @@ -145,6 +145,14 @@ subprojects {
}
}

plugins.withId('com.bmuschko.docker-remote-api') {
tasks.withType(com.bmuschko.gradle.docker.tasks.image.DockerBuildImage).configureEach {
// Declare the imageIdFile as an output so dependent tasks can track it as an input
// This enables proper UP_TO_DATE checking when using CommonUtils.dependOnDockerImage()
Comment on lines +150 to +151
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you put a couple more lines of comments in here so that I can udnerstand exactly what the imageIdFile is. I'm also trying to figure out precisely what is invoked for the remote api (if anything)

outputs.file(imageIdFile)
}
}

tasks.withType(Javadoc).configureEach {
options.addStringOption('Xdoclint:none', '-quiet')
}
Expand Down Expand Up @@ -248,12 +256,13 @@ subprojects {
}
}

task javadocJar(type: Jar, dependsOn: javadoc) {
tasks.register('javadocJar', Jar) {
dependsOn javadoc
archiveClassifier.set('javadoc')
from javadoc.destinationDir
}

task sourcesJar(type: Jar) {
tasks.register('sourcesJar', Jar) {
archiveClassifier.set('sources')
from sourceSets.main.allSource
duplicatesStrategy = DuplicatesStrategy.WARN
Expand Down Expand Up @@ -499,13 +508,16 @@ def syncJacocoExecFiles = tasks.register("syncJacocoExecFiles", Sync) {
dependsOn jacocoTestTasksProvider
}

tasks.register('gatherJacocoExecForMerging', Copy) {
tasks.register('gatherJacocoExecForMerging', Sync) {
description = 'Local troubleshooting, gathers coverage all exec files in build/jacocoMerged/*.exec into to be consumed by jacocoAggregateReport'

from subprojects.collect { proj ->
fileTree(dir: proj.buildDir, include: 'jacoco/*.exec')
}
into "$buildDir/jacocoMerged"

// Explicit outputs for incremental build support
outputs.dir("$buildDir/jacocoMerged")
}

tasks.register('mergeJacocoReports') {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,68 @@
package org.opensearch.migrations.common

import org.gradle.api.GradleException
import org.gradle.api.tasks.Copy
import org.gradle.api.Task
import org.gradle.api.tasks.Sync
import org.gradle.api.tasks.TaskProvider
import org.gradle.api.Project
import com.bmuschko.gradle.docker.tasks.image.Dockerfile
import com.bmuschko.gradle.docker.tasks.image.DockerBuildImage

class CommonUtils {

/**
* Adds a dependency on a DockerBuildImage task and tracks its imageIdFile as an input.
* This ensures that when the base image is rebuilt, the dependent task will also rebuild.
* The input property name is auto-generated from the base image task name.
*
* @param task The task that depends on the Docker image
* @param baseImageTaskPath The full task path (e.g., ":TrafficCapture:dockerSolution:buildDockerImage_elasticsearch_client_test_console")
*/
static void dependOnDockerImage(Task task, String baseImageTaskPath) {
def rootProject = task.project.rootProject
// Parse the task path to get project path and task name
def lastColonIndex = baseImageTaskPath.lastIndexOf(':')
def projectPath = baseImageTaskPath.substring(0, lastColonIndex)
def taskName = baseImageTaskPath.substring(lastColonIndex + 1)
def targetProject = projectPath.isEmpty() ? rootProject : rootProject.project(projectPath)
def baseImageTaskProvider = targetProject.tasks.named(taskName, DockerBuildImage)
dependOnDockerImage(task, baseImageTaskProvider)
}

/**
* Adds a dependency on a DockerBuildImage task and tracks its imageIdFile as an input.
* This ensures that when the base image is rebuilt, the dependent task will also rebuild.
*
* @param task The task that depends on the Docker image
* @param baseImageTaskProvider The TaskProvider for the DockerBuildImage task to depend on
*/
static void dependOnDockerImage(Task task, TaskProvider<DockerBuildImage> baseImageTaskProvider) {
def logger = task.project.logger
def baseTaskName = baseImageTaskProvider.name

task.dependsOn(baseImageTaskProvider)
// Use map to get the imageIdFile Provider for configuration cache compatibility
def imageIdFileProvider = baseImageTaskProvider.map { it.imageIdFile.get().asFile }
task.inputs.file(imageIdFileProvider).withPropertyName(baseTaskName)

// Add doFirst action to log the actual image ID at execution time
// Capture only serializable values (not the TaskProvider) for configuration cache compatibility
def taskPath = task.path
task.doFirst {
// Access the imageIdFile through the task's inputs to avoid capturing the TaskProvider
def imageIdFile = imageIdFileProvider.get()
if (imageIdFile.exists()) {
def imageId = imageIdFile.text.trim()
logger.lifecycle("Docker image dependency: {} depends on {} with imageId: {}",
taskPath, baseTaskName, imageId)
logger.debug(" imageIdFile path: {}", imageIdFile.absolutePath)
} else {
logger.warn("Docker image dependency: {} depends on {} but imageIdFile does not exist: {}",
taskPath, baseTaskName, imageIdFile.absolutePath)
}
}
}

static def calculateDockerHash(def files) {
def MessageDigest = java.security.MessageDigest
def digest = MessageDigest.getInstance('SHA-256')
Expand All @@ -32,7 +88,8 @@ class CommonUtils {
String destProjectName, String destDir) {
// Sync performs a copy, while also deleting items from the destination directory that are not in the source directory
// In our case, jars of old versions were getting "stuck" and causing conflicts when the program was run
var dstCopyTask = dockerBuildProject.task("copyArtifact_${destProjectName}", type: Sync) {
// Using tasks.register() for lazy task configuration (configuration avoidance)
return dockerBuildProject.tasks.register("copyArtifact_${destProjectName}", Sync) {
into destDir
duplicatesStrategy = 'WARN'

Expand All @@ -41,23 +98,36 @@ class CommonUtils {

// Copy jars
// Lazily evaluate this runtimeClasspath
from(project.provider { sourceArtifactProject.configurations.runtimeClasspath }) {
from(dockerBuildProject.provider { sourceArtifactProject.configurations.runtimeClasspath }) {
include "*.jar"
into("jars")
}
from(sourceArtifactProject.tasks.named('jar')) {
// Use map to get output files instead of task reference for configuration cache compatibility
from(sourceArtifactProject.tasks.named('jar').map { it.outputs.files }) {
include "*.jar"
into("jars")
}

// Explicit inputs/outputs for incremental build support
inputs.file(dockerBuildProject.rootProject.layout.projectDirectory.file("VERSION"))
inputs.files(dockerBuildProject.provider { sourceArtifactProject.configurations.runtimeClasspath })
// Use map to get output files instead of task reference for configuration cache compatibility
inputs.files(sourceArtifactProject.tasks.named('jar').map { it.outputs.files })
outputs.dir(destDir)

dependsOn(sourceArtifactProject.tasks.named("assemble"))
dependsOn(sourceArtifactProject.tasks.named("build"))
}
dstCopyTask.dependsOn(sourceArtifactProject.tasks.named("assemble"))
dstCopyTask.dependsOn(sourceArtifactProject.tasks.named("build"))
}

static def copyVersionFileToDockerStaging(Project project, String destProjectName, String destDir) {
return project.tasks.register("copyVersionFile_${destProjectName}", Copy) {
return project.tasks.register("copyVersionFile_${destProjectName}", Sync) {
from(project.rootProject.layout.projectDirectory.file("VERSION"))
into(project.layout.projectDirectory.dir(destDir))

// Explicit inputs/outputs for incremental build support
inputs.file(project.rootProject.layout.projectDirectory.file("VERSION"))
outputs.dir(project.layout.projectDirectory.dir(destDir))
}
}

Expand All @@ -71,7 +141,8 @@ class CommonUtils {
String dockerImageName) {
def projectName = sourceArtifactProject.name;
def dockerBuildDir = "build/"+getDockerBuildDirName(dockerImageName, projectName);
dockerBuildProject.task("createDockerfile_${dockerImageName}", type: Dockerfile) {
// Using tasks.register() for lazy task configuration (configuration avoidance)
return dockerBuildProject.tasks.register("createDockerfile_${dockerImageName}", Dockerfile) {
destFile = dockerBuildProject.file("${dockerBuildDir}/Dockerfile")
dependsOn "copyArtifact_${dockerImageName}"
if (baseImageProjectOverride) {
Expand Down Expand Up @@ -133,4 +204,3 @@ class CommonConfigurations {
}
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ class RegistryImageBuildUtils {
def imageTag = cfg.get("imageTag", "latest").toString()
def contextDir = cfg.get("contextDir", ".")
def serviceName = cfg.get("serviceName")
def contextPath = project.file(contextDir).path
def contextFile = project.file(contextDir)
def contextPath = contextFile.path
def formatter = ImageRegistryFormatterFactory.getFormatter(registryEndpoint)
def (registryDestination, cacheDestination) = formatter.getFullTargetImageIdentifier(registryEndpoint, imageName, imageTag)

Expand All @@ -126,6 +127,13 @@ class RegistryImageBuildUtils {
group = "docker"
description = "Build and push ${registryDestination} with caching"

// Add inputs for the Docker context directory to track file changes
inputs.dir(contextFile)

// Since outputs are pushed to a remote registry, we cannot track them locally.
// Always run this task to ensure the image is up-to-date with the registry.
outputs.upToDateWhen { false }

cfg.get("requiredDependencies", []).each {
dependsOn it
}
Expand Down
Loading