How to prepare the source code correctly?


#1

There is a huge leap from this comment, “You are not expected to take any action in this step” to this required action, “Change the ‘pkg_source’ value to point to the archive file that contains the source files described in the previous step”, without any helpful instructions in between.

I’ve tried every file and directory structure and compression command I can think of, but always hit an error of one kind or another.

My most recent attempt :

me@mine:~/tinyhttp$ tar -ztvf ${pkg_filename}
drwxrwxr-x me/me           0 2016-08-31 09:18 mytutorialapp-0.2.0/
-rw-rw-r-- me/me         399 2016-08-31 09:14 mytutorialapp-0.2.0/package.json
drwxrwxr-x me/me           0 2016-08-31 06:59 mytutorialapp-0.2.0/config/
-rw-rw-r-- me/me          55 2016-08-31 06:53 mytutorialapp-0.2.0/config/config.json
-rw-rw-r-- me/me         424 2016-08-31 08:39 mytutorialapp-0.2.0/server.js
-rw-rw-r-- me/me          33 2016-08-31 09:15 mytutorialapp-0.2.0/README.md
me@mine:~/tinyhttp$ 

But I edited server.js to access config.json internally, like this :

nconf.file({ file: './config/config.json' });

When originally it’s like this :

nconf.file({ file: '../config/config.json' });

So, not surprisingly, my end result when testing the docker image is :

mytutorialapp(SV): Starting
mytutorialapp(O): 
mytutorialapp(O): > mytutorialapp@0.2.0 start /hab/svc/mytutorialapp/var
mytutorialapp(O): > node server.js
mytutorialapp(O): 
mytutorialapp(O): Running on http://0.0.0.0:NaN

(The port number can’t be found.)

I started the tutorial 4 hours ago. Most of that time has been trial and error responding to errors resulting from guessing those critical but undocumented steps.

I need a complete explanation of :

  1. the proper layout for the source code
  2. how to test it with NodeJS before making the tarball
  3. the command to create the tarball, (ie; should it contain the directory, or just the directory contents)