@@ -38,6 +38,7 @@ class SpawnError extends Error {
3838/**
3939 * Wraps a child process spawn in a promise which resolves
4040 * when the child process exists.
41+ *
4142 * @param {Array } args the command and its arguments to run (uses /usr/bin/env)
4243 * @param {Object } options various execution options; attributes:
4344 * - {Boolean} capture whether to capture stdout and return its contents
@@ -104,6 +105,7 @@ function promisedSpawn( args, options ) {
104105
105106/**
106107 * Generates the Dockerfile used to build the image and start the container
108+ *
107109 * @return {Promise } the promise which creates the image file
108110 */
109111function createDockerFile ( ) {
@@ -192,8 +194,7 @@ function createDockerFile() {
192194 contents += `RUN apt-get update && apt-get install -y ${ extraPkgs . join ( ' ' ) } && rm -rf /var/lib/apt/lists/*\n` ; /**/
193195
194196 if ( customSourcePkgs . length ) {
195- contents += `RUN echo > /etc/apt/sources.list && ${ customSourcePkgs . map ( ( customSourcePkgSpec ) =>
196- `echo deb "${ customSourcePkgSpec . repo_url } ${ customSourcePkgSpec . release } ${ customSourcePkgSpec . pool } " >> /etc/apt/sources.list` ) . join ( ' && ' ) } \n`;
197+ contents += `RUN echo > /etc/apt/sources.list && ${ customSourcePkgs . map ( ( customSourcePkgSpec ) => `echo deb "${ customSourcePkgSpec . repo_url } ${ customSourcePkgSpec . release } ${ customSourcePkgSpec . pool } " >> /etc/apt/sources.list` ) . join ( ' && ' ) } \n` ;
197198 contents += `RUN apt-get update && ${ customSourcePkgs . map ( ( customSourcePkgSpec ) => `apt-get install -y --force-yes -t ${ customSourcePkgSpec . release } ${ customSourcePkgSpec . packages . join ( ' ' ) } ` ) . join ( ' && ' ) } && rm -rf /var/lib/apt/lists/*\n` ; /**/
198199 }
199200
@@ -258,6 +259,7 @@ function createDockerFile() {
258259
259260/**
260261 * Spawns a docker process which (re)builds the image
262+ *
261263 * @return {Promise } the promise starting the build
262264 */
263265function buildImg ( ) {
@@ -271,6 +273,7 @@ function buildImg() {
271273
272274/**
273275 * Starts the container and returns once it has finished executing
276+ *
274277 * @param {Array } args the array of extra parameters to pass, optional
275278 * @param {boolean } hidePorts whether to keep the ports hidden inside the container, optional
276279 * @return {Promise } the promise starting the container
@@ -303,6 +306,7 @@ function startContainer( args, hidePorts ) {
303306/**
304307 * Verify that Docker is installed and that the minimum version is 1.8 (1.12 Mac)
305308 * or terminate the runner.
309+ *
306310 * @return {boolean } true if Docker is installed and > min version
307311 */
308312function ensureDockerVersion ( ) {
@@ -330,6 +334,7 @@ function ensureDockerVersion() {
330334 * Updates the deploy repository to current master and
331335 * rebuilds the node modules, committing and git-review-ing
332336 * the result
337+ *
333338 * @return {Promise }
334339 */
335340function updateDeploy ( ) {
@@ -450,8 +455,9 @@ function updateDeploy() {
450455 opts . submodule_ref ,
451456 opts . submodule ] ) ;
452457 }
453- } ) . then ( ( ) => // make sure the package.json symlink is in place
454- fs . symlinkAsync ( `${ opts . submodule } /package.json` , 'package.json' )
458+ } ) . then (
459+ // make sure the package.json symlink is in place
460+ ( ) => fs . symlinkAsync ( `${ opts . submodule } /package.json` , 'package.json' )
455461 . catch ( ( ) => { } ) . then ( ( ) => promisedGit ( [ 'add' , 'package.json' ] ) ) ) . then ( ( ) => {
456462 if ( ! opts . need_build ) {
457463 return ;
@@ -490,10 +496,12 @@ function updateDeploy() {
490496 ] ;
491497 }
492498 return promisedSpawn ( findAttr , { capture : true , ignoreErr : true } ) ;
493- } ) . then ( ( ) => // add the built submodules
494- promisedGit ( [ 'add' , 'node_modules' ] ) ) ;
495- } ) . then ( ( ) => // commit the changes
496- promisedGit ( [ 'commit' , '-m' , opts . commit_msg ] ) )
499+ } ) . then ( // add the built submodules
500+ ( ) => promisedGit ( [ 'add' , 'node_modules' ] )
501+ ) ;
502+ } )
503+ // commit the changes
504+ . then ( ( ) => promisedGit ( [ 'commit' , '-m' , opts . commit_msg ] ) )
497505 . then ( ( ) => {
498506 if ( ! opts . review ) {
499507 console . log ( '\n\nChanges are sitting in the sync-repo branch in' ) ;
@@ -516,6 +524,7 @@ function updateDeploy() {
516524
517525/**
518526 * Determines the UID and GID to run under in the container
527+ *
519528 * @return {Promise } a promise resolving when the check is done
520529 */
521530function getUid ( ) {
0 commit comments