3

Elastic Beanstalk 환경에 배치 할 git 분기 코드를 지정하는 방법이 있습니까?Elastic Beanstalk 환경에 배포 할 git 분기 코드를 지정하십시오.

내가 테스트단계라는 두 개의 자식 지점을 가지고, 가정 나는 시험 ENV라는 탄성 콩 줄기 환경을 가지고있다.

지금, 나는 다음과 같이 config.yml에서 분기 기본값을 설정 :

branch-defaults: 
    test: 
    environment: test-env 
    group_suffix: null 
global: 
    application_name: test 
    default_ec2_keyname: abcde 
    default_platform: Ruby 2.2 (Puma) 
    default_region: us-west-2 
    profile: eb-cli 
    sc: git 

를 자, 내가 필요하면 내가 자동으로 테스트 지점에서 코드를 배포해야 단계 eb deploy test-env 지점에서 배포하는 경우입니다 또는 오류가 발생해야합니다.

어떤 방법이 있습니까? 더 나에게 그것을 할 수있는 다른 방법 ..

감사합니다 .. 제안하십시오

답변

2

이것은 EB CLI가 지원하는 것이 아닙니다 없다 현재 분기에서 배포를 항상 실행합니다. 그러나 그것은 확실히 여러분이 스크립팅 할 수있는 무언가입니다 (나는 bash하에 있다고 가정하고 for 명령을 사용하여 현재 분기 이름을 추출하는 것은 너무 어렵지 않을 것입니다) :

deployTest. sh :
#!bin/bash 
# Grab the current branch name 
current=`git rev-parse --abbrev-ref HEAD` 
# Just in case we have any in-flight work, stash it 
git stash 
# Switch to 'test' branch 
git checkout test 
# Deploy to test-env 
eb deploy test-env 
# Switch back to whatever branchwe were on 
git checkout $current 
# Restore in-flight work 
git stash pop 
관련 문제