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