ol-openedx-git-auto-export 0.7.0__tar.gz → 0.7.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {ol_openedx_git_auto_export-0.7.0 → ol_openedx_git_auto_export-0.7.1}/PKG-INFO +1 -1
- ol_openedx_git_auto_export-0.7.1/ol_openedx_git_auto_export/settings/common.py +22 -0
- ol_openedx_git_auto_export-0.7.1/ol_openedx_git_auto_export/settings/production.py +22 -0
- {ol_openedx_git_auto_export-0.7.0 → ol_openedx_git_auto_export-0.7.1}/ol_openedx_git_auto_export/tasks.py +3 -1
- {ol_openedx_git_auto_export-0.7.0 → ol_openedx_git_auto_export-0.7.1}/pyproject.toml +1 -1
- ol_openedx_git_auto_export-0.7.0/ol_openedx_git_auto_export/settings/common.py +0 -15
- ol_openedx_git_auto_export-0.7.0/ol_openedx_git_auto_export/settings/production.py +0 -15
- {ol_openedx_git_auto_export-0.7.0 → ol_openedx_git_auto_export-0.7.1}/.gitignore +0 -0
- {ol_openedx_git_auto_export-0.7.0 → ol_openedx_git_auto_export-0.7.1}/LICENSE +0 -0
- {ol_openedx_git_auto_export-0.7.0 → ol_openedx_git_auto_export-0.7.1}/README.rst +0 -0
- {ol_openedx_git_auto_export-0.7.0 → ol_openedx_git_auto_export-0.7.1}/ol_openedx_git_auto_export/__init__.py +0 -0
- {ol_openedx_git_auto_export-0.7.0 → ol_openedx_git_auto_export-0.7.1}/ol_openedx_git_auto_export/admin.py +0 -0
- {ol_openedx_git_auto_export-0.7.0 → ol_openedx_git_auto_export-0.7.1}/ol_openedx_git_auto_export/app.py +0 -0
- {ol_openedx_git_auto_export-0.7.0 → ol_openedx_git_auto_export-0.7.1}/ol_openedx_git_auto_export/constants.py +0 -0
- {ol_openedx_git_auto_export-0.7.0 → ol_openedx_git_auto_export-0.7.1}/ol_openedx_git_auto_export/management/commands/__init__.py +0 -0
- {ol_openedx_git_auto_export-0.7.0 → ol_openedx_git_auto_export-0.7.1}/ol_openedx_git_auto_export/management/commands/migrate_giturl.py +0 -0
- {ol_openedx_git_auto_export-0.7.0 → ol_openedx_git_auto_export-0.7.1}/ol_openedx_git_auto_export/migrations/0001_initial.py +0 -0
- {ol_openedx_git_auto_export-0.7.0 → ol_openedx_git_auto_export-0.7.1}/ol_openedx_git_auto_export/migrations/__init__.py +0 -0
- {ol_openedx_git_auto_export-0.7.0 → ol_openedx_git_auto_export-0.7.1}/ol_openedx_git_auto_export/models.py +0 -0
- {ol_openedx_git_auto_export-0.7.0 → ol_openedx_git_auto_export-0.7.1}/ol_openedx_git_auto_export/settings/__init__.py +0 -0
- {ol_openedx_git_auto_export-0.7.0 → ol_openedx_git_auto_export-0.7.1}/ol_openedx_git_auto_export/signals.py +0 -0
- {ol_openedx_git_auto_export-0.7.0 → ol_openedx_git_auto_export-0.7.1}/ol_openedx_git_auto_export/utils.py +0 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"""Common settings unique to the git auto export plugin."""
|
|
2
|
+
|
|
3
|
+
from ol_openedx_git_auto_export.constants import (
|
|
4
|
+
ENABLE_AUTO_GITHUB_REPO_CREATION,
|
|
5
|
+
ENABLE_GIT_AUTO_EXPORT,
|
|
6
|
+
)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def plugin_settings(settings):
|
|
10
|
+
"""Settings for the git auto export plugin.""" # noqa: D401
|
|
11
|
+
env_tokens = getattr(settings, "ENV_TOKENS", {})
|
|
12
|
+
settings.GIT_REPO_EXPORT_DIR = env_tokens.get(
|
|
13
|
+
"GIT_REPO_EXPORT_DIR", "/openedx/export_course_repos"
|
|
14
|
+
)
|
|
15
|
+
settings.GITHUB_ORG_API_URL = env_tokens.get("GITHUB_ORG_API_URL", "")
|
|
16
|
+
settings.GITHUB_ACCESS_TOKEN = env_tokens.get("GITHUB_ACCESS_TOKEN")
|
|
17
|
+
settings.FEATURES[ENABLE_GIT_AUTO_EXPORT] = env_tokens.get("FEATURES", {}).get(
|
|
18
|
+
ENABLE_GIT_AUTO_EXPORT, True
|
|
19
|
+
)
|
|
20
|
+
settings.FEATURES[ENABLE_AUTO_GITHUB_REPO_CREATION] = env_tokens.get(
|
|
21
|
+
"FEATURES", {}
|
|
22
|
+
).get(ENABLE_AUTO_GITHUB_REPO_CREATION, False)
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"""Production settings unique to the git auto export plugin."""
|
|
2
|
+
|
|
3
|
+
from ol_openedx_git_auto_export.constants import (
|
|
4
|
+
ENABLE_AUTO_GITHUB_REPO_CREATION,
|
|
5
|
+
ENABLE_GIT_AUTO_EXPORT,
|
|
6
|
+
)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def plugin_settings(settings):
|
|
10
|
+
"""Settings for the git auto export plugin.""" # noqa: D401
|
|
11
|
+
env_tokens = getattr(settings, "ENV_TOKENS", {})
|
|
12
|
+
settings.GIT_REPO_EXPORT_DIR = env_tokens.get(
|
|
13
|
+
"GIT_REPO_EXPORT_DIR", "/openedx/export_course_repos"
|
|
14
|
+
)
|
|
15
|
+
settings.GITHUB_ORG_API_URL = env_tokens.get("GITHUB_ORG_API_URL", "")
|
|
16
|
+
settings.GITHUB_ACCESS_TOKEN = env_tokens.get("GITHUB_ACCESS_TOKEN")
|
|
17
|
+
settings.FEATURES[ENABLE_GIT_AUTO_EXPORT] = env_tokens.get("FEATURES", {}).get(
|
|
18
|
+
ENABLE_GIT_AUTO_EXPORT, True
|
|
19
|
+
)
|
|
20
|
+
settings.FEATURES[ENABLE_AUTO_GITHUB_REPO_CREATION] = env_tokens.get(
|
|
21
|
+
"FEATURES", {}
|
|
22
|
+
).get(ENABLE_AUTO_GITHUB_REPO_CREATION, False)
|
|
@@ -18,6 +18,7 @@ from ol_openedx_git_auto_export.models import CourseGitRepository
|
|
|
18
18
|
from ol_openedx_git_auto_export.utils import (
|
|
19
19
|
export_course_to_git,
|
|
20
20
|
github_repo_name_format,
|
|
21
|
+
is_auto_repo_creation_enabled,
|
|
21
22
|
)
|
|
22
23
|
|
|
23
24
|
LOGGER = get_task_logger(__name__)
|
|
@@ -55,7 +56,8 @@ def async_export_to_git(course_key_string, user=None):
|
|
|
55
56
|
"Creating repository and exporting course content.",
|
|
56
57
|
course_key_string,
|
|
57
58
|
)
|
|
58
|
-
|
|
59
|
+
if is_auto_repo_creation_enabled():
|
|
60
|
+
async_create_github_repo.delay(str(course_key), export_course=True)
|
|
59
61
|
except Exception:
|
|
60
62
|
LOGGER.exception(
|
|
61
63
|
"Unknown error occured during async course content export to git (course id: %s)", # noqa: E501
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"""Common settings unique to the git auto export plugin."""
|
|
2
|
-
|
|
3
|
-
from ol_openedx_git_auto_export.constants import (
|
|
4
|
-
ENABLE_AUTO_GITHUB_REPO_CREATION,
|
|
5
|
-
ENABLE_GIT_AUTO_EXPORT,
|
|
6
|
-
)
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
def plugin_settings(settings):
|
|
10
|
-
"""Settings for the git auto export plugin.""" # noqa: D401
|
|
11
|
-
settings.GIT_REPO_EXPORT_DIR = "/openedx/export_course_repos"
|
|
12
|
-
settings.GITHUB_ORG_API_URL = "https://github.mit.edu/api/v3/orgs/mitodl"
|
|
13
|
-
settings.GITHUB_ACCESS_TOKEN = "token" # noqa: S105
|
|
14
|
-
settings.FEATURES[ENABLE_GIT_AUTO_EXPORT] = True
|
|
15
|
-
settings.FEATURES[ENABLE_AUTO_GITHUB_REPO_CREATION] = False
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"""Production settings unique to the git auto export plugin."""
|
|
2
|
-
|
|
3
|
-
from ol_openedx_git_auto_export.constants import (
|
|
4
|
-
ENABLE_AUTO_GITHUB_REPO_CREATION,
|
|
5
|
-
ENABLE_GIT_AUTO_EXPORT,
|
|
6
|
-
)
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
def plugin_settings(settings):
|
|
10
|
-
"""Settings for the git auto export plugin.""" # noqa: D401
|
|
11
|
-
settings.GIT_REPO_EXPORT_DIR = "/openedx/export_course_repos"
|
|
12
|
-
settings.GITHUB_ORG_API_URL = "https://github.mit.edu/api/v3/orgs/mitodl"
|
|
13
|
-
settings.GITHUB_ACCESS_TOKEN = "token" # noqa: S105
|
|
14
|
-
settings.FEATURES[ENABLE_GIT_AUTO_EXPORT] = True
|
|
15
|
-
settings.FEATURES[ENABLE_AUTO_GITHUB_REPO_CREATION] = False
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|