How to set a build stack for ionic-cloud cli builds?

24 Views Asked by At

I'm trying to build an ionic web-build to be deployed through AppFlow live updates, using the ionic-cloud cli, by running:

ionic-cloud build web --app-id=12345678 --commit=35d97a73bf3bb7144bcc9473bcc9b6e0fb2ec500

I'm getting an npm incompatability error, because it is building my project for the latest ionic-stack, while my build is targetting an earlier 2022.07 stack:

enter image description here

How can I specify the build stack when running ionic-cloud build command manually?

1

There are 1 best solutions below

0
On

Info about specifying the build stack using the ionic-cloud-cli for web builds can be found by typing ionic-cloud build web -h:

ionic-cloud build web
This command creates a web build on Appflow. While the build is running, it prints the remote build log to the terminal.

Usage:
  ionic-cloud build web [flags]

Aliases:
  web, live-update, web-preview

Examples:
ionic-cloud build web --app-id=a1234bc --commit=a9eb85e
ionic-cloud build web --app-id=a1234bc --commit=a9eb85e --web-preview
ionic-cloud build web-preview --app-id=b3456cd --commit=4c511f1 --environment="My Custom Environment Name"

Flags:
      --app-id string          Appflow app id [required]
    
      ******
      --build-stack string     Target platform ("Linux - 2023.10" / "Linux - 2023.06" / "Linux - 2023.04" / "Linux - 2022.10" / "Linux - 2022.07"), defaults to latest stack
      ******

      --commit string          Commit sha [required]
      --detached               Asynchronously run appflow build (default: false)
      --env env-file           Variables to expose to your build. Variables defined this way override those loaded using the env-file flag. Example: --env VAR=value
      --env-file stringArray   Files declaring environment variables to expose to your build. Variables from later files overwrite variables from earlier files.
      --environment string     The name of the predefined Appflow Environment to expose to your build
  -h, --help                   help for web
      --secret stringArray     Secrets to expose to your build. Example: --secret VAR=value
      --web-preview            Enable web preview
      --zip                    Download zip file
      --zip-name string        Download zip and rename file. Example: myapp.zip

So the use a specific build stack, run:

ionic-cloud build web --build-stack="stack-string" --app-id=12345678 --commit=35d97a73bf3bb7144bcc9473bcc9b6e0fb2ec500

For stack 2022.07 that is in the question, run:

ionic-cloud build web --build-stack="Linux - 2022.07" --app-id=12345678 --commit=35d97a73bf3bb7144bcc9473bcc9b6e0fb2ec500