ouwen / hikari Goto Github PK
View Code? Open in Web Editor NEWBoilerplate Code For Apps
Boilerplate Code For Apps
As mentioned by @Ouwen in the README, there can still be a race condition where the API service starts up before the postgres db(s) are ready to accept a connection (in spite of docker's depends-on
which only ensures ordered container start times). Couple ways to mitigate:
docker-compose ... --restart=on-failure:5
api
, we health check postgres and only start up the node server after postgres is upnode-postgres
pool, but that's less agnostic to API's implementationGood reference: https://docs.docker.com/compose/startup-order/
When grunt test is run, protractor waits for the selenium chrome browser to spawn. This never happens and the tests timeout.
Running "protractor:chrome" (protractor) task
[launcher] Running 1 instances of WebDriver
------------------------------------
[chrome #1a] PID: 119
[chrome #1a] Specs: /src/e2e/login/login.spec.js
[chrome #1a]
[chrome #1a] Using ChromeDriver directly...
[chrome #1a] ERROR - Unable to start a WebDriver session.
[chrome #1a]
[chrome #1a] /src/node_modules/selenium-webdriver/http/util.js:87
[chrome #1a] Error('Timed out waiting for the WebDriver server at ' + url));
[chrome #1a] ^
[chrome #1a] Error: Timed out waiting for the WebDriver server at http://127.0.0.1:57413/
[chrome #1a] at Error (native)
[chrome #1a] at onResponse (/src/node_modules/selenium-webdriver/http/util.js:87:11)
[chrome #1a] at /src/node_modules/selenium-webdriver/http/util.js:42:21
[chrome #1a] at /src/node_modules/selenium-webdriver/lib/webdriver/http/http.js:96:5
[chrome #1a] at ClientRequest.<anonymous> (/src/node_modules/selenium-webdriver/http/index.js:145:7)
[chrome #1a] at emitOne (events.js:77:13)
[chrome #1a] at ClientRequest.emit (events.js:169:7)
[chrome #1a] at Socket.socketErrorListener (_http_client.js:267:9)
[chrome #1a] at emitOne (events.js:77:13)
[chrome #1a] at Socket.emit (events.js:169:7)
[chrome #1a] ==== async task ====
[chrome #1a] WebDriver.createSession()
[chrome #1a] at Function.webdriver.WebDriver.acquireSession_ (/src/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:149:22)
[chrome #1a] at Function.webdriver.WebDriver.createSession (/src/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:123:30)
[chrome #1a] at new Driver (/src/node_modules/selenium-webdriver/chrome.js:477:36)
[chrome #1a] at Object.createDriver (/src/node_modules/selenium-webdriver/chrome.js:453:10)
[chrome #1a] at DirectDriverProvider.getNewDriver (/src/node_modules/grunt-protractor-runner/node_modules/protractor/lib/driverProviders/direct.js:68:23)
[chrome #1a] at Runner.createBrowser (/src/node_modules/grunt-protractor-runner/node_modules/protractor/lib/runner.js:180:37)
[chrome #1a] at /src/node_modules/grunt-protractor-runner/node_modules/protractor/lib/runner.js:257:21
[chrome #1a] at _fulfilled (/src/node_modules/grunt-protractor-runner/node_modules/q/q.js:797:54)
[chrome #1a] at self.promiseDispatch.done (/src/node_modules/grunt-protractor-runner/node_modules/q/q.js:826:30)
When running grunt build the imagemin task fails. This is likely because the jpeg-tran package does not properly install during the npm install
phase.
> [email protected] postinstall /src/node_modules/jpegtran-bin
> node lib/install.js
⚠ The `/src/node_modules/jpegtran-bin/vendor/jpegtran` binary doesn't seem to work correctly
⚠ jpegtran pre-build test failed
ℹ compiling from source
✖ Error: touch configure.ac aclocal.m4 configure Makefile.am Makefile.in && ./configure --disable-shared --prefix="/src/node_modules/jpegtran-bin/vendor" --bindir="/src/node_modules/jpegtran-bin/vendor" && make install
Command failed: /bin/sh -c ./configure --disable-shared --prefix="/src/node_modules/jpegtran-bin/vendor" --bindir="/src/node_modules/jpegtran-bin/vendor"
configure: error: no nasm (Netwide Assembler) found
at ChildProcess.exithandler (child_process.js:213:12)
at emitTwo (events.js:87:13)
at ChildProcess.emit (events.js:172:7)
at maybeClose (internal/child_process.js:827:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
npm WARN prefer global [email protected] should be installed with -g
Warning: Running "imagemin:dist" (imagemin) task
Warning: Error: Error: write EPIPE/src/node_modules/jpegtran-bin/vendor/jpegtran: 1: /src/node_modules/jpegtran-bin/vendor/jpegtran: Syntax error: "(" unexpected
in file client/assets/images/background.jpg Use --force to continue.
Aborted due to warnings.
Execution Time (2016-08-12 15:44:24 UTC-0)
loading tasks 206ms ▇▇ 5%
loading grunt-contrib-imagemin 4.1s ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 93%
imagemin:dist 98ms ▇ 2%
Total 4.4s Use --force to continue.
Aborted due to warnings.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.