Skip to content

Commit

Permalink
Added deploy mechanism through npm scripts.
Browse files Browse the repository at this point in the history
  • Loading branch information
Vj3k0 committed May 14, 2016
1 parent 78219dd commit 5cabd85
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ if (!isDevelopment) {
updateFeed = 'http://ea-todo.herokuapp.com/updates/latest';
}
else if (os.platform() === 'win32') {
updateFeed = 'http://eatodo.s3.amazonaws.com/updates/releases/win' + (os.arch() === 'x64' ? '64' : '32');
updateFeed = 'http://eatodo.s3.amazonaws.com/updates/latest/win' + (os.arch() === 'x64' ? '64' : '32');
}

autoUpdater.addListener("update-available", function(event) {
Expand Down
20 changes: 16 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,24 @@
"name": "eatodo",
"description": "Simple TODO application built with Electron and AngularJS.",
"scripts": {
"postinstall": "install-app-deps",
"start": "electron ./app --enable-logging --remote-debugging-port=9222",
"dev": "NODE_ENV='development' npm run start",
"dist": "npm run dist:osx && npm run dist:win32 && npm run dist:win64",
"dist:osx": "build --platform darwin",
"dist:win32": "build --platform win32 --arch ia32",
"dist:win64": "build --platform win32 --arch x64"
"pack": "npm run pack:osx && npm run pack:win",
"pack:osx": "build --platform darwin",
"pack:win": "build --platform win32 --arch all",
"dist": "npm run dist:osx && npm run dist:win",
"dist:osx": "npm run pack:osx -- -d",
"dist:win": "npm run pack:win -- -d",
"prerelease:osx": "rm -rf release/osx && mkdirp release/osx",
"release:osx": "cp -rv dist/eatodo-darwin-x64/*.{dmg,zip} release/osx && PACKAGE_VERSION=$(cat app/package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[\",]//g' | tr -d '[[:space:]]') && echo $PACKAGE_VERSION >> ./release/osx/VERSION",
"prerelease:win32": "rm -rf release/win32 && mkdirp release/win32",
"release:win32": "cp -v dist/win/{RELEASES,*.nupkg,*.exe} release/win32",
"prerelease:win64": "rm -rf release/win64 && mkdirp release/win64",
"release:win64": "cp -v dist/win-x64/{RELEASES,*.nupkg,*.exe} release/win64",
"release": "npm run release:osx && npm run release:win32 && npm run release:win64",
"deploy": "PACKAGE_VERSION=$(cat app/package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[\",]//g' | tr -d '[[:space:]]') && aws s3 sync release/ s3://eatodo/updates/$PACKAGE_VERSION/ --acl public-read && aws s3 sync s3://eatodo/updates/$PACKAGE_VERSION/ s3://eatodo/updates/latest/ --delete --acl public-read",
"all": "npm run dist && npm run release && npm run deploy"
},
"author": "Vjekoslav Ratkajec",
"devDependencies": {
Expand Down

0 comments on commit 5cabd85

Please sign in to comment.