Add support for `.service` file

オープン
#5 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
bash, python
領域
ci-cd, devops

調査の方向性

Start with manage_apps.py and deploy.sh, tracing the existing APP and METHOD environment-variable flow. Review the proposed SERVICEFILEPATH handling and connection.serviceExists checks, then follow how deploy.sh invokes manage_apps.py. Done means a .service file is recognized during deploy previews and the described service checks and creation flow works for applications needing services such as Redis or Postgres.

索引モデルが issue の本文から書いたものです。

説明

For applications which require services like Redis or Postgres, a standard file (probably .service) would be useful to recognize and automatically spin up those services for the app. This is especially useful as part of the deploy preview, which would be frustrating to use for now for apps which depend on those resources.

We can accomplish this with logic along the lines of:

SERVICE_FILEPATH = os.environ.get("SERVICEFILEPATH")
METHOD = os.environ.get("METHOD")

if SERVICE_FILEPATH:
    with open(SERVICE_FILEPATH, 'r') as svc_file:
        service_configs = json.load(svc_file)
        if not isinstance(service_configs, list):
            service_configs = [service_configs]

if METHOD == "CHECKSVC":
    for service in service_configs:
        push = "false" if connection.serviceExists(APP, service['type']) else "true"
        if push == "true":
            print(push)

in manage_apps.py and logic along the lines of:

# Check if service needs to be created
if [[ -f "$APPS_DIR/$APP/.service" ]]; then
  service_file="$APPS_DIR/$APP/.service"
  create_svc=true
fi

if [[ "$create_svc" == "true" ]]; then
  APP=$with_suffix METHOD="CREATESVC" SERVICEFILEPATH=$service_file python ./manage_apps.py
fi

in deploy.sh.

主要言語
言語のデータがありません
スター
4
フォーク
3
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

plotly/de-deploy のほかの issue

plotly/de-deploy の issue をすべて見る

似ている issue

DevOps の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。