Skip to content

Commit

Permalink
Merge branch 'master' into #135-write-new-preview
Browse files Browse the repository at this point in the history
  • Loading branch information
catdad committed Apr 28, 2019
2 parents 49fb41a + 5f98dbd commit a178e60
Show file tree
Hide file tree
Showing 8 changed files with 427 additions and 295 deletions.
3 changes: 2 additions & 1 deletion .brackets.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
}
},
"language.fileNames": {
"Jenkinsfile": "groovy"
"Jenkinsfile": "groovy",
".dockerbuild": "dockerfile"
}
}
39 changes: 39 additions & 0 deletions .dockerbuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
FROM ubuntu:18.04

ARG TRAVIS_COMMIT
ARG TRAVIS_TAG

COPY . /app

ENV DEBIAN_FRONTEND noninteractive
ENV FORCE_COLOR 1

# dependecies:
# - build-essential: compiling with node-gyp
# - gdebi-core: installing chrome
# - wget: to get stuff, duh
# - curl: also to get stuff
# - xvfb: to run headless electron tests
# - gnupg: apparently needed to run node
# - chrome: too lazy to figure out electron dependencies
# - node: for testing things

RUN apt update -qq
RUN apt install --yes -qq build-essential gdebi-core wget xvfb curl gnupg
RUN wget -q https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
RUN gdebi --non-interactive --quiet google-chrome-stable_current_amd64.deb
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash \
&& apt install --yes nodejs

RUN node -v
RUN npm -v

WORKDIR /app

RUN npm ci --unsafe-perm
RUN npm run citest
RUN npm run package -- --version $TRAVIS_COMMIT --tag $TRAVIS_TAG --upload

FROM ubuntu:18.04

COPY --from=0 /app/dist /dist
72 changes: 40 additions & 32 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,43 @@
os:
# - linux
- osx

language: node_js

node_js:
- '10'

addons:
apt:
packages:
- xvfb

install:
- npm ci

script:
- npm run citest
- npm run package -- --version $TRAVIS_COMMIT --tag $TRAVIS_TAG --upload

after_success:
- ls -la dist
jobs:
include:
- name: linux-docker
os: linux
services:
- docker
install:
- cat .dockerbuild
script:
- docker build --build-arg TRAVIS_COMMIT --build-arg TRAVIS_TAG -t raw-viewer-build . -f- < .dockerbuild
- docker images
- docker run -d --rm --name rv raw-viewer-build tail -f /dev/null
- docker cp rv:/dist dist
- docker kill rv
after_success:
- ls -la dist
- name: darwin
os: osx
node_js: '10'
before_install:
- node -v
- npm -v
install:
- npm ci
script:
- npm run citest
- npm run package -- --version $TRAVIS_COMMIT --tag $TRAVIS_TAG --upload
after_success:
- ls -la dist
deploy:
provider: releases
skip_cleanup: true
api_key:
secure: iFtH8nv6evIRzo4qciIeUO7rSH3FIu38rTOloJX4Q49tATO+iIH0vwScn4Nve+xfEyzDQopyLJtK2S8/VRl2a24ogSauYw5WYleceJ9g/xsCvAy9Fdl8NUqaYkJywQodxHXL9GORJfXsindDEOhUyTCBntHG1xtLvlbFqQPF4/Qfk+DzHHQ4SsIwJjGgd82MkP7r1LcoKV3dg3KPk16gyv8BphgIoOWEuEcsyl0Q29lBQKCh+c5dXKCsH+AYg0/glXjlIaX8MS7hbhl3RqDMSa7kmIjp0Zbm2IlLpyixnYIXEdS2Xem6J4wUeA/FlzKKhCXKSoDhuk4NIcRVCmpVasSPTk8Qkc+vf+3PHBNTwqQkfUxMSblqKdsJuxL07XnmM/cyj7ZrmIpSPMO7Rj+EFTkCAbCNa5m5+u9ZsfFQ/Lu3NFjEs5gN39X/a3hdpBDhzQ12aGMjN/HxMH6Y5FfwzT34W+M78EwQyL/Nr1fcbAXIze7dY+JhSrIE8KAJq14+StgiNHcxWe+580bLEHkIxWRTQDp/rtW43jfbDH7WlOn/kfW8TUADsZFptOrBBDkVe6ll2LtanhHSjib1LIs4cP/5whzBluVWlXG8SuhMQwaHIIZBsx3spbAR2iMzsdpCBT836pLBFP3aghoi6tOPUK5iqZPkhQGIP/Ga1WwVORk=
file_glob: true
file: 'dist/*.zip'
on:
repo: catdad/raw-viewer
branch: '*'
tags: true

deploy:
provider: releases
skip_cleanup: true
api_key:
secure: iFtH8nv6evIRzo4qciIeUO7rSH3FIu38rTOloJX4Q49tATO+iIH0vwScn4Nve+xfEyzDQopyLJtK2S8/VRl2a24ogSauYw5WYleceJ9g/xsCvAy9Fdl8NUqaYkJywQodxHXL9GORJfXsindDEOhUyTCBntHG1xtLvlbFqQPF4/Qfk+DzHHQ4SsIwJjGgd82MkP7r1LcoKV3dg3KPk16gyv8BphgIoOWEuEcsyl0Q29lBQKCh+c5dXKCsH+AYg0/glXjlIaX8MS7hbhl3RqDMSa7kmIjp0Zbm2IlLpyixnYIXEdS2Xem6J4wUeA/FlzKKhCXKSoDhuk4NIcRVCmpVasSPTk8Qkc+vf+3PHBNTwqQkfUxMSblqKdsJuxL07XnmM/cyj7ZrmIpSPMO7Rj+EFTkCAbCNa5m5+u9ZsfFQ/Lu3NFjEs5gN39X/a3hdpBDhzQ12aGMjN/HxMH6Y5FfwzT34W+M78EwQyL/Nr1fcbAXIze7dY+JhSrIE8KAJq14+StgiNHcxWe+580bLEHkIxWRTQDp/rtW43jfbDH7WlOn/kfW8TUADsZFptOrBBDkVe6ll2LtanhHSjib1LIs4cP/5whzBluVWlXG8SuhMQwaHIIZBsx3spbAR2iMzsdpCBT836pLBFP3aghoi6tOPUK5iqZPkhQGIP/Ga1WwVORk=
file_glob: true
file: 'dist/*.zip'
on:
repo: catdad/raw-viewer
branch: '*'
tags: true
14 changes: 14 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,18 @@ function createWindow () {
mainWindow = new BrowserWindow({
width: config.getProp('window.width') || 1000,
height: config.getProp('window.height') || 800,
backgroundColor: '#262626',
darkTheme: true,
webPreferences: {
nodeIntegration: true,
nodeIntegrationInWorker: true
}
});

if (config.getProp('window.maximized')) {
mainWindow.maximize();
}

mainWindow.loadURL(url.format({
pathname: path.join(__dirname, 'public', 'index.html'),
protocol: 'file:',
Expand All @@ -73,6 +79,14 @@ function createWindow () {
config.setProp('window.height', size[1]);
});

mainWindow.on('maximize', function () {
config.setProp('window.maximized', true);
});

mainWindow.on('unmaximize', function () {
config.setProp('window.maximized', false);
});

ipcMain.on('message', onIpc);

mainWindow.webContents.on('devtools-opened', () => {
Expand Down
Loading

0 comments on commit a178e60

Please sign in to comment.