nordnet/cordova-hot-code-push

Plugin add fails when building with Docker using beevelop/android-nodejs:latest

rjcorwin opened this issue · 6 comments

Issue

Dockerfile

FROM beevelop/android-nodejs:latest
ARG UPDATE_SERVER_URL

ENV DEBIAN_FRONTEND noninteractive
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections

RUN npm install -g cordova
WORKDIR /
RUN cordova create TangerineProject org.rti.tangerineproject TangerineProject
WORKDIR /TangerineProject
RUN cordova platform add android
RUN cordova plugin add cordova-hot-code-push-plugin
RUN npm install -g cordova-hot-code-push-cli
ADD ./build /TangerineProject/www
ADD ./content /TangerineProject/www/content
# @TODO replace update server url with value from build arg
RUN sed -i "s#</description>#</description>\n    <chcp><config-file url=\"$UPDATE_SERVER_URL\" /></chcp>#' config.xml
RUN cordova build android

VOLUME /build
ENTRYPOINT cp -r /TangerineProject/platforms/android/build/outputs/apk/android-debug.apk /apks/

Resulting docker build error message.

Step 10 : RUN cordova plugin add cordova-hot-code-push-plugin
 ---> Running in 596ccb8e21ec

You have been opted out of telemetry. To change this, run: cordova telemetry on.
Installing "cordova-hot-code-push-plugin" for android
Failed to install 'cordova-hot-code-push-plugin': Error: spawn ETXTBSY
    at _errnoException (util.js:1019:11)
    at ChildProcess.spawn (internal/child_process.js:325:11)
    at Object.exports.spawn (child_process.js:494:9)
    at Object.exports.spawn (/opt/node/lib/node_modules/cordova/node_modules/cordova-common/src/superspawn.js:134:31)
    at Object.exports.maybeSpawn (/opt/node/lib/node_modules/cordova/node_modules/cordova-common/src/superspawn.js:186:24)
    at /opt/node/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:310:29
    at _fulfilled (/opt/node/lib/node_modules/cordova/node_modules/q/q.js:787:54)
    at self.promiseDispatch.done (/opt/node/lib/node_modules/cordova/node_modules/q/q.js:816:30)
    at Promise.promise.promiseDispatch (/opt/node/lib/node_modules/cordova/node_modules/q/q.js:749:13)
    at /opt/node/lib/node_modules/cordova/node_modules/q/q.js:810:14
Error: spawn ETXTBSY
The command '/bin/sh -c cordova plugin add cordova-hot-code-push-plugin' returned a non-zero code: 1

Why Docker?

We build APKs using Docker build machines so an application's ability to be released is not dependent on a single developer's laptop not having coffee spilt on it or a server crashed and unrecoverable.

It would be awesome to be able to build chcp into an APK using Docker!

I'm facing the same problem. Did you find a solution for it?

I have not. I moved on and am now having the app on first update redirect to where the app is hosted and then just staying there. Files are cached on device using service worker cache.

The bummer is that this first update of the app needs to download everything and we have to migrate user data between them using iframe and pushMessage API.

We may end up going with Dat which is for syncing files. It's built on nodejs and we have a concept project at https://github.com/bunsenbrowser/bunsen

@lukeisontheroad Today adding this plugin to cordova projects in Docker builds works! Not sure what changed :).

Try...

git clone https://github.com/rjsteinert/cordova-hot-code-push-docker
cd cordova-hot-code-push-docker
./build-and-run.sh

You'll find a built apk at ./apks/android-debug.apk.

@rjsteinert maybe you should close the issue if it is resolved