Hello Atlassian community,
Any one can help?
I am experiencing an issue with my Flutter web build pipeline on Bitbucket. When I run the flutter build web --web-renderer canvaskit --release command locally, the build/web directory contains all necessary files and folders, including the assets directory and the .env file that I manually copy into the directory after the build. However, when running the same pipeline on Bitbucket, the build output is incomplete. The build/web directory on the Bitbucket server does not include the assets directory and the .env file, which are essential for my deployment.
Pipeline Details:
- I'm using the
instrumentisto/flutter:latest Docker image in my pipeline to build the Flutter web application. - The
.env file is located in an external repository (env-configs), and I attempt to copy it into the build/web directory after the build step. - The pipeline proceeds without errors during the build process, but when I check the output, some critical files and directories (like
assets and the .env file) are missing.
Key Pipeline Steps:
- Install SSH Key: Pulls private repositories.
- Clone Environment Variables Repo: Fetches environment-specific config files, including
.env. - Build Flutter Web: Executes the
flutter build web command. - Copy
.env File: Attempts to copy the .env file from env-configs to build/web. - Check Build Output: Lists the contents of
build/web to ensure all files are present. - Deploy to FTP: Uses
atlassian/ftp-deploy pipe to upload the build output.
What Works Locally:
- When I run
flutter build web --web-renderer canvaskit --release on my local machine, the build/web directory includes:- The
assets directory (with all required assets). - The
.env file (copied manually after the build). - canvaskit foder
- and other files
What Doesn't Work on Bitbucket:
- The
assets directory and .env file are missing from the build/web directory after the build step on the Bitbucket server, leading to incomplete deployment.
Troubleshooting Steps Taken:
- I’ve added a step to manually create the
build/web/assets directory before copying the .env file:
- mkdir -p build/web/assets
- cp /env/.env.dev build/web/.env
- I’ve tried listing the contents of the
build/web directory after the build step, but the necessary files and folders are still missing. - I’ve considered potential differences between my local environment and the Bitbucket Docker environment, but I’m not sure what might be causing the inconsistency.
Questions:
- Is there any known issue with the
instrumentisto/flutter:latest Docker image that could cause certain files (like the assets directory) to be excluded from the build output? - Could there be a permission issue or a file system limitation on Bitbucket Pipelines that is preventing the
.env file and assets directory from being copied or generated properly? - Is there a specific configuration I need to modify in the pipeline to ensure the
build/web directory mirrors my local build output exactly?
Output when run build command on local device
assets,canvaskit,icons,js_lib,.last_build_id,crypto_utils,favicon,flutter,flutter_bootstrap,flutter_service_worker,index.html,main.dart,manifest.json,version.json
Output when run build command on bitbucket
index.html,jcrypto_utils,faveicon,icons,js_lib,manifest.json
Any insights or suggestions would be greatly appreciated!
Thanks!