Skip to content

Commit

Permalink
Build-Script to automate the build process
Browse files Browse the repository at this point in the history
  • Loading branch information
Timo Stark committed Apr 27, 2021
1 parent 68e83f0 commit 4ba4e1d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
This is a working demo on how to parse and manipulate XML-messages (e.g. SAML-Headers) with njs.

## 1. Build npm modules for njs
To build the libraries for njs simply build the Docker-Container and download the files or use them in another NGINX-Container with Docker multistage-build.
To build the libraries for njs simply build the Docker-Container and download the files or use them in another NGINX-Container with Docker multistage-build. The `build.sh` Script will help in this case.

`docker build -t nginx:samllibs .`
`./build.sh` to build the libraries. They will be available in the build-folder.

Do build the libraries on the current system issue the following commands:
Learn more about how to use node-modules with njs (http://nginx.org/en/docs/njs/node_modules.html)
Expand Down
16 changes: 16 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash

echo "🛠 Building ... "

docker build -t tippexs/ngxsamlp:latest .

echo "🧩 Linking ... "

ID=$(docker create tippexs/ngxsamlp:latest)
echo $ID
echo "💫 Copying files ... "
docker cp $ID:/tmp/xmldom.js $(pwd)/build/xmldom.js
docker cp $ID:/tmp/xpath.js $(pwd)/build/xpath.js

echo "🧻 Cleaning up..."
docker rm -v $ID
Empty file added build/.gitkeep
Empty file.

0 comments on commit 4ba4e1d

Please sign in to comment.