diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0d5bc46..9bdb469 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,7 +2,7 @@ variables: TUTOR_PLUGIN: android TUTOR_IMAGES: android TUTOR_PYPI_PACKAGE: tutor-android - OPENEDX_RELEASE: nutmeg + OPENEDX_RELEASE: olive GITHUB_REPO: overhangio/tutor-android include: diff --git a/README.rst b/README.rst index f4d0bf2..5473821 100644 --- a/README.rst +++ b/README.rst @@ -16,7 +16,7 @@ Usage Enable the plugin and start the platform:: tutor plugins enable android - tutor local quickstart + tutor local launch The ``.apk`` file will then be available for download at http(s)://mobile.LMS_HOST/app.apk. When running locally, this will be: http://mobile.local.overhang.io/app.apk. You can forward this address to your students for download. diff --git a/setup.py b/setup.py index 68e6c5a..40b760c 100644 --- a/setup.py +++ b/setup.py @@ -43,7 +43,7 @@ setup( packages=find_packages(exclude=["tests*"]), include_package_data=True, python_requires=">=3.7", - install_requires=["tutor>=14.0.0,<15.0.0"], + install_requires=["tutor>=15.0.0,<16.0.0"], entry_points={ "tutor.plugin.v1": [ "android = tutorandroid.plugin" diff --git a/tutorandroid/__about__.py b/tutorandroid/__about__.py index 4fcf9b8..1aa815c 100644 --- a/tutorandroid/__about__.py +++ b/tutorandroid/__about__.py @@ -1 +1,2 @@ -__version__ = "14.0.1" +__version__ = "15.0.0" + diff --git a/tutorandroid/plugin.py b/tutorandroid/plugin.py index 9dde9ff..feb20a6 100644 --- a/tutorandroid/plugin.py +++ b/tutorandroid/plugin.py @@ -11,7 +11,9 @@ config = { "defaults": { "VERSION": __version__, "APP_HOST": "mobile.{{ LMS_HOST }}", - "APP_VERSION": "3.0.2", # https://github.com/edx/edx-app-android/releases + # Unfortunately 3.2.2 is not functional: https://github.com/openedx/build-test-release-wg/issues/211#issuecomment-1344311500 + # "APP_VERSION": "3.2.2", # https://github.com/openedx/edx-app-android/releases + "APP_VERSION": "3.0.2", "DOCKER_IMAGE": "{{ DOCKER_REGISTRY }}overhangio/openedx-android:{{ ANDROID_VERSION }}", "APP_DOCKER_IMAGE": "{{ DOCKER_REGISTRY }}overhangio/openedx-android-app:{{ ANDROID_VERSION }}", "ENABLE_RELEASE_MODE": False, @@ -21,12 +23,22 @@ config = { }, } -tutor_hooks.Filters.COMMANDS_INIT.add_item( - ( +with open( + os.path.join( + pkg_resources.resource_filename("tutorandroid", "templates"), + "android", + "tasks", "lms", - ("android", "tasks", "lms", "init"), + "init", + ), + encoding="utf8", +) as fi: + tutor_hooks.Filters.CLI_DO_INIT_TASKS.add_item( + ( + "lms", + fi.read(), + ) ) -) tutor_hooks.Filters.IMAGES_BUILD.add_items( [ ( diff --git a/tutorandroid/templates/android/build/android/Dockerfile b/tutorandroid/templates/android/build/android/Dockerfile index c4976a2..60f5ded 100644 --- a/tutorandroid/templates/android/build/android/Dockerfile +++ b/tutorandroid/templates/android/build/android/Dockerfile @@ -16,7 +16,7 @@ ENV ANDROID_SDK_PATH /app/android-sdk ENV ANDROID_HOME /app/android-sdk RUN mkdir ${ANDROID_HOME} WORKDIR /app/android-sdk -RUN wget https://dl.google.com/android/repository/commandlinetools-linux-${ANDROID_SDK_VERSION}_latest.zip && \ +RUN wget --quiet https://dl.google.com/android/repository/commandlinetools-linux-${ANDROID_SDK_VERSION}_latest.zip && \ unzip commandlinetools-linux-${ANDROID_SDK_VERSION}_latest.zip && \ rm commandlinetools-linux-${ANDROID_SDK_VERSION}_latest.zip @@ -27,7 +27,7 @@ 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 # Install android app repo -ARG ANDROID_APP_REPOSITORY=https://github.com/edx/edx-app-android +ARG ANDROID_APP_REPOSITORY=https://github.com/openedx/edx-app-android ARG ANDROID_APP_VERSION=release/{{ ANDROID_APP_VERSION }} RUN git clone $ANDROID_APP_REPOSITORY --branch $ANDROID_APP_VERSION /app/edx-app-android WORKDIR /app/edx-app-android diff --git a/tutorandroid/templates/android/build/app/Dockerfile b/tutorandroid/templates/android/build/app/Dockerfile index 881ca18..d8de6ff 100644 --- a/tutorandroid/templates/android/build/app/Dockerfile +++ b/tutorandroid/templates/android/build/app/Dockerfile @@ -15,6 +15,6 @@ RUN ./gradlew assembleProd{{ "Release" if ANDROID_ENABLE_RELEASE_MODE else "Debu #### File server to serve apk file # https://hub.docker.com/_/caddy?tab=tags -FROM docker.io/caddy:2.5.1-alpine as production +FROM docker.io/caddy:2.6.2-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 CMD caddy file-server --listen=:8000 --root=/srv