v14.0.0: upgrade to nutmeg
The app is upgraded to v3.0.2. Version v3.1.0 was not functional in our experiment: it was crashing on every run.
This commit is contained in:
parent
e165bf04ea
commit
c2d05ef635
8
setup.py
8
setup.py
@ -38,10 +38,10 @@ setup(
|
|||||||
long_description=load_readme(),
|
long_description=load_readme(),
|
||||||
packages=find_packages(exclude=["tests*"]),
|
packages=find_packages(exclude=["tests*"]),
|
||||||
include_package_data=True,
|
include_package_data=True,
|
||||||
python_requires=">=3.5",
|
python_requires=">=3.7",
|
||||||
install_requires=["tutor>=13.0.0,<14.0.0"],
|
install_requires=["tutor>=14.0.0,<15.0.0"],
|
||||||
entry_points={
|
entry_points={
|
||||||
"tutor.plugin.v0": [
|
"tutor.plugin.v1": [
|
||||||
"android = tutorandroid.plugin"
|
"android = tutorandroid.plugin"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -51,8 +51,6 @@ setup(
|
|||||||
"License :: OSI Approved :: GNU Affero General Public License v3",
|
"License :: OSI Approved :: GNU Affero General Public License v3",
|
||||||
"Operating System :: OS Independent",
|
"Operating System :: OS Independent",
|
||||||
"Programming Language :: Python",
|
"Programming Language :: Python",
|
||||||
"Programming Language :: Python :: 3.5",
|
|
||||||
"Programming Language :: Python :: 3.6",
|
|
||||||
"Programming Language :: Python :: 3.7",
|
"Programming Language :: Python :: 3.7",
|
||||||
"Programming Language :: Python :: 3.8",
|
"Programming Language :: Python :: 3.8",
|
||||||
"Programming Language :: Python :: 3.9",
|
"Programming Language :: Python :: 3.9",
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
__version__ = "13.0.0"
|
__version__ = "14.0.0"
|
||||||
|
|||||||
@ -2,18 +2,17 @@ from glob import glob
|
|||||||
import os
|
import os
|
||||||
import pkg_resources
|
import pkg_resources
|
||||||
|
|
||||||
|
from tutor import hooks as tutor_hooks
|
||||||
|
|
||||||
from .__about__ import __version__
|
from .__about__ import __version__
|
||||||
|
|
||||||
|
|
||||||
templates = pkg_resources.resource_filename("tutorandroid", "templates")
|
|
||||||
|
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
"add": {"OAUTH2_SECRET": "{{ 24|random_string }}"},
|
"unique": {"OAUTH2_SECRET": "{{ 24|random_string }}"},
|
||||||
"defaults": {
|
"defaults": {
|
||||||
"VERSION": __version__,
|
"VERSION": __version__,
|
||||||
"APP_HOST": "mobile.{{ LMS_HOST }}",
|
"APP_HOST": "mobile.{{ LMS_HOST }}",
|
||||||
"APP_VERSION": "2.26.1", # https://github.com/edx/edx-app-android/releases
|
"APP_VERSION": "3.0.2", # https://github.com/edx/edx-app-android/releases
|
||||||
"DOCKER_IMAGE": "{{ DOCKER_REGISTRY }}overhangio/openedx-android:{{ ANDROID_VERSION }}",
|
"DOCKER_IMAGE": "{{ DOCKER_REGISTRY }}overhangio/openedx-android:{{ ANDROID_VERSION }}",
|
||||||
"APP_DOCKER_IMAGE": "{{ DOCKER_REGISTRY }}overhangio/openedx-android-app:{{ ANDROID_VERSION }}",
|
"APP_DOCKER_IMAGE": "{{ DOCKER_REGISTRY }}overhangio/openedx-android-app:{{ ANDROID_VERSION }}",
|
||||||
"ENABLE_RELEASE_MODE": False,
|
"ENABLE_RELEASE_MODE": False,
|
||||||
@ -23,22 +22,71 @@ config = {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
hooks = {
|
tutor_hooks.Filters.COMMANDS_INIT.add_item(
|
||||||
"build-image": {
|
(
|
||||||
"android": "{{ ANDROID_DOCKER_IMAGE }}",
|
"lms",
|
||||||
"android-app": "{{ ANDROID_APP_DOCKER_IMAGE }}",
|
("android", "tasks", "lms", "init"),
|
||||||
},
|
)
|
||||||
"remote-image": {"android": "{{ ANDROID_DOCKER_IMAGE }}"},
|
)
|
||||||
"init": ["lms"],
|
tutor_hooks.Filters.IMAGES_BUILD.add_items(
|
||||||
}
|
[
|
||||||
|
(
|
||||||
|
"android",
|
||||||
|
("plugins", "android", "build", "android"),
|
||||||
|
"{{ ANDROID_DOCKER_IMAGE }}",
|
||||||
|
(),
|
||||||
|
),
|
||||||
|
(
|
||||||
|
"android-app",
|
||||||
|
("plugins", "android", "build", "app"),
|
||||||
|
"{{ ANDROID_APP_DOCKER_IMAGE }}",
|
||||||
|
(),
|
||||||
|
),
|
||||||
|
]
|
||||||
|
)
|
||||||
|
tutor_hooks.Filters.IMAGES_PULL.add_item(
|
||||||
|
(
|
||||||
|
"android",
|
||||||
|
"{{ ANDROID_DOCKER_IMAGE }}",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
tutor_hooks.Filters.IMAGES_PUSH.add_item(
|
||||||
|
(
|
||||||
|
"android",
|
||||||
|
"{{ ANDROID_DOCKER_IMAGE }}",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
####### Boilerplate code
|
||||||
def patches():
|
# Add the "templates" folder as a template root
|
||||||
all_patches = {}
|
tutor_hooks.Filters.ENV_TEMPLATE_ROOTS.add_item(
|
||||||
patches_dir = pkg_resources.resource_filename("tutorandroid", "patches")
|
pkg_resources.resource_filename("tutorandroid", "templates")
|
||||||
for path in glob(os.path.join(patches_dir, "*")):
|
)
|
||||||
with open(path) as patch_file:
|
# Render the "build" and "apps" folders
|
||||||
name = os.path.basename(path)
|
tutor_hooks.Filters.ENV_TEMPLATE_TARGETS.add_items(
|
||||||
content = patch_file.read()
|
[
|
||||||
all_patches[name] = content
|
("android/build", "plugins"),
|
||||||
return all_patches
|
("android/apps", "plugins"),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
# Load patches from files
|
||||||
|
for path in glob(
|
||||||
|
os.path.join(
|
||||||
|
pkg_resources.resource_filename("tutorandroid", "patches"),
|
||||||
|
"*",
|
||||||
|
)
|
||||||
|
):
|
||||||
|
with open(path, encoding="utf-8") as patch_file:
|
||||||
|
tutor_hooks.Filters.ENV_PATCHES.add_item(
|
||||||
|
(os.path.basename(path), patch_file.read())
|
||||||
|
)
|
||||||
|
# Add configuration entries
|
||||||
|
tutor_hooks.Filters.CONFIG_DEFAULTS.add_items(
|
||||||
|
[(f"ANDROID_{key}", value) for key, value in config.get("defaults", {}).items()]
|
||||||
|
)
|
||||||
|
tutor_hooks.Filters.CONFIG_UNIQUE.add_items(
|
||||||
|
[(f"ANDROID_{key}", value) for key, value in config.get("unique", {}).items()]
|
||||||
|
)
|
||||||
|
tutor_hooks.Filters.CONFIG_OVERRIDES.add_items(
|
||||||
|
list(config.get("overrides", {}).items())
|
||||||
|
)
|
||||||
|
|||||||
@ -23,7 +23,7 @@ RUN wget https://dl.google.com/android/repository/commandlinetools-linux-${ANDRO
|
|||||||
# Accept licenses
|
# Accept licenses
|
||||||
# https://developer.android.com/studio/command-line/sdkmanager
|
# https://developer.android.com/studio/command-line/sdkmanager
|
||||||
# Check target version: https://github.com/edx/edx-app-android/blob/master/constants.gradle
|
# Check target version: https://github.com/edx/edx-app-android/blob/master/constants.gradle
|
||||||
ARG ANDROID_API_LEVEL=29
|
ARG ANDROID_API_LEVEL=30
|
||||||
RUN yes | /app/android-sdk/cmdline-tools/bin/sdkmanager --sdk_root=${ANDROID_HOME} --install "platforms;android-$ANDROID_API_LEVEL" 1> /dev/null
|
RUN yes | /app/android-sdk/cmdline-tools/bin/sdkmanager --sdk_root=${ANDROID_HOME} --install "platforms;android-$ANDROID_API_LEVEL" 1> /dev/null
|
||||||
|
|
||||||
# Install android app repo
|
# Install android app repo
|
||||||
|
|||||||
@ -14,6 +14,7 @@ RUN sed -i "s/APPLICATION_ID = .*/APPLICATION_ID = \"{{ LMS_HOST|reverse_host|re
|
|||||||
RUN ./gradlew assembleProd{{ "Release" if ANDROID_ENABLE_RELEASE_MODE else "Debuggable" }}
|
RUN ./gradlew assembleProd{{ "Release" if ANDROID_ENABLE_RELEASE_MODE else "Debuggable" }}
|
||||||
|
|
||||||
#### File server to serve apk file
|
#### File server to serve apk file
|
||||||
FROM docker.io/caddy:2.4.3-alpine as production
|
# https://hub.docker.com/_/caddy?tab=tags
|
||||||
|
FROM docker.io/caddy:2.5.1-alpine as production
|
||||||
COPY --from=build /app/edx-app-android/OpenEdXMobile/build/outputs/apk/prod/{{ "release" if ANDROID_ENABLE_RELEASE_MODE else "debuggable" }}/edx-{{ "release" if ANDROID_ENABLE_RELEASE_MODE else "debuggable" }}-{{ ANDROID_APP_VERSION }}.apk /srv/app.apk
|
COPY --from=build /app/edx-app-android/OpenEdXMobile/build/outputs/apk/prod/{{ "release" if ANDROID_ENABLE_RELEASE_MODE else "debuggable" }}/edx-{{ "release" if ANDROID_ENABLE_RELEASE_MODE else "debuggable" }}-{{ ANDROID_APP_VERSION }}.apk /srv/app.apk
|
||||||
CMD caddy file-server --listen=:8000 --root=/srv
|
CMD caddy file-server --listen=:8000 --root=/srv
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user