1
.gitlab-ci.yml
内の$CI_COMMIT_TAG
をjsonデータの複数行curl
コマンドに渡す方法を探しています。しかし、私がそうするたびに、私は値の可変キーストリングisteadを得る。json入力で複数行のスクリプトでGitLab変数を渡すには?
production:
stage: deploy
script:
- "openssl aes-256-cbc -k $DEPLOY_KEY -in config/deploy_id_rsa_enc_gitlab -d -a -out config/deploy_id_rsa"
- chmod 600 config/deploy_id_rsa
- eval `ssh-agent -s`
- ssh-add config/deploy_id_rsa
- ssh-keyscan -H $HOST_PRODUCTION >> ~/.ssh/known_hosts
- bundle exec cap production deploy tag=$CI_COMMIT_TAG
- "curl --request POST -u $GRAFANA_USR:$GRAFANA_PWD \
--url https://stats.domain.mil/grafana/api/annotations/graphite \
--header 'content-type: application/json' \
--data '{\"what\": \"Deploy: CORE\",\"tags\": [\"production_release\"],\"data\": \"$CI_COMMIT_TAG\"}'"
environment:
name: production
url: https://$HOST_PRODUCTION
only:
- tags
when: manual
正しい方法で$CI_COMMIT_TAG
を渡すにはどうすればよいですか?