View docs from Git hub repository - makefile

I have cloned the repository - https://github.com/hyperledger/sawtooth-supply-chain. There is a docs folder in this repository that has a folder named 'source' and files named 'Makefile' and 'supply-chain-build-docs'
I want to know if I build the contents in this directory, whether I would be able to view additional documentation other than what is in ReadMe.md file.
If so, how should I build and view the files? I have installed sphinx.
In which port will I be able to see the html documentation after the build?

If you open the supply-chain-build-docs file you will notice the instructions to build the docs is mentioned inside.
Description:
Builds the environment needed to build the Sawtooth Supply Chain docs
Running the image will put the docs in
sawtooth-supply-chain/docs/build on your local machine.
Build:
$ cd sawtooth-supply-chain
$ docker build . -f docs/supply-chain-build-docs -t supply-chain-build-docs
Run:
$ cd sawtooth-supply-chain
$ docker run -v $(pwd):/project/sawtooth-supply-chain supply-chain-build-docs
This documentation although assumes that you already have docker installed. The guide to install it in ubuntu can be found here
In which port will I be able to see the html documentation after the build?
Once you run both the steps above you can find a neat pdf on the location sawtooth-supply-chain/docs/build/latex named as sawtooth.pdf ready for you :)

Related

Create command when cloning github repository

Today, I went and looked at the Jelly github page. I found this.
I noticed that after they cloned the repo(and moving to the jellylanguage directory), they were able to use the "jelly" command. How is this possible? And how can I do it myself?
It is an executable binary. You can compile code to create a natively executable binary that can be run as ./a - then you can put that in /usr/local/bin to be able to use it from anywhere OR add the directory where that binary is to your path environment variable

Nativescript UI Pro licence on CI

I'm trying to enable Travis CI on my NativeScript project and have purchased a NativeScript UI Pro library (without support).
How can I enable the license on each build on the server?
When installing the package it is referenced to a local .tgz file. in package.json like this:
dependencies: {
"nativescript-telerik-ui-pro": "file:pathToTelerikUiProPackage.tgz"
}
How can I make this file available to Travis without adding it to source control?
Did you follow the Pro install instructions at http://docs.telerik.com/devtools/nativescript-ui/getting-started
I don't have Pro, but it sounds like you don't use NPM to install it - you manually extract the file you get from their website and then add it as a plugin.
If this doesn't help, consider posting a question on their dedicated forums.
Further research made it clear that I needed to co-locate the Nativescript UI Pro package to my source code.
Given I work on an open source project this was not a solution.
As a work around I placed the package in a private repository and added a before_install script to download the file to the working directory on Travis.
.travis.yml:
before_install:
- sh get-nativescript-ui-pro.sh
The script to download is as follows.
get-nativescript-ui-pro.sh:
#!/bin/bash
if [ "$PRIVATE_USER" = "" ];
then
echo "ERROR: Can't get nativescript-ui-pro package. User not set";
exit;
fi
curl --trace /dev/null -s -O -u $PRIVATE_USER {LINK TO RESOURCE}
Replace {LINK TO RESOURCE} with a complete link to the resource, i.e. the stored Nativescript UI Pro .tgz file. An environment variable named PRIVATE_USER holds the credentials to the repository account. This can be set in the Travis configuration panel for the specific repository.

How to build Courguette in Debian

Right now I am trying to compile Courguette in order to generate a diff patch. The source and some documentation can be found in the following link:
Courguette
I downloaded it but I don't find the way of compiling it.
I have Googled and found some references even to this forum, such as:
StackOverflow link
And other references:
Chromium Linux build instructions
After reading things about ninja and gpy I decided to install them, but there are not references to a .ninja file. I find a courguette.gyp file but using gpy I neither get it compiled...
I am following the guide they provide:
Installed the depot_tools and added to the path.
gclient runhooks
gclient sync
And when I execute gn gen out/Default it fails with the following message:
gn.py: Could not find gn executable at: ~/binary_diff_tools/courgette-master/courgette/buildtools/linux64/gn
Then I used git to pull from the repository the buildtools, but I get the same result.
Any help will be appreciated.
Best regards,
Iván
Ok... It seems that is needed to install all Chromium dependencies before being able to compile courgette so... it must be done as follows:
Install depot_tools git clone and you will have them installed.
After including the depot_tools in your patch (.profile or .bashsrc for example as indicate the depot_tools installation tutorial) execute fetch chromium ouside the depot_tools folder ( it always failed me when I executed it inside the same folder).
I want to build it in Debian so I have to do "gclient runhooks" instead of the .sh script for Ubuntu.
ninja -C out/Default courgette
You will find the executable in the folder out/Default, so ./courgette and it will indicate you the right parameters in order to generate your patch properly.
Best regards,
Iván.

