I got
> Keystore file '/opt/atlassian/pipelines/agent/build/app/keyStore.jks' not found for signing config 'release '.
that is my script
image: mingc/android-build-box:latest
pipelines:
branches:
development:
- step:
name: "Build [DEBUG] and run Unit Tests"
script:
- echo "START script build-debug.sh"
- chmod +x build-debug.sh
- ./build-debug.sh
- echo "END script build-debug.sh - artifacts we [DEBUG] build can be downloaded..."
- pipe: atlassian/bitbucket-upload-file:0.7.1
variables:
BITBUCKET_ACCESS_TOKEN: $BITBUCKET_ACCESS_TOKEN
FILENAME: "./app/build/outputs/apk/debug/app-debug.apk"
FILE_PATH: "artifacts/app-debug.apk"
and that is build-debug.sh
#!/bin/bash
# Exit immediately if a command exits with a non-zero status
set -e
# Define some colors for better readability in logs
GREEN='\033[0;32m'
RED='\033[0;31m'
NC='\033[0m' # No Color
# Function to print messages in green color
function echo_green() {
echo -e "${GREEN}$1${NC}"
}
# Function to print messages in red color
function echo_red() {
echo -e "${RED}$1${NC}"
}
# Start the build process
echo_green "Starting the build process..."
chmod +x gradlew
# Clean the project
echo_green "Cleaning the project..."
./gradlew clean
# Assemble the debug build
echo_green "Assembling the debug build..."
./gradlew build
cd ./app/build/outputs/apk/debug
ls -la
# Notify completion of the build process
echo_green "Build process completed successfully."
Hi Ahmed and welcome to the community!
The error indicates that the build cannot find a certain file in the path /opt/atlassian/pipelines/agent/build/app/. Does the file exist in that directory?
Just to give you some context, Pipelines builds run in Docker containers. For every step of your build, a Docker container starts (the build container) using the image you have specified in your bitbucket-pipelines.yml file. The repo is cloned in the build container in the directory /opt/atlassian/pipelines/agent/build (this is the clone directory).
Does this file exist in your repo in the directory named app? Or are you downloading it during the build in that directory?
I suggest debugging this build locally with Docker first, and when you have a build that runs locally, it should work in Pipelines as well. You can follow this guide to debug the build locally with Docker:
Kind regards,
Theodora
I don't have this path "/opt/atlassian/pipelines/agent/build/app/" to add a file to it
I need to add keystore.jks, key alias, and password to be used in singing for builds
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ahmed,
The path /opt/atlassian/pipelines/agent/build/app/ is not a path on your repository. The path /opt/atlassian/pipelines/agent/build/ is a directory in the Docker container where your build runs during a Pipelines build. In that directory, your repo gets cloned, and the commands of your yml file get executed.
Did you try debugging the build locally as per the guide I shared in my previous reply?
What happens when you debug the build locally as per this guide?
Kind regards,
Theodora
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That's good to hear, thank you for the update! Please feel free to reach out if you ever need anything else.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.