##// END OF EJS Templates
dev(static-files): new way of building static files
super-admin -
r5233:49f00b60 default
parent child Browse files
Show More
@@ -0,0 +1,39 b''
1 ## HOW TO: ##
2 ##
3 ## build this image add --no-cache for forced-build:
4
5 ## ** BUILD **
6 # docker build --tag rhodecode/static-files-build:16 -f static-build.dockerfile .
7 # docker build --tag rhodecode/static-files-build:18 -f static-build.dockerfile .
8
9 ## run grunt on top of the source code
10 ## cd rhodecode-enterprise-ce
11 ## docker run --rm -v $PWD:/project --workdir=/project rhodecode/static-files-build grunt
12
13 ## ** GENERATE **
14 ## docker run -it --entrypoint bash --rm -v $PWD:/project --workdir=/project rhodecode/static-files-build:16 -c "npm install && grunt -v"
15
16 # THIS WORKS NOW
17 FROM node:16-buster
18 #FROM node:18-buster
19
20 WORKDIR /static_build
21
22 RUN apt-get update \
23 && apt-get install --no-install-recommends --yes \
24 curl \
25 zip \
26 && apt-get autoremove \
27 && apt-get clean \
28 && rm -rf /var/lib/apt/lists/*
29
30 # make node scripts visible
31 ENV \
32 PATH=/static_build/node_modules/.bin:/project/node_modules/.bin:$PATH \
33 NODE_PATH=/node_modules/.bin/node_mod \
34 WEBPACK=/static_build/node_modules/.bin/webpack \
35 GRUNT=/static_build/node_modules/.bin/grunt
36
37 WORKDIR /project
38
39 ENTRYPOINT ["bash"]
@@ -5,10 +5,6 b' SHELL = /bin/bash'
5 # set by: PATH_TO_OUTDATED_PACKAGES=/some/path/outdated_packages.py
5 # set by: PATH_TO_OUTDATED_PACKAGES=/some/path/outdated_packages.py
6 OUTDATED_PACKAGES = ${PATH_TO_OUTDATED_PACKAGES}
6 OUTDATED_PACKAGES = ${PATH_TO_OUTDATED_PACKAGES}
7
7
8 NODE_PATH=./node_modules
9 WEBPACK=./node_binaries/webpack
10 GRUNT=./node_binaries/grunt
11
12 .PHONY: clean
8 .PHONY: clean
13 ## Cleanup compiled and cache py files
9 ## Cleanup compiled and cache py files
14 clean:
10 clean:
@@ -86,22 +82,12 b' docs-cleanup:'
86
82
87 .PHONY: web-build
83 .PHONY: web-build
88 ## Build JS packages static/js
84 ## Build JS packages static/js
89 # https://hub.docker.com/r/huli/grunt
90 web-build:
85 web-build:
91 NODE_PATH=$(NODE_PATH) $(GRUNT)
86 docker run -it --rm -v $(PWD):/project --workdir=/project rhodecode/static-files-build:16 -c "npm install && grunt"
87 # run static file check
88 ./rhodecode/tests/scripts/static-file-check.sh rhodecode/public/
89 rm -rf node_modules
92
90
93 # check required files
94 STATIC_CHECK="/robots.txt /502.html \
95 /js/scripts.min.js /js/rhodecode-components.js \
96 /css/style.css /css/style-polymer.css /css/style-ipython.css"
97
98 for file in $STATIC_CHECK;
99 do
100 if [ ! -f rhodecode/public/$file ]; then
101 echo "Missing $file expected after web-build"
102 exit 1
103 fi
104 done
105
91
106 .PHONY: pip-packages
92 .PHONY: pip-packages
107 ## Show outdated packages
93 ## Show outdated packages
General Comments 0
You need to be logged in to leave comments. Login now