refactor some logic for ce-farm
This commit is contained in:
parent
831f64b098
commit
47f54be7b9
2
.github/obfarm/Dockerfile
vendored
2
.github/obfarm/Dockerfile
vendored
@ -1,7 +1,7 @@
|
||||
# Container image that runs your code
|
||||
FROM python:3.6
|
||||
|
||||
RUN pip3 install requests -i https://mirrors.aliyun.com/pypi/simple/
|
||||
RUN pip3 install requests -i https://mirrors.aliyun.com/pypi/simple/ && pip3 install art -i https://mirrors.aliyun.com/pypi/simple/
|
||||
# Copies your code file from your action repository to the filesystem path `/` of the container
|
||||
COPY obfarm.py /obfarm.py
|
||||
|
||||
|
5
.github/obfarm/obfarm.py
vendored
5
.github/obfarm/obfarm.py
vendored
@ -4,12 +4,13 @@ import os
|
||||
import sys
|
||||
import traceback
|
||||
import time
|
||||
|
||||
import json
|
||||
import requests
|
||||
from enum import Enum
|
||||
from http import HTTPStatus
|
||||
|
||||
from art import text2art
|
||||
|
||||
OUTPUT = {}
|
||||
RESULT_FILE_KEY = "farm/ob_results/"
|
||||
TASK_QUEUE_FILE_KEY = "farm/ob_jobs/{}.json"
|
||||
@ -169,6 +170,8 @@ def get_task_res(oss_proxy: OssProxy, github_pipeline_id):
|
||||
def main(pipeline_id, project, timeout):
|
||||
print("create a new task")
|
||||
print("working....")
|
||||
logo = text2art('OceanBase Farm')
|
||||
print(logo)
|
||||
oss_proxy = OssProxy("https://obfarm-ce.oss-cn-hongkong.aliyuncs.com")
|
||||
github_proxy = GithubProxy()
|
||||
job_info = github_proxy.get_job_by_id(project, pipeline_id)
|
||||
|
Loading…
x
Reference in New Issue
Block a user