Install wkhtmltopdf on heroku using a java application

I manged to get my spring boot website online on Heroku. But I also use wkhtmltopdf to create a pdf. This works locally but now I have some problems.
Offline it works as follow :
ProcessBuilder pb = new ProcessBuilder
("cmd.exe",
"/c",
" cd C:\\Program Files\\wkhtmltopdf\\bin && wkhtmltopdf.exe "
+ "http://google.com C:\\MainWebApps\\TestApp\\src\\main\\resources\\userstorage\\Google2.pdf");
But how do I install this on Heroku?
Where do I store the temporarily html page so I can create a pdf from it ?
And where is wkhtmltopdf installed on Heroku ?
Can I call the wkhtmltopdf with a processbuilder on heroku?
EDIT
So after the comment of ceejayoz I googled a bit more and did find some interesting stuff.
So for Compile the binaries on Heroku I used this:
heroku run /bin/bash
Then I did a curl of wkhtmltopdf like this:
curl -O http://download.gna.org/wkhtmltopdf/0.12/0.12.0/wkhtmltox-linux-amd64_0.12.0-03c001d.tar.xz
Then I tried to extract it on the server but without success:
$ tar -xjvf wkhtmltox-linux-amd64_0.12.0-03c001d.tar.xz
tar (child): wkhtmltox-linux-amd64_0.12.0-03c001d.tar.xz: Cannot open: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
EDIT2
I also found this https://github.com/dscout/wkhtmltopdf-buildpack on github.
So I did following :
heroku buildpacks:set 'https://github.com/heroku/heroku-buildpack-multi.git'
echo 'https://github.com/dscout/wkhtmltopdf-buildpack.git' >> .buildpacks
This created a file named .buildpacks but how do I proceed from there on ?
I also found this post but vulcan is deprecated and uses ruby
Using Wkhtmltopdf with Nodejs on Heroku
Can somebody provide me with good information because I am completely stuck with this?
You actually have two problems that you need to solve -
How to install/invoke the executable
How to handle the generated .pdf
Assuming you have the basics of Heroku deployment (push to the Heroku git remote), for #1, #ceejayoz is right - check the binary into your git repository. For example, under a ./bin directory. The root of your project (where the Procfile is) will be your working directory, and you should be able to invoke the program with ProcessBuilder using relative paths.
Caveat - since it looks like you are developing on Windows, you will need to pay attention to ensuring both platform-specific binaries are available, and add some logic to know which one to invoke (for example, by setting/checking a specific environment variable).
I recommend against trying to build with a custom build pack - you will spend a lot of energy for little to no benefit. Aside from the platform issue, you don't need to rebuild a third party tool when your code changes...
The second problem is that you can't leave the generated PDF in place. It will go away when the dyno is restarted (see https://devcenter.heroku.com/articles/dynos#ephemeral-filesystem). Thus, the first thing you should do when the process completes is move the generated file to an external storage service (Amazon S3 is a good starting point).
Hope this helps.
You might want to use wkhtmltopdf-binary. With that solution, you do not need to put wkhtmltopdf executable into your VCS. You can use it for example with Maven or Gradle.

Building small container for running compiled go code

From
https://docs.docker.com/articles/baseimages/
I am trying to build a base image to run compiled go code, from:
https://github.com/tianon/dockerfiles/tree/master/true
I have tried to copy into docker the true.goThen: exec: "/true": permission denied
Also tried to bash into it, then: "bash"Then: executable file not found in $PATH
Also tried to use the debootstrap raring raring > /dev/null Then: "bash": executable file not found in $PATH
How do you do this?
Thanks
I'm not sure I entirely follow.
The Dockerfile from the linked project builds an image with nothing in it except an executable - there will be no shell or compiler, so running bash will be impossible. It does this by using the special scratch base image, which is simply a completely empty filesystem.
If you clone the repository and build the image using the Dockerfile (docker build -t go-image .), it will simply copy the executable directly into the image (note the Dockerfile copies the executable true-asm, not the source code true.go). If you then use docker run to start the image, it will run it (docker run go-image).
Does that make sense? The code is compiled locally (or by another container) and the compiled, stand-alone executable is placed by itself into the image.
Generally, you don't want to do this and definitely not when you're beginning - it will be easier for you to use a golang or debian image which will include basic tools such as a shell.

Resources