更新jingrow仓库地址
This commit is contained in:
parent
d10fa6d044
commit
99fa89a1a0
2
.gitignore
vendored
2
.gitignore
vendored
@ -91,7 +91,7 @@ ipython_config.py
|
||||
# install all needed dependencies.
|
||||
#Pipfile.lock
|
||||
|
||||
# PEP 582; used by e.g. git.jingrow.com:3000/David-OConnor/pyflow
|
||||
# PEP 582; used by e.g. git.jingrow.com/David-OConnor/pyflow
|
||||
__pypackages__/
|
||||
|
||||
# Celery stuff
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
**Full Service Cloud Hosting For The Jingrow Stack - Powers Jingrow**
|
||||
|
||||
[](https://codecov.io/gh/jingrow/jcloud)
|
||||
[](http://git.jingrow.com:3000/jingrow/jcloud/actions/workflows/main.yaml)
|
||||
[](http://git.jingrow.com/jingrow/jcloud/actions/workflows/main.yaml)
|
||||
|
||||
</div>
|
||||
|
||||
@ -54,11 +54,11 @@ Additionally, customers lacked full control over their servers—no SSH access,
|
||||
|
||||
### Under the Hood
|
||||
|
||||
- [**Jingrow Framework**](http://git.jingrow.com:3000/jingrow/jingrow): A full-stack web application framework written in Python and Javascript. The framework provides a robust foundation for building web applications, including a database abstraction layer, user authentication, and a REST API.
|
||||
- [**Jingrow Framework**](http://git.jingrow.com/jingrow/jingrow): A full-stack web application framework written in Python and Javascript. The framework provides a robust foundation for building web applications, including a database abstraction layer, user authentication, and a REST API.
|
||||
|
||||
- [**Jingrow UI**](http://git.jingrow.com:3000/jingrow/jingrow-ui): A Vue-based UI library, to provide a modern user interface. The Jingrow UI library provides a variety of components that can be used to build single-page applications on top of the Jingrow Framework.
|
||||
- [**Jingrow UI**](http://git.jingrow.com/jingrow/jingrow-ui): A Vue-based UI library, to provide a modern user interface. The Jingrow UI library provides a variety of components that can be used to build single-page applications on top of the Jingrow Framework.
|
||||
|
||||
- [**Agent**](http://git.jingrow.com:3000/jingrow/agent): A flask app designed to work along with Jcloud. It provides a CLI interface for Jcloud to communicate with the sites and benches.
|
||||
- [**Agent**](http://git.jingrow.com/jingrow/agent): A flask app designed to work along with Jcloud. It provides a CLI interface for Jcloud to communicate with the sites and benches.
|
||||
|
||||
- [**Docker**](https://www.docker.com): An open-source platform that enables developers to build, package, and deploy applications in lightweight, portable containers.
|
||||
|
||||
|
||||
@ -49,8 +49,8 @@ def setup_libvirt():
|
||||
def setup_packer():
|
||||
shell.execute("brew tap hashicorp/tap")
|
||||
brew_install("hashicorp/tap/packer")
|
||||
shell.execute("packer plugins install git.jingrow.com:3000/hashicorp/qemu")
|
||||
shell.execute("packer plugins install git.jingrow.com:3000/hashicorp/vagrant")
|
||||
shell.execute("packer plugins install git.jingrow.com/hashicorp/qemu")
|
||||
shell.execute("packer plugins install git.jingrow.com/hashicorp/vagrant")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
@ -168,7 +168,7 @@ this.selectedBranch = {
|
||||
async checkRepoVisibility(owner, repo) {
|
||||
try {
|
||||
const response = await fetch(
|
||||
`http://git.jingrow.com:3000/api/v1/repos/${owner}/${repo}`
|
||||
`http://git.jingrow.com/api/v1/repos/${owner}/${repo}`
|
||||
);
|
||||
if (!response.ok) {
|
||||
throw new Error('仓库未找到或为私有');
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
Before we get into writing tests, please make sure you have pre-commit hook for
|
||||
styling tools setup so CI won't fail from these
|
||||
|
||||
Instructions [here](http://git.jingrow.com:3000/jingrow/jcloud/issues/424#issuecomment-1193375098)
|
||||
Instructions [here](http://git.jingrow.com/jingrow/jcloud/issues/424#issuecomment-1193375098)
|
||||
|
||||
# Writing Tests for Jcloud
|
||||
|
||||
@ -66,16 +66,16 @@ keep reading.
|
||||
|
||||
There's also a decorator you can use to fake the result of an agent job. For
|
||||
example, you may do it like so:
|
||||
http://git.jingrow.com:3000/jingrow/jcloud/blob/983631ccb59f88e57fd60fdad1615e9abd87d99f/jcloud/api/tests/test_site.py#L243-L247
|
||||
http://git.jingrow.com/jingrow/jcloud/blob/983631ccb59f88e57fd60fdad1615e9abd87d99f/jcloud/api/tests/test_site.py#L243-L247
|
||||
|
||||
This way you can use the name of the type of job and fake a response from the same.
|
||||
|
||||
You may also fake the output obtained from the job which you can then use to test the callback that uses the same:
|
||||
http://git.jingrow.com:3000/jingrow/jcloud/blob/983631ccb59f88e57fd60fdad1615e9abd87d99f/jcloud/api/tests/test_site.py#L305-L323
|
||||
http://git.jingrow.com/jingrow/jcloud/blob/983631ccb59f88e57fd60fdad1615e9abd87d99f/jcloud/api/tests/test_site.py#L305-L323
|
||||
|
||||
It is also possible to fake multiple jobs in the same context, for when multiple jobs are processed in the same request or job:
|
||||
|
||||
http://git.jingrow.com:3000/jingrow/jcloud/blob/983631ccb59f88e57fd60fdad1615e9abd87d99f/jcloud/jcloud/pagetype/site_migration/test_site_migration.py#L29-L77
|
||||
http://git.jingrow.com/jingrow/jcloud/blob/983631ccb59f88e57fd60fdad1615e9abd87d99f/jcloud/jcloud/pagetype/site_migration/test_site_migration.py#L29-L77
|
||||
|
||||
> Note that with this, you can't fake 2 results for the same type of job. This is still a limitation. As a workaround, you can have multiple `with` statements for such cases.
|
||||
|
||||
@ -112,7 +112,7 @@ tell what it's trying to test is supposed without even having to read the code.
|
||||
Making the method name small is pointless; we're never going to reference this
|
||||
method anywhere in code, ever. Eg:
|
||||
|
||||
http://git.jingrow.com:3000/jingrow/jcloud/blob/2503e523284fb905eca60acf3271d3fb1dccbc3f/jcloud/jcloud/pagetype/site/test_site.py#L215-L228
|
||||
http://git.jingrow.com/jingrow/jcloud/blob/2503e523284fb905eca60acf3271d3fb1dccbc3f/jcloud/jcloud/pagetype/site/test_site.py#L215-L228
|
||||
|
||||
You can also go the extra mile and write a function docstring. This docstring
|
||||
will be shown in the output when the testrunner detects that the test has
|
||||
@ -150,14 +150,14 @@ class TestBench(unittest.TestCase):
|
||||
|
||||
You can also use the patch decorator on test methods too. Eg:
|
||||
|
||||
http://git.jingrow.com:3000/jingrow/jcloud/blob/6dd6b2c8193b04f1aec1601d52ba09ce9dca8dfe/jcloud/tests/test_cleanup.py#L280-L290
|
||||
http://git.jingrow.com/jingrow/jcloud/blob/6dd6b2c8193b04f1aec1601d52ba09ce9dca8dfe/jcloud/tests/test_cleanup.py#L280-L290
|
||||
The decorator passes the mocked function (which is a `Mock()` object) along as
|
||||
an argument, so you can later do asserts on it (if you want to).
|
||||
|
||||
You can even use the decorator as context manager if you don't want to mock
|
||||
things for the entirety of the test.
|
||||
|
||||
http://git.jingrow.com:3000/jingrow/jcloud/blob/6dd6b2c8193b04f1aec1601d52ba09ce9dca8dfe/jcloud/tests/test_audit.py#L97-L102
|
||||
http://git.jingrow.com/jingrow/jcloud/blob/6dd6b2c8193b04f1aec1601d52ba09ce9dca8dfe/jcloud/tests/test_audit.py#L97-L102
|
||||
|
||||
Here, we're actually faking the output of the function which usually calls a
|
||||
remote endpoint that's out of our control by adding the `new` argument to the
|
||||
@ -174,7 +174,7 @@ method.
|
||||
> case you want to do asserts on it, you can use the `wraps` kwarg instead of
|
||||
> new). Eg:
|
||||
|
||||
http://git.jingrow.com:3000/jingrow/jcloud/blob/23711e2799f2d24dfd7bbe2b6cd148f54f4b253b/jcloud/jcloud/pagetype/database_server_mariadb_variable/test_database_server_mariadb_variable.py#L138-L155
|
||||
http://git.jingrow.com/jingrow/jcloud/blob/23711e2799f2d24dfd7bbe2b6cd148f54f4b253b/jcloud/jcloud/pagetype/database_server_mariadb_variable/test_database_server_mariadb_variable.py#L138-L155
|
||||
|
||||
Here, we check what args was Ansible constructor was called with.
|
||||
|
||||
@ -200,9 +200,9 @@ control/predict when the background job will run and finish. So, when your code
|
||||
involves creating a background job, we can simply mock the call so that it runs
|
||||
in foreground instead. There's a utility method you can use to achieve this with ease:
|
||||
|
||||
http://git.jingrow.com:3000/jingrow/jcloud/blob/23711e2799f2d24dfd7bbe2b6cd148f54f4b253b/jcloud/jcloud/pagetype/database_server_mariadb_variable/test_database_server_mariadb_variable.py#L12
|
||||
http://git.jingrow.com/jingrow/jcloud/blob/23711e2799f2d24dfd7bbe2b6cd148f54f4b253b/jcloud/jcloud/pagetype/database_server_mariadb_variable/test_database_server_mariadb_variable.py#L12
|
||||
|
||||
http://git.jingrow.com:3000/jingrow/jcloud/blob/23711e2799f2d24dfd7bbe2b6cd148f54f4b253b/jcloud/jcloud/pagetype/database_server_mariadb_variable/test_database_server_mariadb_variable.py#L104-L108
|
||||
http://git.jingrow.com/jingrow/jcloud/blob/23711e2799f2d24dfd7bbe2b6cd148f54f4b253b/jcloud/jcloud/pagetype/database_server_mariadb_variable/test_database_server_mariadb_variable.py#L104-L108
|
||||
|
||||
## Running tests
|
||||
|
||||
|
||||
@ -249,7 +249,7 @@ def send_email_with_verification_code(email, otp):
|
||||
args={
|
||||
"full_name": jingrow.get_value("User", email, "full_name"),
|
||||
"otp": otp,
|
||||
"image_path": "http://git.jingrow.com:3000/jingrow/gameplan/assets/9355208/447035d0-0686-41d2-910a-a3d21928ab94",
|
||||
"image_path": "http://git.jingrow.com/jingrow/gameplan/assets/9355208/447035d0-0686-41d2-910a-a3d21928ab94",
|
||||
},
|
||||
now=True,
|
||||
)
|
||||
|
||||
@ -75,7 +75,7 @@ def get_access_token(installation_id: str | None = None):
|
||||
"Accept": "application/vnd.github.machine-man-preview+json",
|
||||
}
|
||||
response = requests.post(
|
||||
f"http://git.jingrow.com:3000/api/v1/app/installations/{installation_id}/access_tokens",
|
||||
f"http://git.jingrow.com/api/v1/app/installations/{installation_id}/access_tokens",
|
||||
headers=headers,
|
||||
).json()
|
||||
return response.get("token")
|
||||
@ -111,7 +111,7 @@ def installations(token):
|
||||
"Authorization": f"token {token}",
|
||||
"Accept": "application/vnd.github.machine-man-preview+json",
|
||||
}
|
||||
response = requests.get("http://git.jingrow.com:3000/api/v1/user/installations", headers=headers)
|
||||
response = requests.get("http://git.jingrow.com/api/v1/user/installations", headers=headers)
|
||||
data = response.json()
|
||||
installations = []
|
||||
if response.ok:
|
||||
@ -140,7 +140,7 @@ def repositories(installation, token):
|
||||
current_page, is_last_page = 1, False
|
||||
while not is_last_page:
|
||||
response = requests.get(
|
||||
f"http://git.jingrow.com:3000/api/v1/user/installations/{installation}/repositories",
|
||||
f"http://git.jingrow.com/api/v1/user/installations/{installation}/repositories",
|
||||
params={"per_page": 100, "page": current_page},
|
||||
headers=headers,
|
||||
)
|
||||
@ -172,13 +172,13 @@ def repository(owner, name, installation=None):
|
||||
headers = {
|
||||
"Authorization": f"token {token}",
|
||||
}
|
||||
repo = requests.get(f"http://git.jingrow.com:3000/api/v1/repos/{owner}/{name}", headers=headers).json()
|
||||
repo = requests.get(f"http://git.jingrow.com/api/v1/repos/{owner}/{name}", headers=headers).json()
|
||||
|
||||
current_page, is_last_page = 1, False
|
||||
branches = []
|
||||
while not is_last_page:
|
||||
response = requests.get(
|
||||
f"http://git.jingrow.com:3000/api/v1/repos/{owner}/{name}/branches",
|
||||
f"http://git.jingrow.com/api/v1/repos/{owner}/{name}/branches",
|
||||
params={"per_page": 100, "page": current_page},
|
||||
headers=headers,
|
||||
)
|
||||
@ -201,7 +201,7 @@ def repository(owner, name, installation=None):
|
||||
def app(owner, repository, branch, installation=None):
|
||||
headers = get_auth_headers(installation)
|
||||
response = requests.get(
|
||||
f"http://git.jingrow.com:3000/api/v1/repos/{owner}/{repository}/branches/{branch}",
|
||||
f"http://git.jingrow.com/api/v1/repos/{owner}/{repository}/branches/{branch}",
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@ -211,7 +211,7 @@ def app(owner, repository, branch, installation=None):
|
||||
branch_info = response.json()
|
||||
sha = branch_info["commit"]["commit"]["tree"]["sha"]
|
||||
contents = requests.get(
|
||||
f"http://git.jingrow.com:3000/api/v1/repos/{owner}/{repository}/git/trees/{sha}",
|
||||
f"http://git.jingrow.com/api/v1/repos/{owner}/{repository}/git/trees/{sha}",
|
||||
params={"recursive": True},
|
||||
headers=headers,
|
||||
).json()
|
||||
@ -250,7 +250,7 @@ def branches(owner, name, installation=None):
|
||||
headers = {}
|
||||
|
||||
response = requests.get(
|
||||
f"http://git.jingrow.com:3000/api/v1/repos/{owner}/{name}/branches",
|
||||
f"http://git.jingrow.com/api/v1/repos/{owner}/{name}/branches",
|
||||
params={"per_page": 100},
|
||||
headers=headers,
|
||||
)
|
||||
@ -287,7 +287,7 @@ def _get_app_name_and_title_from_hooks(
|
||||
continue
|
||||
|
||||
hooks = requests.get(
|
||||
f"http://git.jingrow.com:3000/api/v1/repos/{owner}/{repository}/contents/{directory}/hooks.py",
|
||||
f"http://git.jingrow.com/api/v1/repos/{owner}/{repository}/contents/{directory}/hooks.py",
|
||||
params={"ref": branch_info["name"]},
|
||||
headers=headers,
|
||||
).json()
|
||||
|
||||
@ -89,7 +89,7 @@ def all(server_filter=None): # noqa: C901
|
||||
query = app_server_query + database_server_query
|
||||
|
||||
# union isn't supported in qb for run method
|
||||
# http://git.jingrow.com:3000/jingrow/jingrow/issues/15609
|
||||
# http://git.jingrow.com/jingrow/jingrow/issues/15609
|
||||
servers = jingrow.db.sql(query.get_sql(), as_dict=True)
|
||||
for server in servers:
|
||||
server_plan_name = jingrow.get_value("Server", server.name, "plan")
|
||||
|
||||
@ -47,7 +47,7 @@ class TestAPIBench(JingrowTestCase):
|
||||
self.app = create_test_app()
|
||||
self.app_source = self.app.add_source(
|
||||
self.version,
|
||||
repository_url="http://git.jingrow.com:3000/jingrow/jingrow",
|
||||
repository_url="http://git.jingrow.com/jingrow/jingrow",
|
||||
branch="version-15",
|
||||
team=get_current_team(),
|
||||
public=True,
|
||||
|
||||
@ -62,7 +62,7 @@ PAYLOAD = [
|
||||
"name": "develop",
|
||||
"commit": {
|
||||
"sha": "d11768d928ec7996810898cf627c4d57e8bb917d",
|
||||
"url": "http://git.jingrow.com:3000/api/v1/repos/jingrow/jingrow/commits/d11768d928ec7996810898cf627c4d57e8bb917d",
|
||||
"url": "http://git.jingrow.com/api/v1/repos/jingrow/jingrow/commits/d11768d928ec7996810898cf627c4d57e8bb917d",
|
||||
},
|
||||
"protected": True,
|
||||
},
|
||||
@ -70,7 +70,7 @@ PAYLOAD = [
|
||||
"name": "enterprise-staging",
|
||||
"commit": {
|
||||
"sha": "3716ef769bbb45d5376c5d6f6ed9a2d52583ef1c",
|
||||
"url": "http://git.jingrow.com:3000/api/v1/repos/jingrow/jingrow/commits/3716ef769bbb45d5376c5d6f6ed9a2d52583ef1c",
|
||||
"url": "http://git.jingrow.com/api/v1/repos/jingrow/jingrow/commits/3716ef769bbb45d5376c5d6f6ed9a2d52583ef1c",
|
||||
},
|
||||
"protected": False,
|
||||
},
|
||||
@ -297,7 +297,7 @@ class TestAPIMarketplace(unittest.TestCase):
|
||||
"name": "email_delivery_service",
|
||||
"title": "Email Delivery Service",
|
||||
"version": "v0.4",
|
||||
"repository_url": "http://git.jingrow.com:3000/jingrow/email_delivery_service",
|
||||
"repository_url": "http://git.jingrow.com/jingrow/email_delivery_service",
|
||||
"branch": "develop",
|
||||
"github_installation_id": "",
|
||||
}
|
||||
@ -365,7 +365,7 @@ class TestAPIMarketplace(unittest.TestCase):
|
||||
def test_branches(self):
|
||||
jingrow.set_user(self.team.user)
|
||||
responses.get(
|
||||
url=f"http://git.jingrow.com:3000/api/v1/repos/{self.app_source.repository_owner}/{self.app_source.repository}/branches?per_page=100",
|
||||
url=f"http://git.jingrow.com/api/v1/repos/{self.app_source.repository_owner}/{self.app_source.repository}/branches?per_page=100",
|
||||
json=PAYLOAD,
|
||||
status=200,
|
||||
headers={},
|
||||
|
||||
@ -327,7 +327,7 @@ def setup_apps():
|
||||
"pagetype": "App Source",
|
||||
"app": app.name,
|
||||
"branch": "develop",
|
||||
"repository_url": "http://git.jingrow.com:3000/jingrow/jingrow",
|
||||
"repository_url": "http://git.jingrow.com/jingrow/jingrow",
|
||||
"public": True,
|
||||
"team": "Administrator",
|
||||
"versions": [{"version": "v0.1"}],
|
||||
|
||||
@ -105,7 +105,7 @@ RUN curl -fsSL https://code-server.dev/install.sh | sh `#stage-pre-code-server`
|
||||
{% endif %}
|
||||
|
||||
# Install Fonts
|
||||
RUN git clone --progress --depth 1 http://git.jingrow.com:3000/jingrow/fonts.git /tmp/fonts \
|
||||
RUN git clone --progress --depth 1 http://git.jingrow.com/jingrow/fonts.git /tmp/fonts \
|
||||
&& rm -rf /etc/fonts && mv /tmp/fonts/etc_fonts /etc/fonts \
|
||||
&& rm -rf /usr/share/fonts && mv /tmp/fonts/usr_share_fonts /usr/share/fonts \
|
||||
&& rm -rf /tmp/fonts \
|
||||
@ -188,7 +188,7 @@ RUN python${PYTHON_VERSION} -m pip install --upgrade pip `#stage-pre-pip-upgrade
|
||||
RUN python${PYTHON_VERSION} -m pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple `#stage-pre-pip-mirror`
|
||||
RUN python${PYTHON_VERSION} -m pip config set global.trusted-host pypi.tuna.tsinghua.edu.cn `#stage-pre-pip-trusted`
|
||||
ENV {{ pg.get_dependency_version("bench", True) }}
|
||||
RUN --mount=type=cache,target=/home/jingrow/.cache,uid=1000,gid=1000 python${PYTHON_VERSION} -m pip install --upgrade --resume-retries 5 --timeout 100 git+http://git.jingrow.com:3000/jingrow/bench.git `#stage-bench-bench`
|
||||
RUN --mount=type=cache,target=/home/jingrow/.cache,uid=1000,gid=1000 python${PYTHON_VERSION} -m pip install --upgrade --resume-retries 5 --timeout 100 git+http://git.jingrow.com/jingrow/bench.git `#stage-bench-bench`
|
||||
|
||||
RUN --mount=type=cache,target=/home/jingrow/.cache,uid=1000,gid=1000 python${PYTHON_VERSION} -m pip install Jinja2~=3.0.3
|
||||
RUN --mount=type=cache,target=/home/jingrow/.cache,uid=1000,gid=1000 python${PYTHON_VERSION} -m pip install --upgrade setuptools
|
||||
|
||||
@ -93,7 +93,7 @@ RUN wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/${WKHTMLTO
|
||||
RUN curl -fsSL https://code-server.dev/install.sh | sh `#stage-pre-code-server`
|
||||
|
||||
# Install Fonts
|
||||
RUN git clone --progress --depth 1 http://git.jingrow.com:3000/jingrow/fonts.git /tmp/fonts \
|
||||
RUN git clone --progress --depth 1 http://git.jingrow.com/jingrow/fonts.git /tmp/fonts \
|
||||
&& rm -rf /etc/fonts && mv /tmp/fonts/etc_fonts /etc/fonts \
|
||||
&& rm -rf /usr/share/fonts && mv /tmp/fonts/usr_share_fonts /usr/share/fonts \
|
||||
&& rm -rf /tmp/fonts \
|
||||
|
||||
@ -206,7 +206,7 @@ class AccountRequest(Document):
|
||||
if not args.get("image_path"):
|
||||
args.update(
|
||||
{
|
||||
"image_path": "http://git.jingrow.com:3000/jingrow/gameplan/assets/9355208/447035d0-0686-41d2-910a-a3d21928ab94"
|
||||
"image_path": "http://git.jingrow.com/jingrow/gameplan/assets/9355208/447035d0-0686-41d2-910a-a3d21928ab94"
|
||||
}
|
||||
)
|
||||
# Telemetry: Verification Email Sent
|
||||
|
||||
@ -12,7 +12,7 @@ import jingrow
|
||||
Used to create notifications if the Agent Job error is something that can
|
||||
be handled by the user.
|
||||
|
||||
Based on http://git.jingrow.com:3000/jingrow/jcloud/pull/1544
|
||||
Based on http://git.jingrow.com/jingrow/jcloud/pull/1544
|
||||
|
||||
To handle an error:
|
||||
1. Create a pg page that helps the user get out of it under: jingrow.com/docs/common-issues
|
||||
|
||||
@ -30,7 +30,7 @@ class TestApp(unittest.TestCase):
|
||||
|
||||
source = app.add_source(
|
||||
"v0.2",
|
||||
"http://git.jingrow.com:3000/jingrow/jingrow",
|
||||
"http://git.jingrow.com/jingrow/jingrow",
|
||||
"version-12",
|
||||
create_test_team().name,
|
||||
)
|
||||
@ -46,7 +46,7 @@ class TestApp(unittest.TestCase):
|
||||
|
||||
source = app.add_source(
|
||||
"v0.2",
|
||||
"http://git.jingrow.com:3000/jingrow/jerp",
|
||||
"http://git.jingrow.com/jingrow/jerp",
|
||||
"version-12",
|
||||
create_test_team().name,
|
||||
)
|
||||
@ -61,13 +61,13 @@ class TestApp(unittest.TestCase):
|
||||
|
||||
source_1 = app.add_source(
|
||||
"v0.2",
|
||||
"http://git.jingrow.com:3000/jingrow/jingrow",
|
||||
"http://git.jingrow.com/jingrow/jingrow",
|
||||
"version-12",
|
||||
create_test_team().name,
|
||||
)
|
||||
source_2 = app.add_source(
|
||||
"v0.3",
|
||||
"http://git.jingrow.com:3000/jingrow/jingrow",
|
||||
"http://git.jingrow.com/jingrow/jingrow",
|
||||
"version-13",
|
||||
create_test_team().name,
|
||||
)
|
||||
@ -85,7 +85,7 @@ class TestApp(unittest.TestCase):
|
||||
|
||||
source_1 = app.add_source(
|
||||
"v0.2",
|
||||
"http://git.jingrow.com:3000/jingrow/jerp_documentation",
|
||||
"http://git.jingrow.com/jingrow/jerp_documentation",
|
||||
"master",
|
||||
team_name,
|
||||
)
|
||||
@ -95,7 +95,7 @@ class TestApp(unittest.TestCase):
|
||||
|
||||
source_2 = app.add_source(
|
||||
"v0.3",
|
||||
"http://git.jingrow.com:3000/jingrow/jerp_documentation",
|
||||
"http://git.jingrow.com/jingrow/jerp_documentation",
|
||||
"master",
|
||||
team_name,
|
||||
)
|
||||
@ -109,7 +109,7 @@ class TestApp(unittest.TestCase):
|
||||
app = create_test_app("jingrow", "Jingrow Framework")
|
||||
source_1 = app.add_source(
|
||||
"v0.2",
|
||||
"http://git.jingrow.com:3000/jingrow/jingrow",
|
||||
"http://git.jingrow.com/jingrow/jingrow",
|
||||
"version-12",
|
||||
create_test_team().name,
|
||||
)
|
||||
@ -119,7 +119,7 @@ class TestApp(unittest.TestCase):
|
||||
|
||||
source_2 = app.add_source(
|
||||
"v0.3",
|
||||
"http://git.jingrow.com:3000/jingrow/jingrow",
|
||||
"http://git.jingrow.com/jingrow/jingrow",
|
||||
"version-13",
|
||||
create_test_team().name,
|
||||
)
|
||||
|
||||
@ -223,7 +223,7 @@ class AppRelease(Document):
|
||||
# Do not edit without updating deploy_notifications.py
|
||||
raise Exception("App installation token could not be fetched", self.app)
|
||||
|
||||
return f"https://x-access-token:{token}@git.jingrow.com:3000/{source.repository_owner}/{source.repository}"
|
||||
return f"https://x-access-token:{token}@git.jingrow.com/{source.repository_owner}/{source.repository}"
|
||||
|
||||
def on_trash(self):
|
||||
if self.clone_directory and os.path.exists(self.clone_directory):
|
||||
|
||||
@ -93,7 +93,7 @@ class AppSource(Document):
|
||||
versions.add(row.version)
|
||||
|
||||
def before_save(self):
|
||||
# Assumes repository_url looks like http://git.jingrow.com:3000/jingrow/jerp
|
||||
# Assumes repository_url looks like http://git.jingrow.com/jingrow/jerp
|
||||
self.repository_url = self.repository_url.removesuffix(".git")
|
||||
|
||||
_, self.repository_owner, self.repository = self.repository_url.rsplit("/", 2)
|
||||
@ -198,7 +198,7 @@ class AppSource(Document):
|
||||
def poll_gitea(self, commit_hash: None | str = None) -> requests.Response:
|
||||
"""专门用于Gitea API的请求函数"""
|
||||
headers = self.get_auth_headers()
|
||||
git_url = jingrow.db.get_single_value("Jcloud Settings", "git_url") or "http://git.jingrow.com:3000"
|
||||
git_url = jingrow.db.get_single_value("Jcloud Settings", "git_url") or "http://git.jingrow.com"
|
||||
url = f"{git_url}/api/v1/repos/{self.repository_owner}/{self.repository}"
|
||||
|
||||
if commit_hash:
|
||||
@ -254,7 +254,7 @@ class AppSource(Document):
|
||||
# Do not edit without updating deploy_notifications.py
|
||||
raise Exception("App installation token could not be fetched", self.app)
|
||||
|
||||
return f"https://x-access-token:{token}@git.jingrow.com:3000/{self.repository_owner}/{self.repository}"
|
||||
return f"https://x-access-token:{token}@git.jingrow.com/{self.repository_owner}/{self.repository}"
|
||||
|
||||
def get_gitea_commit_info(self, commit_hash: None | str = None) -> tuple[str, dict, bool]:
|
||||
"""专门处理Gitea API响应的函数"""
|
||||
|
||||
@ -18,7 +18,7 @@ from jcloud.jcloud.pagetype.deploy_candidate.utils import (
|
||||
Used to create notifications if the Deploy error is something that can
|
||||
be handled by the user.
|
||||
|
||||
Ref: http://git.jingrow.com:3000/jingrow/jcloud/pull/1544
|
||||
Ref: http://git.jingrow.com/jingrow/jcloud/pull/1544
|
||||
|
||||
To handle an error:
|
||||
1. Create a pg page that helps the user get out of it under: jingrow.com/docs/common-issues
|
||||
|
||||
@ -316,14 +316,14 @@ def create_cache_test_release_group(
|
||||
def create_cache_test_apps(team: "Team") -> dict[str, "AppInfo"]:
|
||||
info = [
|
||||
(
|
||||
"http://git.jingrow.com:3000/jingrow/jingrow",
|
||||
"http://git.jingrow.com/jingrow/jingrow",
|
||||
"Jingrow Framework",
|
||||
"v0.1",
|
||||
"develop",
|
||||
"d26c67df75a95ef43d329eadd48d7998ea656856",
|
||||
),
|
||||
(
|
||||
"http://git.jingrow.com:3000/jingrow/wiki",
|
||||
"http://git.jingrow.com/jingrow/wiki",
|
||||
"Jingrow Wiki",
|
||||
"v0.1",
|
||||
"master",
|
||||
|
||||
@ -235,9 +235,9 @@ class JcloudSettings(Document):
|
||||
"default_events": ["create", "push", "release"],
|
||||
"default_permissions": {"contents": "read"},
|
||||
# These keys aren't documented under the app creation from manifest
|
||||
# https://docs.git.jingrow.com:3000/en/free-pro-team@latest/developers/apps/creating-a-github-app-from-a-manifest
|
||||
# https://docs.git.jingrow.com/en/free-pro-team@latest/developers/apps/creating-a-github-app-from-a-manifest
|
||||
# But are shown under app creation using url parameters
|
||||
# https://docs.git.jingrow.com:3000/en/free-pro-team@latest/developers/apps/creating-a-github-app-using-url-parameters
|
||||
# https://docs.git.jingrow.com/en/free-pro-team@latest/developers/apps/creating-a-github-app-using-url-parameters
|
||||
# They seem to work. This might change later
|
||||
"callback_url": get_url("github/authorize"),
|
||||
"request_oauth_on_install": True,
|
||||
|
||||
@ -296,7 +296,7 @@ class MarketplaceApp(WebsiteGenerator):
|
||||
for variant in variants:
|
||||
try:
|
||||
readme = requests.get(
|
||||
f"http://git.jingrow.com:3000/api/v1/repos/{owner}/{repository}/contents/{variant}",
|
||||
f"http://git.jingrow.com/api/v1/repos/{owner}/{repository}/contents/{variant}",
|
||||
headers=headers,
|
||||
params={"ref": branch},
|
||||
).json()
|
||||
|
||||
@ -70,7 +70,7 @@ class TestReleaseGroup(unittest.TestCase):
|
||||
def test_create_release_group(self):
|
||||
app = create_test_app("jingrow", "Jingrow Framework")
|
||||
source = app.add_source(
|
||||
"v0.2", "http://git.jingrow.com:3000/jingrow/jingrow", "version-12", team=self.team
|
||||
"v0.2", "http://git.jingrow.com/jingrow/jingrow", "version-12", team=self.team
|
||||
)
|
||||
group = new_release_group(
|
||||
"Test Group",
|
||||
@ -83,11 +83,11 @@ class TestReleaseGroup(unittest.TestCase):
|
||||
def test_create_release_group_set_app_from_source(self):
|
||||
app1 = create_test_app("jingrow", "Jingrow Framework")
|
||||
source1 = app1.add_source(
|
||||
"v0.2", "http://git.jingrow.com:3000/jingrow/jingrow", "version-12", team=self.team
|
||||
"v0.2", "http://git.jingrow.com/jingrow/jingrow", "version-12", team=self.team
|
||||
)
|
||||
app2 = create_test_app("jerp", "JERP")
|
||||
source2 = app2.add_source(
|
||||
"v0.2", "http://git.jingrow.com:3000/jingrow/jerp", "version-12", team=self.team
|
||||
"v0.2", "http://git.jingrow.com/jingrow/jerp", "version-12", team=self.team
|
||||
)
|
||||
group = new_release_group(
|
||||
"Test Group",
|
||||
@ -100,7 +100,7 @@ class TestReleaseGroup(unittest.TestCase):
|
||||
def test_create_release_group_fail_when_first_app_is_not_jingrow(self):
|
||||
app = create_test_app("jerp", "JERP")
|
||||
source = app.add_source(
|
||||
"v0.2", "http://git.jingrow.com:3000/jingrow/jerp", "version-12", team=self.team
|
||||
"v0.2", "http://git.jingrow.com/jingrow/jerp", "version-12", team=self.team
|
||||
)
|
||||
self.assertRaises(
|
||||
jingrow.ValidationError,
|
||||
@ -114,7 +114,7 @@ class TestReleaseGroup(unittest.TestCase):
|
||||
def test_create_release_group_fail_when_duplicate_apps(self):
|
||||
app = create_test_app("jingrow", "Jingrow Framework")
|
||||
source = app.add_source(
|
||||
"v0.2", "http://git.jingrow.com:3000/jingrow/jingrow", "version-12", team=self.team
|
||||
"v0.2", "http://git.jingrow.com/jingrow/jingrow", "version-12", team=self.team
|
||||
)
|
||||
self.assertRaises(
|
||||
jingrow.ValidationError,
|
||||
@ -131,7 +131,7 @@ class TestReleaseGroup(unittest.TestCase):
|
||||
def test_create_release_group_fail_when_version_mismatch(self):
|
||||
app = create_test_app("jingrow", "Jingrow Framework")
|
||||
source = app.add_source(
|
||||
"v0.2", "http://git.jingrow.com:3000/jingrow/jingrow", "version-12", team=self.team
|
||||
"v0.2", "http://git.jingrow.com/jingrow/jingrow", "version-12", team=self.team
|
||||
)
|
||||
self.assertRaises(
|
||||
jingrow.ValidationError,
|
||||
@ -145,7 +145,7 @@ class TestReleaseGroup(unittest.TestCase):
|
||||
def test_create_release_group_fail_with_duplicate_titles(self):
|
||||
app = create_test_app("jingrow", "Jingrow Framework")
|
||||
source = app.add_source(
|
||||
"v0.2", "http://git.jingrow.com:3000/jingrow/jingrow", "version-12", team=self.team
|
||||
"v0.2", "http://git.jingrow.com/jingrow/jingrow", "version-12", team=self.team
|
||||
)
|
||||
new_release_group(
|
||||
"Test Group",
|
||||
|
||||
@ -459,7 +459,7 @@ class BaseServer(Document, TagHelpers):
|
||||
def get_agent_repository_url(self):
|
||||
settings = jingrow.get_single("Jcloud Settings")
|
||||
repository_owner = settings.agent_repository_owner or "jingrow"
|
||||
return f"http://git.jingrow.com:3000/{repository_owner}/agent"
|
||||
return f"http://git.jingrow.com/{repository_owner}/agent"
|
||||
|
||||
def get_agent_repository_branch(self):
|
||||
settings = jingrow.get_single("Jcloud Settings")
|
||||
|
||||
@ -48,7 +48,7 @@ class SiteUserSession(Document):
|
||||
args.update(
|
||||
{
|
||||
"otp": self.otp,
|
||||
"image_path": "http://git.jingrow.com:3000/jingrow/gameplan/assets/9355208/447035d0-0686-41d2-910a-a3d21928ab94",
|
||||
"image_path": "http://git.jingrow.com/jingrow/gameplan/assets/9355208/447035d0-0686-41d2-910a-a3d21928ab94",
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@ -40,13 +40,13 @@ def send_emails(columns, data):
|
||||
|
||||
def check_repository_visibility(repository_url, personal_access_token):
|
||||
try:
|
||||
repo_parts = repository_url.split("git.jingrow.com:3000/")[1].rstrip(".git").split("/")
|
||||
repo_parts = repository_url.split("git.jingrow.com/")[1].rstrip(".git").split("/")
|
||||
owner = repo_parts[0]
|
||||
repo_name = repo_parts[1]
|
||||
except IndexError:
|
||||
return "Error: Invalid repository URL format."
|
||||
|
||||
api_url = f"http://git.jingrow.com:3000/api/v1/repos/{owner}/{repo_name}"
|
||||
api_url = f"http://git.jingrow.com/api/v1/repos/{owner}/{repo_name}"
|
||||
|
||||
headers = {"Authorization": f"token {personal_access_token}"}
|
||||
|
||||
|
||||
@ -52,17 +52,17 @@ If `is_standby` field is checked, that site can be allocated to a user.
|
||||
- **Redirect To After Login** - After SaaS signup/login, user is directly logged-in to his site. By default, we redirect the user to desk of site. With this option, we can configure the redirect path. For example, for gameplan the path would be `/g`
|
||||
|
||||
#### FC Dashboard
|
||||
- UI/UX - The pages are available in http://git.jingrow.com:3000/jingrow/jcloud/tree/master/dashboard/src2/pages/saas
|
||||
- The required apis for these pages are available in http://git.jingrow.com:3000/jingrow/jcloud/blob/master/jcloud/api/product_trial.py
|
||||
- UI/UX - The pages are available in http://git.jingrow.com/jingrow/jcloud/tree/master/dashboard/src2/pages/saas
|
||||
- The required apis for these pages are available in http://git.jingrow.com/jingrow/jcloud/blob/master/jcloud/api/product_trial.py
|
||||
|
||||
#### Billing APIs for Integration in Framework
|
||||
|
||||
> [!CAUTION]
|
||||
> Changes in any of these APIs can cause disruption in on-site billing system.
|
||||
|
||||
- All the required APIs for billing in site is available in http://git.jingrow.com:3000/jingrow/jcloud/tree/master/jcloud/saas/api
|
||||
- These APIs use a different type of authentication mechanism. Check this readme for more info http://git.jingrow.com:3000/jingrow/jcloud/blob/master/jcloud/saas/api/readme.md
|
||||
- All the required APIs for billing in site is available in http://git.jingrow.com/jingrow/jcloud/tree/master/jcloud/saas/api
|
||||
- These APIs use a different type of authentication mechanism. Check this readme for more info http://git.jingrow.com/jingrow/jcloud/blob/master/jcloud/saas/api/readme.md
|
||||
- Reference of integration in framework
|
||||
- http://git.jingrow.com:3000/jingrow/jingrow/tree/develop/billing
|
||||
- http://git.jingrow.com:3000/jingrow/jingrow/blob/develop/jingrow/integrations/jingrow_providers/jingrowcloud_billing.py
|
||||
- http://git.jingrow.com/jingrow/jingrow/tree/develop/billing
|
||||
- http://git.jingrow.com/jingrow/jingrow/blob/develop/jingrow/integrations/jingrow_providers/jingrowcloud_billing.py
|
||||
|
||||
|
||||
@ -16,7 +16,7 @@ def get_context(context):
|
||||
headers = {"Accept": "application/vnd.github.v3+json"}
|
||||
response = jingrow._dict(
|
||||
requests.post(
|
||||
f"http://git.jingrow.com:3000/api/v1/app-manifests/{code}/conversions", headers=headers
|
||||
f"http://git.jingrow.com/api/v1/app-manifests/{code}/conversions", headers=headers
|
||||
).json()
|
||||
)
|
||||
|
||||
|
||||
@ -52,7 +52,7 @@ After setting these, click **Obtain TLS Certificate** (Requires **Basic** > **Do
|
||||
1. Create a GitHub Personal Access Token and add it in GitHub Access Token field.
|
||||
|
||||
This is nedded for custom apps that are added without using the app creation flow (Dashboard > New App... ).
|
||||
As these are subject stricter [rate limits](https://docs.git.jingrow.com:3000/en/free-pro-team@latest/rest/overview/resources-in-the-rest-api#rate-limiting) (5000 requests/hour vs 60 requests/hour).
|
||||
As these are subject stricter [rate limits](https://docs.git.jingrow.com/en/free-pro-team@latest/rest/overview/resources-in-the-rest-api#rate-limiting) (5000 requests/hour vs 60 requests/hour).
|
||||
|
||||
### Docker
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user