Gitlab Pipeline 使用 Azure image 如何访问变量?

Gitlab Pipeline using Azure image how to access variables?

我在 Gitlab 中有一个非常简单的 CI/CD 管道,如下所示:

image: maven:3.3.9-jdk-8

variables:
  APP: "MyApp"

stages:
  - build

test_build:
  stage: build
  image: mcr.microsoft.com/azure-cli
  script:
    - echo $APP
    - $name='prefix' + $APP + 'suffix'
    - echo $name

当我 运行 此管道时,第一个脚本行 echo $APP 正确打印 "MyApp"。但是第二行失败并显示以下内容:

/bin/bash: Line 121: 'prefix': command not found. 

我的问题是,如何使用管道变量内联 azure cli 命令?

这是 Bash 语法的问题:将以 $name= 开头的行替换为 name="prefix $APP suffix"