Skip to content

Commit

Permalink
chore: tejo build script fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
RafaelTaranto committed Mar 7, 2022
1 parent e4db73f commit cfc5c6f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
10 changes: 8 additions & 2 deletions build-scripts/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,22 @@ FROM acp as acp-build

FROM upboard as upboard-gaia-build
COPY --from=acp-build /lamassu/lamassu-machine /lamassu/lamassu-machine
RUN cd lamassu-machine && rm -rf node_modules && npm install && \
RUN cd lamassu-machine && rm -rf node_modules && npm install && npm install &&\
cp ./hardware/codebase/upboard/gaia/device_config.json ./ && \
bash ./deploy/codebase/build.sh upboard-gaia --copy-device-config

FROM upboard as upboard-sintra-build
COPY --from=upboard-gaia-build /lamassu/lamassu-machine /lamassu/lamassu-machine
RUN cd lamassu-machine && rm -rf node_modules && npm install && \
RUN cd lamassu-machine && rm -rf node_modules && npm install && npm install && \
cp ./hardware/codebase/upboard/sintra/device_config.json ./ && \
bash ./deploy/codebase/build.sh upboard-sintra --copy-device-config

FROM upboard as upboard-tejo-build
COPY --from=upboard-gaia-build /lamassu/lamassu-machine /lamassu/lamassu-machine
RUN cd lamassu-machine && rm -rf node_modules && npm install && npm install && \
cp ./hardware/codebase/upboard/tejo/device_config.json ./ && \
bash ./deploy/codebase/build.sh upboard-tejo --copy-device-config

FROM ssuboard as ssuboard-build
COPY --from=upboard-sintra-build /lamassu/lamassu-machine /lamassu/lamassu-machine
RUN cd lamassu-machine && rm -rf node_modules && npm install && \
Expand Down
11 changes: 11 additions & 0 deletions deploy/codebase/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,17 @@ elif [ $1 == "upboard-gaia" ] ; then
mkdir $EXPORT_DIR/hardware/upboard/gaia
cp $MACHINE_DIR/device_config.json $EXPORT_DIR/hardware/upboard/gaia/
fi
elif [ $1 == "upboard-tejo" ] ; then
mkdir -p $EXPORT_DIR/hardware/upboard/node_modules
mkdir -p $EXPORT_DIR/supervisor/upboard/tejo

cp $SYSTEM_DIR/upboard/tejo/supervisor/conf.d/* $EXPORT_DIR/supervisor/upboard/tejo
cp -R $MACHINE_DIR/node_modules $EXPORT_DIR/hardware/upboard/
node $MACHINE_DIR/deploy/remove-modules.js $EXPORT_DIR/hardware/upboard/node_modules --rem-interpreted
if [ $2 == "--copy-device-config" ] ; then
mkdir $EXPORT_DIR/hardware/upboard/tejo
cp $MACHINE_DIR/device_config.json $EXPORT_DIR/hardware/upboard/tejo/
fi
else
echo "The first argument should the target's platform name: aaeon, ssuboard, upboard"
exit 1
Expand Down
1 change: 1 addition & 0 deletions deploy/codebase/updateinit.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ function installDeviceConfig (cb) {
if (currentDeviceConfig.billDispenser && newDeviceConfig.billDispenser) {
newDeviceConfig.billDispenser.model = currentDeviceConfig.billDispenser.model
newDeviceConfig.billDispenser.device = currentDeviceConfig.billDispenser.device
newDeviceConfig.billDispenser.cassettes = currentDeviceConfig.billDispenser.cassettes
}
if (currentDeviceConfig.billValidator) {
newDeviceConfig.billValidator.deviceType = currentDeviceConfig.billValidator.deviceType
Expand Down

0 comments on commit cfc5c6f

Please sign in to comment.