Skip to content
Snippets Groups Projects
Commit dc942cb0 authored by Benoit Lavenier's avatar Benoit Lavenier
Browse files

[fix] Fix DockerFile

parent 8e1f66c9
Branches
Tags
No related merge requests found
Pipeline #8747 failed
FROM ubuntu:18.04 FROM node:10-alpine
LABEL maintainer="benoit [dot] lavenier [at] e-is [dot] pro" LABEL maintainer="benoit [dot] lavenier [at] e-is [dot] pro"
LABEL version="1.6.3"
LABEL description="Cesium Wallet for Ğ1 libre currency"
ARG CESIUM_VER="1.6.3"
ENV DEBIAN_FRONTEND=noninteractive \ ENV DEBIAN_FRONTEND=noninteractive \
NODE_VERSION=10.20.0 \ NODE_VERSION=10.20.0 \
...@@ -11,28 +15,27 @@ ENV DEBIAN_FRONTEND=noninteractive \ ...@@ -11,28 +15,27 @@ ENV DEBIAN_FRONTEND=noninteractive \
GULP_VERSION=2.2.0 GULP_VERSION=2.2.0
# Install basics # Install basics
RUN apt-get update && \ RUN apk update && \
apt-get install -y git wget curl unzip build-essential software-properties-common ruby ruby-dev ruby-ffi gcc make python && \ apk add ca-certificates wget curl git && \
curl --retry 3 -SLO "http://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-x64.tar.gz" && \ update-ca-certificates && \
tar -xzf "node-v$NODE_VERSION-linux-x64.tar.gz" -C /usr/local --strip-components=1 && \ apk add --update python make g++
rm "node-v$NODE_VERSION-linux-x64.tar.gz"
# create group and user cesium
RUN mkdir -p /home/root && \ RUN addgroup -S -g 1111 cesium && \
chmod -R 777 /home/root adduser -SD -h /cesium -G cesium -u 1111 cesium
WORKDIR /home/root #RUN mkdir -p /var/lib/cesium /etc/cesium && chown cesium:cesium /var/lib/cesium /etc/cesium
# Install global nodeJS dependencies # Install global dependencies
RUN npm install -g npm@"$NPM_VERSION" && \ RUN yarn global add gulp@"$GULP_VERSION" @ionic/cli@"$IONIC_CLI_VERSION"
npm install -g yarn@"$YARN_VERSION" gulp@"$GULP_VERSION" cordova@"$CORDOVA_VERSION" cordova-res@"$CORDOVA_RES_VERSION" @ionic/cli@"$IONIC_CLI_VERSION" && \
npm cache clear --force # copy source tree
COPY ./ ./
# Install source code
#RUN git config --global user.email "user.name@domain.com" && \ # Install project dependencies
# git config --global user.name "User Name" && \ # Workaround need for node-sass (- )see https://github.com/yarnpkg/yarn/issues/4867)
RUN git clone https://git.duniter.org/clients/cesium-grp/cesium.git && \ RUN yarn install --ignore-engines && \
cd cesium && \ yarn remove node-sass && yarn add node-sass
yarn install
WORKDIR /cesium
WORKDIR cesium
EXPOSE 8100 35729 EXPOSE 8100 35729
CMD ["yarn", "run", "start"] CMD ["yarn", "run", "start"]
...@@ -144,7 +144,7 @@ ...@@ -144,7 +144,7 @@
"lazypipe": "^1.0.2", "lazypipe": "^1.0.2",
"merge2": "^1.3.0", "merge2": "^1.3.0",
"mv": "^2.1.1", "mv": "^2.1.1",
"node-sass": "^4.13.0", "node-sass": "^4.13.1",
"playup": "^1.1.0", "playup": "^1.1.0",
"vinyl-fs": "^3.0.3", "vinyl-fs": "^3.0.3",
"yargs": "^5.0.0" "yargs": "^5.0.0"
......
#!/bin/bash
# Get to the root project
if [[ "_" == "_${PROJECT_DIR}" ]]; then
SCRIPT_DIR=$(dirname $0)
PROJECT_DIR=$(cd ${SCRIPT_DIR}/.. && pwd)
export PROJECT_DIR
fi;
cd ${PROJECT_DIR}
CMD="sudo docker build ${PROJECT_DIR} -t cesium/release"
echo "Executing: $CMD"
$CMD
...@@ -9,7 +9,6 @@ fi; ...@@ -9,7 +9,6 @@ fi;
cd ${PROJECT_DIR} cd ${PROJECT_DIR}
PWD=$(pwd) CMD="sudo docker run -ti --rm -p 8100:8100 -p 35729:35729 -v ${PROJECT_DIR}:/cesium:rw cesium:release"
CMD="sudo docker run -ti --rm -p 8100:8100 -p 35729:35729 -v $PWD:/cesium:rw cesium:release"
echo "Executing: $CMD" echo "Executing: $CMD"
$CMD $CMD
...@@ -9,9 +9,7 @@ fi; ...@@ -9,9 +9,7 @@ fi;
# Preparing environment # Preparing environment
. ${PROJECT_DIR}/scripts/env-global.sh . ${PROJECT_DIR}/scripts/env-global.sh
if [[ $? -ne 0 ]]; then [[ $? -ne 0 ]] && exit 1
exit 1
fi
if [[ "_" == "_${CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL}" ]]; then if [[ "_" == "_${CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL}" ]]; then
echo "Missing Gradle distribution URL - please export env variable 'CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL'" echo "Missing Gradle distribution URL - please export env variable 'CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL'"
...@@ -36,9 +34,7 @@ fi ...@@ -36,9 +34,7 @@ fi
if [[ ! -d "${ANDROID_SDK_TOOLS_ROOT}" ]]; then if [[ ! -d "${ANDROID_SDK_TOOLS_ROOT}" ]]; then
cd "${PROJECT_DIR}/scripts" cd "${PROJECT_DIR}/scripts"
./install-android-sdk-tools.sh ./install-android-sdk-tools.sh
if [[ $? -ne 0 ]]; then [[ $? -ne 0 ]] && exit 1
exit 1
fi
fi fi
# Install Gradle # Install Gradle
...@@ -49,13 +45,9 @@ if [[ "_" == "_$(which gradle)" && ! -d "${GRADLE_HOME}" ]]; then ...@@ -49,13 +45,9 @@ if [[ "_" == "_$(which gradle)" && ! -d "${GRADLE_HOME}" ]]; then
GRADLE_PARENT=$(dirname $GRADLE_HOME) GRADLE_PARENT=$(dirname $GRADLE_HOME)
test -e "${GRADLE_PARENT}" || mkdir -p ${GRADLE_PARENT} test -e "${GRADLE_PARENT}" || mkdir -p ${GRADLE_PARENT}
test -e "${GRADLE_PARENT}/gradle-${GRADLE_VERSION}" || unzip -qq gradle-${GRADLE_VERSION}-all.zip -d "${GRADLE_PARENT}" test -e "${GRADLE_PARENT}/gradle-${GRADLE_VERSION}" || unzip -qq gradle-${GRADLE_VERSION}-all.zip -d "${GRADLE_PARENT}"
if [[ $? -ne 0 ]]; then [[ $? -ne 0 ]] && exit 1
exit 1
fi
test -e "${GRADLE_HOME}" || mv "${GRADLE_PARENT}/gradle-${GRADLE_VERSION}" "${GRADLE_HOME}" test -e "${GRADLE_HOME}" || mv "${GRADLE_PARENT}/gradle-${GRADLE_VERSION}" "${GRADLE_HOME}"
if [[ $? -ne 0 ]]; then [[ $? -ne 0 ]] && exit 1
exit 1
fi
test -e "${GRADLE_PARENT}/gradle-${GRADLE_VERSION}" || rm "${GRADLE_PARENT}/gradle-${GRADLE_VERSION}" test -e "${GRADLE_PARENT}/gradle-${GRADLE_VERSION}" || rm "${GRADLE_PARENT}/gradle-${GRADLE_VERSION}"
fi fi
...@@ -65,18 +57,14 @@ if [[ ! -d "${PROJECT_DIR}/platforms/android" ]]; then ...@@ -65,18 +57,14 @@ if [[ ! -d "${PROJECT_DIR}/platforms/android" ]]; then
echo "Adding Cordova Android platform..." echo "Adding Cordova Android platform..."
cd "${PROJECT_DIR}" cd "${PROJECT_DIR}"
ionic cordova prepare android --color --verbose ionic cordova prepare android --color --verbose
if [[ $? -ne 0 ]]; then [[ $? -ne 0 ]] && exit 1
exit 1
fi
fi fi
# Copy local files # Copy local files
if [[ -d "${PROJECT_DIR}/.local/android" ]]; then if [[ -d "${PROJECT_DIR}/.local/android" ]]; then
echo "Copying files from directory '${PROJECT_DIR}/.local/android' into '${PROJECT_DIR}/platforms/android'..." echo "Copying files from directory '${PROJECT_DIR}/.local/android' into '${PROJECT_DIR}/platforms/android'..."
cp -rf ${PROJECT_DIR}/.local/android/* ${PROJECT_DIR}/platforms/android cp -rf ${PROJECT_DIR}/.local/android/* ${PROJECT_DIR}/platforms/android
if [[ $? -ne 0 ]]; then [[ $? -ne 0 ]] && exit 1
exit 1
fi
else else
echo "No directory '${PROJECT_DIR}/.local/android' found. Please create it, with a file 'release-signing.properties' for release signing" echo "No directory '${PROJECT_DIR}/.local/android' found. Please create it, with a file 'release-signing.properties' for release signing"
fi fi
...@@ -95,9 +95,8 @@ if [[ ! -d "${ANDROID_SDK_ROOT}" ]]; then ...@@ -95,9 +95,8 @@ if [[ ! -d "${ANDROID_SDK_ROOT}" ]]; then
fi fi
fi fi
# Export Android SDK tools to path # Add Java, Android SDK tools to path
too=${ANDROID_SDK_ROOT}/tools PATH=${ANDROID_SDK_TOOLS_ROOT}/bin:${GRADLE_HOME}/bin:${JAVA_HOME}/bin$:$PATH
PATH=${ANDROID_SDK_TOOLS_ROOT}/bin:${GRADLE_HOME}/bin:$PATH
# Export useful variables # Export useful variables
export PATH \ export PATH \
...@@ -121,9 +120,7 @@ if [[ -d "${NVM_DIR}" ]]; then ...@@ -121,9 +120,7 @@ if [[ -d "${NVM_DIR}" ]]; then
# Or install it # Or install it
if [[ $? -ne 0 ]]; then if [[ $? -ne 0 ]]; then
nvm install ${NODEJS_VERSION} nvm install ${NODEJS_VERSION}
if [[ $? -ne 0 ]]; then [[ $? -ne 0 ]] && exit 1
exit 1;
fi
fi fi
else else
echo "nvm (Node version manager) not found (directory ${NVM_DIR} not found). Please install, and retry" echo "nvm (Node version manager) not found (directory ${NVM_DIR} not found). Please install, and retry"
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
"short_name": "Cesium", "short_name": "Cesium",
"name": "Cesium", "name": "Cesium",
"manifest_version": 1, "manifest_version": 1,
"version": "1.6.2-alpha", "version": "1.6.3",
"default_locale": "fr", "default_locale": "fr",
"description": "Manage your Duniter Wallet on a libre currency, like Ğ1", "description": "Cesium Wallet for Ğ1 libre currency",
"icons": [ "icons": [
{ {
"src": "img/logo_32px.png", "src": "img/logo_32px.png",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment