build: Complete docker setup for generating Linux builds (#864)

* SDA-Linux - Added Dockerfile, Fix issues specific to linux

* SDA-Linux - Add Docker instruction for generating linux builds
This commit is contained in:
Kiran Niranjan 2020-01-29 14:43:29 +05:30 committed by GitHub
parent 6af430fc97
commit ba68d39f99
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 72 additions and 15 deletions

2
.dockerignore Normal file
View File

@ -0,0 +1,2 @@
# ignore everything
*

36
Dockerfile Normal file
View File

@ -0,0 +1,36 @@
ARG REPO=https://github.com/symphonyoss/SymphonyElectron.git
ARG BRANCH=master
FROM ubuntu:latest
ARG REPO
ARG BRANCH
MAINTAINER Kiran Niranjan<kiran.niranjan@symphony.com>
# Update
RUN apt-get update
# Install dependencies
RUN apt-get install -y \
curl \
git \
gcc \
g++ \
make \
build-essential \
libssl-dev \
libx11-dev \
libxkbfile-dev \
rpm
# install node
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash
RUN apt-get install -y nodejs
# Clone specific branch and repo
RUN echo ${BRANCH} ${REPO}
RUN git clone -b ${BRANCH} ${REPO}
WORKDIR SymphonyElectron
CMD ["chmod +x scripts/build-linux.sh"]
CMD ["sh", "scripts/build-linux.sh"]

View File

@ -55,6 +55,29 @@ before you commit.
- To create msi (installer):
* Run the advanced installer script located in `installer/win` directory
* There are two configuration files one each for 64-bit and 32-bit
### Linux (Docker Instruction) 🐳
- Download and install Docker daemon [here](https://www.docker.com/products/docker-desktop)
- Run the below docker commands under the project directory
- To generate and tag the container
`docker build -t linux:6.0.0 --build-arg REPO=https://github.com/symphonyoss/SymphonyElectron --build-arg BRANCH=linux .`
- To make sure the image is created and tagged correctly
`docker images`
- To run the docker image and generate the linux builds 🎉
`docker run --name linux linux:6.0.0`
- To copy the builds
`docker cp linux:/SymphonyElectron/dist/symphony-6.1.0.x86_64.rpm ~/Desktop`
`docker cp linux:/SymphonyElectron/dist/symphony_6.1.0_amd64.deb ~/Desktop`
##### Other use full docker commands
- To connect to the interactive bash
`docker run -i -t linux:6.0.0 /bin/bash`
- To delete all stopper containers
`docker system prune -a`
- To delete the container/image
`docker rmi -f linux:6.0.0`
#### MSI command line options:
- To install for all users (admin required): msiexec.exe /i Symphony-x64.msi ALLUSERS=1

14
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "symphony",
"version": "6.0.0",
"version": "6.1.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@ -10627,9 +10627,9 @@
"dev": true
},
"node-abi": {
"version": "2.12.0",
"resolved": "https://repo.symphony.com/artifactory/api/npm/npm-virtual-dev/node-abi/-/node-abi-2.12.0.tgz",
"integrity": "sha1-QOnPq92hg3hj+oJeffoLFWhq328=",
"version": "2.13.0",
"resolved": "https://repo.symphony.com/artifactory/api/npm/npm-virtual-dev/node-abi/-/node-abi-2.13.0.tgz",
"integrity": "sha1-4vLsRE0Kyj6hs4dLbeQdFmWCj2M=",
"dev": true,
"requires": {
"semver": "^5.4.1"
@ -14392,9 +14392,9 @@
}
},
"underscore": {
"version": "1.9.1",
"resolved": "https://repo.symphony.com/artifactory/api/npm/npm-virtual-dev/underscore/-/underscore-1.9.1.tgz",
"integrity": "sha1-BtzjSg5op7q8KbNluOdLiSUgOWE="
"version": "1.9.2",
"resolved": "https://repo.symphony.com/artifactory/api/npm/npm-virtual-dev/underscore/-/underscore-1.9.2.tgz",
"integrity": "sha1-DI1vU21vN4pa8mSnL3vsUP63zy8="
},
"undertaker": {
"version": "1.2.1",

View File

@ -112,7 +112,7 @@
"jest": "23.6.0",
"jest-html-reporter": "2.4.2",
"less": "3.8.1",
"node-abi": "^2.12.0",
"node-abi": "^2.13.0",
"ts-jest": "23.10.5",
"tslint": "5.11.0",
"typescript": "3.1.1"

View File

@ -422,7 +422,7 @@ export class AppMenu {
} ],
}, {
label: i18n.t('About Symphony')(),
visible: isWindowsOS,
visible: isWindowsOS || isLinux,
click(_menuItem, focusedWindow) {
const windowName = focusedWindow ? (focusedWindow as ICustomBrowserWindow).winName : '';
windowHandler.createAboutAppWindow(windowName);

View File

@ -4,7 +4,7 @@ import * as fs from 'fs';
import * as path from 'path';
import * as util from 'util';
import { isElectronQA, isLinux, isWindowsOS } from './env';
import { isElectronQA, isWindowsOS } from './env';
import { getCommandLineArgs } from './utils';
export interface ILogMsg {
@ -53,11 +53,7 @@ class Logger {
app.setPath('logs', customLogsFolder);
}
if (isLinux) {
this.logPath = app.getPath('appData');
} else {
this.logPath = app.getPath('logs');
}
this.logPath = app.getPath('logs');
if (app.isPackaged) {
transports.file.file = path.join(this.logPath, `app_${Date.now()}.log`);