Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

gradle project multi-modlue pipeline .yml ASK?

정형진
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 19, 2025

pipelines:
branches:
release/dev:
- step:
name: Detect Changed Modules & Build
caches:
- gradle
script:
- echo "Changed modules: $BITBUCKET_COMMIT_RANGE"
- CHANGED_MODULES=$(git diff --name-only $BITBUCKET_COMMIT_RANGE | cut -d/ -f1 | sort -u)
- echo "Detected modules: $CHANGED_MODULES"
- |
for module in $CHANGED_MODULES; do
if [ -f "$module/build.gradle" ]; then
echo "Building $module ..."
gradle :$module:clean :$module:build || exit 1
fi
done

artifacts:
- "*/build/libs/*.jar"

- step:
name: Deploy Changed Modules
deployment: release/dev
script:
- echo "Deploying to Windows Server ..."
- CHANGED_MODULES=$(git diff --name-only $BITBUCKET_COMMIT_RANGE | cut -d/ -f1 | sort -u)
- echo "Detected modules: $CHANGED_MODULES"
- |
for module in $CHANGED_MODULES; do
if [ -d "$module/build/libs" ]; then
echo "Deploying $module ..."
scp -P 2222 -o StrictHostKeyChecking=no \
$module/build/libs/*.jar \
$WINDOWS_USER@$WINDOWS_HOST:"/C/Users/$WINDOWS_USER/deploy/brycenBackEnd/$module/"
fi
done

 

bitbucket-pipeline.yml setting 

 

pipelie executing --> 

 

 

Configuration error

There is an error in your bitbucket-pipelines.yml at [pipelines > branches > release/dev > 0 > step > script > 0]. Missing or empty command string. Each item in this list should either be a single command string or a map defining a pipe invocation.

 

help me 

1 answer

0 votes
Syahrul
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 20, 2025

Hi @정형진 

Welcome to the community.

Please find the following example

image: openjdk:11

pipelines:
  branches:
    release/dev:
      - step:
          name: Detect Changed Modules & Build
          caches:
            - gradle
          script:
            - |
                echo "Changed modules: $BITBUCKET_COMMIT_RANGE"
                CHANGED_MODULES=$(git diff --name-only $BITBUCKET_COMMIT_RANGE | cut -d/ -f1 | sort -u)
                echo "Detected modules: $CHANGED_MODULES"
                for module in $CHANGED_MODULES; do
                  if [ -f "$module/build.gradle" ]; then
                    echo "Building $module ..."
                    ./gradlew :$module:clean :$module:build || exit 1
                  fi
                done
          artifacts:
            - "*/build/libs/*.jar"
      - step:
          name: Deploy Changed Modules
          deployment: dev
          script:
            - |
                echo "Deploying to Windows Server ..."
                CHANGED_MODULES=$(git diff --name-only $BITBUCKET_COMMIT_RANGE | cut -d/ -f1 | sort -u)
                echo "Detected modules: $CHANGED_MODULES"
                for module in $CHANGED_MODULES; do
                  if [ -d "$module/build/libs" ]; then
                    echo "Deploying $module ..."
                    scp -P 2222 -o StrictHostKeyChecking=no \
                      $module/build/libs/*.jar \
                      $WINDOWS_USER@$WINDOWS_HOST:"/C/Users/$WINDOWS_USER/deploy/brycenBackEnd/$module/"
                  fi
                done
  • Each script section uses a single pipe block (- |) so that variable assignments and loops work as expected.

  • No mixing of single command strings and pipe blocks in the same step.

  • Indentation uses spaces only.

That said I suggest use ./gradlew for Gradle builds instead of script. I hope this helps

Regards,
Syahrul

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin Site Admin
TAGS
AUG Leaders

Atlassian Community Events