An example based by the demo code written by flosell , I use this skeleton in my work.
- Run
lein runin this direcotory, an http server will start listening on port 9081 on loalhost. You can change this incore.clj. - Run
lein uberjarin this direcotory, a fat jar will be generated under target directory. Then you can executejava -jar multiple_pipeline_example-0.1.0-SNAPSHOT-standalone.jarto start the http server.
I use the second way to deploy the LambdaCD in a server, and use nginx as the proxy. The following options needed in nginx for LambdaCD:
server {
... ...
# tell http-kit to keep the connection
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_set_header Upgrade $http_upgrade;
# Web socket
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
}
To add an new pipeline, just write it in a new .clj file under the pipelines directory, and add its config in pipeline-configs in the index.clj .
I use git with HTTPS in the example_two, it use OS environment variable LAMBDACD_GITHUB_USERNAME and LAMBDACD_GITHUB_PASSWORD for the authentication for HTTPS .