1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

ディップ with 全部俺 その2 ~iOSエンジニア編~ Advent Calendar 2019

Day 3

AppCenterのリリース情報は簡単に取れる。そう、Bitriseならばね。

Posted at

事の経緯

ちょっと前にSlackにAppCenterのURLを貼るために、リリース情報を取得するスクリプトを書いた。

↓ これが件のスクリプトである。
AppCenterに最後にデプロイしたリリース情報を取得する。
https://qiita.com/satoshi-baba-0823/items/8c7802d95727bee870fd

正直こんなことのためにスクリプトを書くのは面倒だ。
何とかならないのかと、インテグレーションのソースを読んでいたところ...(https://github.com/fileformat/bitrise-step-appcenter-app-release))

あった!

こちらがソースである。

| STATUSCODE=$(curl -X GET \ |
|:--|:--|:--|
|  | --header "Accept: application/json" \ |
|  | --header "X-API-Token: ${appcenter_api_token}" \ |
|  | --silent --show-error \ |
|  | --output /dev/stderr --write-out "%{http_code}" \ |
|  | https://api.appcenter.ms/v0.1/apps/${appcenter_org}/${appcenter_name}/releases/${RELEASE_ID} | \ |
|  | 2> "${TMPFILE}") |
|  |
| if [ "${STATUSCODE}" -ne "200" ] |
| then |
|  | echo_fail "API call failed with ${STATUSCODE}: $(cat ${TMPFILE})" |
| fi |
| DOWNLOAD_URL=$(cat "${TMPFILE}" | jq .download_url --raw-output) |
|  |
| echo_details "result is ${STATUSCODE}: $(cat ${TMPFILE})" |
| echo_details "APPCENTER_DOWNLOAD_URL is ${DOWNLOAD_URL}" |
| envman add --key APPCENTER_DOWNLOAD_URL --value "${DOWNLOAD_URL}" |

お分かりいただけたであろうか...?

環境変数に登録されてるぅ!!
_人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人_
> envman add --key APPCENTER_DOWNLOAD_URL --value "${DOWNLOAD_URL}" <
 ̄Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y ̄

このAPPCENTER_DOWNLOAD_URL でAppCenterにアクセスできるぞ!
ありがたや〜!!

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?