0
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.

【Jenkins:Mac】Deploygateにアップロード

Posted at

概要

androidやiosのビルドしたアプリのパッケージをdeploygateにアップロードしたい

アップロードとかめんどくさい印象あるけどdeploygateは結構簡単にいけます
というかdeploygate側のリファレンスが色々と分かりやすく書かれています
https://docs.deploygate.com/reference#deploygate-api

ちなみにdeploygate側のアカウント作成とかは端折るので作っておいてください
deploygateのアカウント設定のページの一番下あたりにある「API Key」を後程使用します

Jenkinsバージョン:2.270
deploygate-plugin:1.2
※Jenkinsとプラグインのバージョンが異なると動作しない可能性があります

1. プラグイン追加

まず最初に
Jenkinsの管理 > プラグインの管理 > 「利用可能」タブ
から「deploygate-plugin」を探してインストールしてください
再起動は不要だと思うので「install without restart」でインストール

2. スクリプト作成

いつも通りPipelineで作成します
適当にジョブ作ってPipelineScriptに下記を記述

コード
node
{
    stage ("upload")
    {
        sh '''
        curl \
        -F "token=[トークン]" \
        -F "file=@${WORKSPACE}/sample/sample.apk" \
        -F "message=${UPLOAD_TEXT}" \
        https://deploygate.com/api/users/[ユーザー名]/apps
        '''
    }
}

deploygateのリファレンスにも載ってますがざっくり説明すると

token
deploygateのアカウント設定のページの一番下あたりにある「API Key」を[トークン]にコピペしてください

file
アップロードするファイルです
多分アプリをビルドしてこの処理を呼ぶことになると思うんですが
その時に作成したファイルのパスを書いてください
※例ではファイル名はandroidの例でapkにしてるけどiosの場合はipaです

message
deploygateにアップロード時の説明です
これは固定テキストというは微妙なので
例のようにJenkinsのビルドパラメータで設定して呼び出す形の方がいいと思います

最後にアップロードするパスです
[ユーザー名]に自身のアカウントのユーザー名を記載してください

3. ビルド

ビルドすると
deploygateでこんな感じで更新情報が追加されるはずです
deploygate.png

0
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
0
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?