1 Commits

Author SHA1 Message Date
4796c05d23 Add Dockerfile for testing/CI 2017-11-28 23:06:36 +01:00
10 changed files with 51 additions and 122 deletions

31
Dockerfile Normal file
View File

@@ -0,0 +1,31 @@
FROM node:8
# Set up the Chrome PPA
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
RUN echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list
# Update the package list, and install Chrome and unzip
RUN apt-get update && apt-get install -y google-chrome-stable unzip
# Set up ChromeDriver environment variables
ENV CHROMEDRIVER_VERSION 2.33
ENV CHROMEDRIVER_DIR /chromedriver
# Download and install ChromeDriver
RUN mkdir $CHROMEDRIVER_DIR
RUN wget -q --continue -P $CHROMEDRIVER_DIR \
"http://chromedriver.storage.googleapis.com/$CHROMEDRIVER_VERSION/chromedriver_linux64.zip" && \
unzip $CHROMEDRIVER_DIR/chromedriver* -d $CHROMEDRIVER_DIR
# Put ChromeDriver into the PATH
ENV PATH $CHROMEDRIVER_DIR:$PATH
WORKDIR /app
# see https://git.io/vdao3
ENV JOBS 1
COPY package.json package-lock.json ./
RUN npm install
COPY . ./

View File

