Skip to content

Commit 0f3ae49

Browse files
committed
fix: revert docker changes, as they fail on build
1 parent 1a8cfb3 commit 0f3ae49

File tree

6 files changed

+28
-39
lines changed

6 files changed

+28
-39
lines changed

build/.dockerignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
*
2-
!Gemfile
3-
!docs-watcher/start.sh
2+
!docs-watcher/start.sh

build/Dockerfile

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
FROM ruby:2.3.5-alpine3.4
22

3-
RUN mkdir /www
4-
53
COPY docs-watcher/start.sh /
6-
COPY Gemfile /www/
74

85
RUN apk add --update \
96
bash \
@@ -15,24 +12,11 @@ RUN apk add --update \
1512
rsync \
1613
nginx \
1714
nodejs \
18-
&& rm -rf /var/cache/apk/*
19-
20-
RUN npm config set cache /var --global \
15+
&& rm -rf /var/cache/apk/* \
16+
&& npm config set cache /var --global \
2117
&& npm install -g grunt \
2218
&& mkdir /run/nginx \
23-
&& chmod +x /start.sh \
24-
&& echo "Symlinking folders..." \
25-
&& ln -s /root/docs /www/docs \
26-
&& ln -s /root/NativeScript /www/NativeScript \
27-
&& ln -s /root/nativescript-angular /www/nativescript-angular \
28-
&& ln -s /root/nativescript-sdk-examples-ng /www/nativescript-sdk-examples-ng \
29-
&& ln -s /root/nativescript-sdk-examples-js /www/nativescript-sdk-examples-js \
30-
&& ln -s /root/sidekick-docs /www/sidekick-docs \
31-
&& ln -s /root/nativescript-cli /www/nativescript-cli
32-
33-
RUN cd /www \
34-
&& bundle install \
35-
&& bundle config build.nokogiri --use-system-libraries
19+
&& chmod +x /start.sh
3620

3721
ENTRYPOINT [ "/start.sh" ]
3822

build/Gemfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,3 @@ gem 'jekyll-assets'
77
gem 'github-markdown'
88
gem 'html-pipeline'
99
gem 'jekyll-unsanitize', '0.4'
10-
gem 'commonmarker'

build/build-docs.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,18 @@ if [ ! -d "$WWW_ROOT" ]; then
3232
mkdir $WWW_ROOT
3333
fi
3434

35+
bundle config build.nokogiri --use-system-libraries
36+
3537
cd $CLI_ROOT
3638
./docs/build-jekyll-md.sh
3739

3840
cd $SIDEKICK_ROOT
41+
bundle install
3942
jekyll build --config _config.yml
4043

4144
cd $SCRIPT_PATH
4245

4346
cp -r $SCRIPT_PATH"/_config_vuejs.yml" \
44-
$SCRIPT_PATH"/fonts" \
4547
$SCRIPT_PATH"/_assets" \
4648
$SCRIPT_PATH"/_layouts" \
4749
$SCRIPT_PATH"/_plugins" \
@@ -108,4 +110,4 @@ cp -R $MODULES_ROOT"/bin/dist/api-reference" \
108110
$WWW_ROOT
109111

110112
cp -R $NS_DIST_ROOT"/./" $WWW_ROOT
111-
cp -R $NG_DIST_ROOT"/./" $WWW_ROOT"/angular"
113+
cp -R $NG_DIST_ROOT"/./" $WWW_ROOT"/angular"

build/docs-watcher/start.sh

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,18 @@ sigint_handler() {
2323
trap 'kill ${!}; sigterm_handler' SIGTERM
2424
trap 'sigint_handler' SIGINT
2525

26+
mkdir /www
27+
echo "Start copying mounted folders..."
28+
rsync --relative -az --exclude node_modules/ \
29+
/root/./docs \
30+
/root/./NativeScript \
31+
/root/./nativescript-angular \
32+
/root/./nativescript-sdk-examples-ng \
33+
/root/./nativescript-sdk-examples-js \
34+
/root/./sidekick-docs \
35+
/root/./nativescript-cli \
36+
/www
37+
2638
/www/docs/build/build-docs.sh
2739
/www/docs/build/nginx-setup.sh
2840

@@ -33,4 +45,4 @@ node index.js & PID="$!"
3345
while true
3446
do
3547
tail -f /dev/null & wait ${!}
36-
done
48+
done

build/docs-watcher/watchers.js

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -177,19 +177,12 @@ module.exports.SourcesWatcher = class SourcesWatcher {
177177
var filename = path.basename(f);
178178
if (filename == "_config.yml" || filename == "_config_nativescript.yml" || filename == "_config_angular.yml") {
179179
console.log(`${f} updated -> restarting jekyll service...`);
180-
var destination;
181-
182180
if (f.toLowerCase().indexOf("sidekick-docs") < 0) {
183-
destination = path.join(paths.binRoot, filename);
181+
fs.copySync(f, path.join(paths.binRoot, filename));
184182
} else {
185-
destination = path.join(paths.sidekickRoot, filename);
183+
fs.copySync(f, path.join(paths.sidekickRoot, filename));
186184
}
187-
188-
if (f !== destination) {
189-
fs.copySync(f, destination);
190-
this.jekyllService.restart();
191-
}
192-
185+
this.jekyllService.restart();
193186
return;
194187
}
195188

@@ -201,8 +194,8 @@ module.exports.SourcesWatcher = class SourcesWatcher {
201194
if (f.toLowerCase().indexOf("sidekick-docs") > -1) {
202195
destination = path.join(paths.sidekickRoot, relativePath);
203196
}
204-
``
205-
if (fs.existsSync(f) && f !== destination) {
197+
198+
if (fs.existsSync(f)) {
206199
console.log(`${destination} updated -> rebuilding site...`);
207200
ensureDestPath(destination);
208201
fs.copySync(f, destination);
@@ -214,7 +207,7 @@ module.exports.SourcesWatcher = class SourcesWatcher {
214207
var relativePath = path.relative(paths.sourceFilesRoot, f);
215208
var destFile = path.join(paths.wwwRoot, relativePath);
216209

217-
if (fs.existsSync(f) && f !== destFile) {
210+
if (fs.existsSync(f)) {
218211
ensureDestPath(destFile);
219212
fs.copySync(f, destFile);
220213
console.log(`${destFile} updated -> rebuilding site...`);
@@ -268,4 +261,4 @@ function ensureDestPath(filename) {
268261
if (!fs.existsSync(folder)) {
269262
fs.ensureDirSync(folder);
270263
}
271-
}
264+
}

0 commit comments

Comments
 (0)