From d9fee4994f677851f0e6e9b399cdc4d284574ce5 Mon Sep 17 00:00:00 2001 From: fa Date: Fri, 9 Feb 2018 17:25:36 +0100 Subject: [PATCH 1/8] deploy --- .gitignore | 69 ++++++++++++++++++++++++++++++++++++++++++++++- README.md | 2 -- Readme.md | 11 ++++++++ index.js | 26 ++++++++++++++++-- package-lock.json | 13 --------- package.json | 25 +++++++---------- 6 files changed, 113 insertions(+), 33 deletions(-) delete mode 100644 README.md create mode 100644 Readme.md delete mode 100644 package-lock.json diff --git a/.gitignore b/.gitignore index b512c09..5cacec0 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,68 @@ -node_modules \ No newline at end of file +# Created by .ignore support plugin (hsz.mobi) +### Node template +# Logs +backend +client +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# Typescript v1 declaration files +typings/ + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env + +# next.js build output +.next + +.idea + diff --git a/README.md b/README.md deleted file mode 100644 index abf6c2e..0000000 --- a/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# I Want That Job -Fork this repository and create a pull request with your job application. We're going to run `npm start` and we love to be surprised. \ No newline at end of file diff --git a/Readme.md b/Readme.md new file mode 100644 index 0000000..e7f9436 --- /dev/null +++ b/Readme.md @@ -0,0 +1,11 @@ +# Deployment Script for my GeoCV +1. Just type ```npm start``` +2. After webpack has compiled, open localhost:8081 in your fav. browser (tested at chrome & firefox) +3. In case you want start this again, go to ```/root/client/``` and type ```npm start``` +4. Have fun ;) +##Requirements +* NodeJS and NPM +* Go:1.9.2 +* Linux/Ubuntu (I've never tested but could work on Windows, too;) ) +* free ports at 8080 and 8081 + diff --git a/index.js b/index.js index 2d9a1ac..f8b6f75 100644 --- a/index.js +++ b/index.js @@ -1,3 +1,25 @@ -const colors = require('colors'); +//git@bitbucket.org:onlyme12/client.git +//git@bitbucket.org:onlyme12/backend.git + + +var shell = require('shelljs'); +if(!shell.which("go")){ + if(shell.env.GIO_LAUNCHED_DESKTOP_FILE !== undefined){ + if(shell.env.GIO_LAUNCHED_DESKTOP_FILE.indexOf("jetbrains") == -1){ + shell.echo("Sorry, this project requires go :("); + }else { + shell.echo("this script works only outside of an IDE - please start it on a normal terminal") + } + } + shell.exec("printenv"); + shell.exit(1); +} +if (!shell.which('git')) { + shell.echo('Sorry, this script requires git'); + shell.exit(1); +} + +shell.exec("git clone git@bitbucket.org:onlyme12/client.git && cd client && npm install"); //works +shell.exec("git clone git@bitbucket.org:onlyme12/backend.git"); + -console.log(colors.rainbow('Whooop Whooop, you better give me that job because...')); \ No newline at end of file diff --git a/package-lock.json b/package-lock.json deleted file mode 100644 index fb10686..0000000 --- a/package-lock.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "iwantthatjob", - "version": "0.6.9", - "lockfileVersion": 1, - "requires": true, - "dependencies": { - "colors": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/colors/-/colors-1.1.2.tgz", - "integrity": "sha1-FopHAXVran9RoSzgyXv6KMCE7WM=" - } - } -} diff --git a/package.json b/package.json index 3440e8f..c50749a 100644 --- a/package.json +++ b/package.json @@ -1,23 +1,18 @@ { - "name": "iwantthatjob", - "version": "0.6.9", - "description": "I Want That Job", + "name": "geocvdeployment", + "version": "1.0.0", + "description": "", "main": "index.js", "scripts": { - "start": "node index.js", - "test": "echo \"Error: no test specified\" && exit 1" + "test": "echo \"Error: no test specified\" && exit 1", + "postinstall": "node index.js", + "startBackend":"cd backend && go install", + "start":"npm install && cd client && npm install && npm start" }, - "repository": { - "type": "git", - "url": "git+https://github.com/imaginecargo/iWantThatJob.git" - }, - "author": "Somebody", + "author": "ffischer", "license": "ISC", - "bugs": { - "url": "https://github.com/imaginecargo/iWantThatJob/issues" - }, - "homepage": "https://github.com/imaginecargo/iWantThatJob#readme", "dependencies": { - "colors": "^1.1.2" + "nodegit": "^0.20.3", + "shelljs": "^0.8.1" } } From 7f87d02ec8a3d9abb4e560993f926133c641d291 Mon Sep 17 00:00:00 2001 From: ffischer1984 Date: Fri, 9 Feb 2018 17:27:23 +0100 Subject: [PATCH 2/8] bugfix --- Readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Readme.md b/Readme.md index e7f9436..cd8c877 100644 --- a/Readme.md +++ b/Readme.md @@ -3,7 +3,7 @@ 2. After webpack has compiled, open localhost:8081 in your fav. browser (tested at chrome & firefox) 3. In case you want start this again, go to ```/root/client/``` and type ```npm start``` 4. Have fun ;) -##Requirements +## Requirements * NodeJS and NPM * Go:1.9.2 * Linux/Ubuntu (I've never tested but could work on Windows, too;) ) From 360994fbf11b3decd87da76daad8ff94635fa30f Mon Sep 17 00:00:00 2001 From: ffischer1984 Date: Fri, 9 Feb 2018 18:08:24 +0100 Subject: [PATCH 3/8] discoveries from a digitalocean machine ;) --- Readme.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Readme.md b/Readme.md index cd8c877..4729c38 100644 --- a/Readme.md +++ b/Readme.md @@ -8,4 +8,5 @@ * Go:1.9.2 * Linux/Ubuntu (I've never tested but could work on Windows, too;) ) * free ports at 8080 and 8081 +* sudo apt install libssl-dev (sometime node-git need that) From 4db092fb5704c07bc26d0cdefe1c451b4a103ad1 Mon Sep 17 00:00:00 2001 From: ffischer1984 Date: Fri, 9 Feb 2018 18:10:12 +0100 Subject: [PATCH 4/8] blub it seems that bitbucket like more https links for public repos instead of git/sshlinks --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index f8b6f75..1045d5c 100644 --- a/index.js +++ b/index.js @@ -19,7 +19,7 @@ if (!shell.which('git')) { shell.exit(1); } -shell.exec("git clone git@bitbucket.org:onlyme12/client.git && cd client && npm install"); //works -shell.exec("git clone git@bitbucket.org:onlyme12/backend.git"); +shell.exec("git clone https://bitbucket.org/onlyme12/client.git && cd client && npm install"); //works +shell.exec("git clone https://bitbucket.org/onlyme12/backend"); From c4dd026fec94e888839f2d6722da255ba5c2c0d1 Mon Sep 17 00:00:00 2001 From: ffischer1984 Date: Fri, 9 Feb 2018 18:28:05 +0100 Subject: [PATCH 5/8] go makes fun ;) --- Readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Readme.md b/Readme.md index 4729c38..c00b603 100644 --- a/Readme.md +++ b/Readme.md @@ -5,7 +5,7 @@ 4. Have fun ;) ## Requirements * NodeJS and NPM -* Go:1.9.2 +* Go:1.9.2 and I assume you 've set a GOBIN (```export GOBIN=$HOME/work/bin```) * Linux/Ubuntu (I've never tested but could work on Windows, too;) ) * free ports at 8080 and 8081 * sudo apt install libssl-dev (sometime node-git need that) From ca5dc389da15cb96500fd45bb7bb8ba942c8ed8c Mon Sep 17 00:00:00 2001 From: ffischer1984 Date: Fri, 9 Feb 2018 18:31:41 +0100 Subject: [PATCH 6/8] go is fun --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 1045d5c..67da568 100644 --- a/index.js +++ b/index.js @@ -11,7 +11,7 @@ if(!shell.which("go")){ shell.echo("this script works only outside of an IDE - please start it on a normal terminal") } } - shell.exec("printenv"); + shell.exec("Something is wrong with your GoLang installation - Have you GoLang:1.9? Have you set and exported a GOBIN enivornment variable? - please look in the readme"); shell.exit(1); } if (!shell.which('git')) { From 63a63a87089a15f6f38e164cd9e73a8c5754809f Mon Sep 17 00:00:00 2001 From: ffischer1984 Date: Fri, 9 Feb 2018 19:37:40 +0100 Subject: [PATCH 7/8] spelling fix --- Readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Readme.md b/Readme.md index c00b603..715c151 100644 --- a/Readme.md +++ b/Readme.md @@ -5,7 +5,7 @@ 4. Have fun ;) ## Requirements * NodeJS and NPM -* Go:1.9.2 and I assume you 've set a GOBIN (```export GOBIN=$HOME/work/bin```) +* Go:1.9.2 and I assume you 've set a global GOBIN environmental variable (```export GOBIN=$HOME/work/bin```) * Linux/Ubuntu (I've never tested but could work on Windows, too;) ) * free ports at 8080 and 8081 * sudo apt install libssl-dev (sometime node-git need that) From 4a2c881b6980c90794e1c6b66bd22f0922185ed6 Mon Sep 17 00:00:00 2001 From: ffischer1984 Date: Sun, 11 Feb 2018 23:05:26 +0100 Subject: [PATCH 8/8] in case it doesn't work.... --- index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 67da568..51481b8 100644 --- a/index.js +++ b/index.js @@ -11,7 +11,8 @@ if(!shell.which("go")){ shell.echo("this script works only outside of an IDE - please start it on a normal terminal") } } - shell.exec("Something is wrong with your GoLang installation - Have you GoLang:1.9? Have you set and exported a GOBIN enivornment variable? - please look in the readme"); + shell.echo("Something is wrong with your GoLang installation - Have you GoLang:1.9? Have you set and exported a GOBIN enivornment variable? - please look in the readme"); + shell.echo("sorry that it doesn't work on your machine. In case you're only interested in the results you can view it here: http://207.154.214.32/geocv/#/welcome. But be patient this machine is cheap and slow ;)"); shell.exit(1); } if (!shell.which('git')) {