Skip to content

Commit

Permalink
Merge pull request #63 from wasmCloud/upgrade-nodejs
Browse files Browse the repository at this point in the history
use shell scripts and avoid Dockerfile completely
  • Loading branch information
wasmcloud-automation authored Dec 15, 2021
2 parents 4d1c875 + ea28626 commit 4d6b70b
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 31 deletions.
3 changes: 3 additions & 0 deletions docgen/dev/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dist
node_modules
package-lock.json
13 changes: 0 additions & 13 deletions docgen/dev/Dockerfile

This file was deleted.

3 changes: 0 additions & 3 deletions docgen/dev/build-docker.sh

This file was deleted.

7 changes: 7 additions & 0 deletions docgen/dev/build-tailwind-css.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh -x
# This is run inside the docker container created by update-css.sh

npm install
npm run build
npm run build-prod

3 changes: 1 addition & 2 deletions docgen/dev/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@
"tailwindcss": "^2.1.4"
},
"scripts": {
"build": "npx tailwindcss-cli@latest build src/css/styles.css -c conf/tailwind.config.js -o dist/tailwind.css",
"build": "npx -y tailwindcss-cli@latest build src/css/styles.css -c conf/tailwind.config.js -o dist/tailwind.css",
"build-prod": "NODE_ENV=production npx tailwindcss-cli@latest build src/css/styles.css -c conf/tailwind.config.js -o dist/tailwind.min.css",
"dist": "cp dist/tailwind*.css ../public/css/",
"build-all": "npm run build && npm run build-prod && npm run dist",
"clean": "rm -rf dist/*.css node_modules/.bin node_modules/*",
"test": "echo \"Error: no test specified\" && exit 1"
Expand Down
23 changes: 10 additions & 13 deletions docgen/dev/update-css.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
#!/bin/sh
#!/bin/sh -ex

OUT=$(mktemp -d)
mkdir $OUT/css
chmod 755 $OUT
chmod 777 $OUT/css

docker run --rm \
-v $PWD/../../codegen/templates/html:/templates:ro \
-v $PWD/conf:/project/conf:ro \
-v $PWD/src:/project/src:ro \
-v $OUT:/public \
css-dev npm run build-all
rm -f dist/*.css
docker run --rm -it \
-v "$PWD/../../codegen/templates/html:/templates:ro" \
-v "$PWD:/project:rw" \
-v "$OUT:/public:rw" \
--user "$(id -u):$(id -g)" \
--workdir /project \
node:latest /project/build-tailwind-css.sh

mkdir -p ./gen/css
cp -v $OUT/css/*.css ./gen/css/
cp -v ./dist/*.css ./gen/css/



0 comments on commit 4d6b70b

Please sign in to comment.