What do the symbols *1 or &2 mean in Travis CI deployment scripts? -
i'm following guide using travis deploy aws codedeploy. in docs point .travis.yml
example contains following code:
deploy: - provider: s3 access_key_id: akiaj4xzhimnkp3wgghq secret_access_key: &1 secure: <key> local_dir: dpl_cd_upload skip_cleanup: true on: &2 repo: travis-ci/cat-party bucket: catparty-codedeploy - provider: codedeploy access_key_id: akiaj4xzhimnkp3wgghq secret_access_key: *1 bucket: catparty-codedeploy key: latest.zip bundle_type: zip application: catpartydemoapplication deployment_group: productiondemofleet on: *2
i've got working , understand flow (first uploads zip file s3, deploys file codedeploy). i'm struggling syntax: on: &2
line in s3
section, , on: *2
part in codedeploy
section. these lines doing?
i ask because want modify configuration deploy different codedeploy group depending on whether commit has given tag, eg:
on: tags: true all_branches: true condition: "$travis_tag =~ ^release.*$"
... because i'm not clear on: *2
doing (and can't find in docs), i'm uncertain how proceed. tips?
those symbols , features bring part of yaml itself. they're supported reduce duplication efforts in yaml file.
for instance, section prefixed &
stores subsequent structure reference name 2
. 2
references repo: travis-ci/cat-party
.
on: &2 repo: travis-ci/cat-party
the reference name can alphanumeric set of characters make things more expressive.
on other hand, *
used resolve reference want reuse it.
so in following section yaml parser resolve *2
structure stored: repo: travis-ci/cat-party
:
on: *2
this feature saves duplication, can handy in several aspects of .travis.yml
file.
Comments
Post a Comment