2017-09-25 6 views
0
나는 CLI 명령의 출력에 따라 환경 변수를 설정하려는

, 나는 다음 시도하지만 설정 환경 변수

- run: 
    name: Build web files 
    command: API_URL="$(node utils/get-api-url.js)" && npm --prefix skynet/web run build 

이유는 무엇입니까

를 작동하지 않는 이유는 무엇입니까?

나는 아래 다음 https://discuss.circleci.com/t/setting-environment-variables-with-a-command-fails/11034/4

- run: 
    name: Build web files 
    command: | 
     API_URL: $(node utils/get-api-url.js) 
     eval $(npm --prefix skynet/web run build) 

을 시도하지만

/빈/bash는 가지고 :에 127

+0

첫 번째 버전을 사용해 보았지만 앰퍼샌드가 없습니까? –

답변

1

을 기반으로 코드를 찾을 수 없습니다 API_URL :: 명령 에 Exited 당신의 초기 예 : 시도해보십시오.

- run: 
    name: Build web files 
    command: | 
    API_URL=$(node utils/get-api-url.js) 
    npm --prefix skynet/web run build 

변수 API_URL은이 CircleCI 단계 외부에서 사용할 수 없습니다.