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.
instrumentisto/flutter:latest
Docker image in my pipeline to build the Flutter web application..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.assets
and the .env
file) are missing..env
.flutter build web
command..env
File: Attempts to copy the .env
file from env-configs
to build/web
.build/web
to ensure all files are present.atlassian/ftp-deploy
pipe to upload the build output.flutter build web --web-renderer canvaskit --release
on my local machine, the build/web
directory includes:assets
directory (with all required assets)..env
file (copied manually after the build).assets
directory and .env
file are missing from the build/web
directory after the build step on the Bitbucket server, leading to incomplete deployment.
build/web/assets
directory before copying the .env
file:
- mkdir -p build/web/assets
- cp /env/.env.dev build/web/.env
build/web
directory after the build step, but the necessary files and folders are still missing.instrumentisto/flutter:latest
Docker image that could cause certain files (like the assets
directory) to be excluded from the build output?.env
file and assets
directory from being copied or generated properly?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!
Hi Mohammad,
You list 6 Key Pipeline Steps. Are these separate steps defined as such in your bitbucket-pipelines.yml file?
For builds running on Atlassian's infrastructure or with a Linux Docker self-hosted runner, each step runs on a separate Docker container. For every step of your build, a Docker container starts using the image you have specified in your bitbucket-pipelines.yml file. The repo is cloned in the build container, and then the commands of the step's script are executed. When the step finishes that Docker container gets destroyed. The same process is repeated for subsequent steps.
Files you generate during one step are not available in subsequent steps, unless you define them as artifacts in your bitbucket-pipelines.yml file:
So, if your build step generates certain files and folders, you'll need to define them as artifacts so that they are available to next steps. Additionally, try running the command that lists the contents of the web folder in the same step where you run the flutter build web command, to check what files and folders are generated right after the command runs.
A few notes also regarding your steps:
Please feel free to reach out if you have any questions!
Kind regards,
Theodora
thx very much now i know where my problem and i fixed it 😁❤
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
On my local machine, the build output folder contains the assets
and canvaskit
directories, along with other files. However, when I run ls -la web
on the Bitbucket server during the pipeline step, the output does not match and fails to show these files and directories. As a result, when proceeding to the upload step, I cannot find all the required files, which is causing the site not to start.
Build Flutter Web Application
I have reached #91 bitbucket_build_number so far nothing is complete although the pipes are being completed properly. 😩
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It's good to hear that the issue is fixed, Mohammad! 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.