@@ -1,27 +1,7 @@
# RS Inspektor
# inspektor
Inspektor is a simple file browser for inspecting the contents of a
[remoteStorage](https://remotestorage.io) account. It is intended for RS app
developers and power users.
Inspektor is beta software and currently under development. You're invited to
contribute and/or give feedback: https://gitlab.com/skddc/inspektor
## Features
* [x] Connect RS accounts
* [x] Traverse/inspect directories
* [x] View document details
* [x] Render images in details
* [x] Render text content in details (e.g. JSON)
* [ ] Render other types content (e.g. audio and video)
* [ ] Edit text content (and save changes)
* [ ] Delete documents
* [ ] Delete directories
* [ ] Copy/move documents
* [ ] Copy/move directories (and enclosed files)
* [ ] Loading indicator for any view change that loads remote data
* [ ] Logo/icon
This README outlines the details of collaborating on this Ember application.
A short introduction of this app could easily go here.
## Prerequisites
@@ -60,14 +40,7 @@ Make use of the many generators for code, try `ember help generate` for more det
### Deploying
With the 5apps remote added correctly (and push access to the GitLab repo),
just run:
npm run deploy
If you want to deploy this from and to different repos, have a look at the
`scripts` section in `package.json`, as well as `scripts/deploy.sh` for how it
works.
Specify what it takes to deploy your app.
## Further Reading / Useful Links

View File

@@ -1,8 +1,8 @@
import Controller from '@ember/controller';
import EmberObject from '@ember/object';
import { observer } from '@ember/object';
import { inject as service } from '@ember/service';
import { alias } from '@ember/object/computed';
import { observer } from '@ember/object';
import { isEmpty } from '@ember/utils';
export default Controller.extend({
@@ -12,7 +12,10 @@ export default Controller.extend({
connecting: alias('storage.connecting'),
connected: alias('storage.connected'),
rootListing: alias('storage.rootListing'),
currentDirPath: null,
handleConnected: observer('connected', function() {
this.get('storage').fetchRootListing();
}),
categories: function() {
let categories = [];
@@ -30,14 +33,8 @@ export default Controller.extend({
});
return categories;
}.property('rootListing'),
}.property('rootListing')
connectedChange: observer('connected', function() {
if (this.get('connected')) {
// console.debug('connectedChange connected');
} else {
this.set('currentDirPath', null);
}
}),
});

View File

@@ -1,6 +1,5 @@
import Controller from '@ember/controller';
import { inject as controller } from '@ember/controller';
import { observer } from '@ember/object';
import { inject as service } from '@ember/service';
import { alias } from '@ember/object/computed';
import { isPresent } from '@ember/utils';
@@ -10,7 +9,8 @@ export default Controller.extend({
application: controller(),
storage: service(),
connected: alias('storage.connected'),
// connecting: alias('storage.connecting'),
// connected: alias('storage.connected'),
rootListing: alias('storage.rootListing'),
currentDirPath: alias('application.currentDirPath'),
@@ -22,15 +22,6 @@ export default Controller.extend({
} else {
return this.get('rootListing');
}
}.property('rootListing.[]', 'model.[]'),
connectedChange: observer('connected', function() {
if (this.get('connected')) {
// console.debug('connectedChange connected');
} else {
this.set('model', null);
this.set('path', null);
}
}),
}.property('rootListing.[]', 'model.[]')
});

View File

@@ -1,8 +1,7 @@
import Route from '@ember/routing/route';
import { inject as service } from '@ember/service';
import { isEmpty, isPresent } from '@ember/utils';
import { later } from '@ember/runloop';
import { hash, Promise } from 'rsvp';
import { hash } from 'rsvp';
export default Route.extend({
@@ -14,13 +13,7 @@ export default Route.extend({
}
},
beforeModel() {
return this.waitForConnectionState();
},
model(params) {
if (this.get('storage.disconnected')) { return null; }
let path = params.path;
if (isEmpty(params.path)) { return null; }
@@ -35,7 +28,6 @@ export default Route.extend({
setupController(controller, model) {
this._super(controller, model);
if (this.get('storage.disconnected')) { return true; }
if (isEmpty(this.get('storage.categories')) && this.get('storage.connected')) {
this.get('storage').fetchRootListing();
@@ -44,21 +36,6 @@ export default Route.extend({
if (isPresent(model)) {
controller.set('currentDirPath', model.currentDirPath);
}
},
waitForConnectionState() {
let self = this;
return new Promise(resolve => {
function checkConnectingDone() {
if (self.get('storage.connecting')) {
later(checkConnectingDone, 20);
} else {
resolve();
}
}
checkConnectingDone();
});
}
});

View File

@@ -1,5 +1,4 @@
import EmberObject from '@ember/object';
import { computed, observer } from '@ember/object';
import Service from '@ember/service';
import RemoteStorage from 'npm:remotestoragejs';
import Widget from 'npm:remotestorage-widget';
@@ -11,7 +10,6 @@ export default Service.extend({
widget: null,
connecting: true,
connected: false,
disconnected: computed.not('connected'),
client: null,
rootListing: null,
@@ -74,14 +72,6 @@ export default Service.extend({
this.set('client', rs.scope('/'));
}.on('init'),
connectedChange: observer('connected', function() {
if (this.get('connected')) {
this.fetchRootListing();
} else {
this.set('rootListing', null);
}
}),
fetchRootListing() {
this.fetchListing('').then(items => {
this.set('rootListing', items.sortBy('name'));

2
package-lock.json generated
View File

@@ -1,6 +1,6 @@
{
"name": "inspektor",
"version": "0.4.0",
"version": "0.0.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@@ -1,22 +1,19 @@
{
"name": "inspektor",
"version": "0.4.0",
"version": "0.0.0",
"private": true,
"description": "Inspect the contents of your remote storage",
"description": "Small description for inspektor goes here",
"license": "MIT",
"author": "",
"directories": {
"doc": "doc",
"test": "tests"
},
"repository": "gitlab:skddc/inspektor",
"repository": "",
"scripts": {
"build": "ember build",
"build-prod": "ember build --environment production && npm run update-version-file",
"start": "ember server",
"test": "ember test",
"deploy": "npm run build-prod && bash scripts/deploy.sh",
"update-version-file": "bash scripts/update-version-file.sh"
"test": "ember test"
},
"devDependencies": {
"broccoli-asset-rev": "^2.4.5",

View File

@@ -1,17 +0,0 @@
#!/bin/sh
set -xe
# Check out build branch
git checkout build-production
# Copy from build dir to root
cp -r dist/* .
# Add all files
git add --all
# Commit build files
git commit -m "Update build - `date -u`"
# Push to 5apps for deployment
git push 5apps build-production:master
# Push build branch to collab repo
git push origin build-production:build-production
# Go back to master branch
git checkout master

View File

@@ -1,10 +0,0 @@
#!/bin/bash
PACKAGE_VERSION=$(cat package.json \
| grep version \
| head -1 \
| awk -F: '{ print $2 }' \
| sed 's/[",]//g' \
| tr -d '[[:space:]]')
echo $PACKAGE_VERSION > dist/VERSION