Add support for `.service` file

Đang mở
#5 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
bash, python
Lĩnh vực
ci-cd, devops

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Không có dữ liệu ngôn ngữ
Star
4
Fork
3
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của plotly/de-deploy

Tất cả issue của plotly/de-deploy

Issue tương tự

Thêm issue về DevOps

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.