Skip to content

Commit

Permalink
Merge pull request #164 from ayeshLK/main
Browse files Browse the repository at this point in the history
Add a waiting logic for docker-build
  • Loading branch information
ayeshLK authored Jul 2, 2024
2 parents e93096a + 5899c66 commit 9be822e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/main/groovy/io/ballerina/plugin/BallerinaPlugin.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ class BallerinaPlugin implements Plugin<Project> {
}

// Pack bala first
project.exec {
def result = project.exec {
workingDir project.projectDir
environment 'JAVA_OPTS', '-DBALLERINA_DEV_COMPILE_BALLERINA_ORG=true'
if (buildOnDocker) {
Expand All @@ -283,10 +283,10 @@ class BallerinaPlugin implements Plugin<Project> {
// commandLine 'cmd', '/c', "$balPackWithDocker && exit %%ERRORLEVEL%%"
def cmdStr = """
docker run --env-file $project.projectDir/docker.env --rm --net=host -u root \
/bin/sh -c "ls -al"" \
alpine:latest
alpine:latest \
/bin/sh -c "ls -al"
"""
commandLine 'cmd', '/c', "$cmdStr && exit %%ERRORLEVEL%%"
commandLine 'cmd', '/c', "$balPackWithDocker && exit %%ERRORLEVEL%%"
} else {
commandLine 'sh', '-c', "$balPackWithDocker"
}
Expand All @@ -298,6 +298,7 @@ class BallerinaPlugin implements Plugin<Project> {
}
}
}
result.wait(50000)

def balaPath = "$project.projectDir/${balBuildTarget}/bala"
def balaDir = new File(balaPath)
Expand Down

0 comments on commit 9be822e

Please sign in to comment.