Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
HCI Theme
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
HCI-Development
HCI Theme
Commits
c19d780f
Commit
c19d780f
authored
May 11, 2020
by
Andreas Knote
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
migrate to faster image resizing
parent
915b3144
Pipeline
#22675
passed with stage
in 12 minutes and 25 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
18 deletions
+47
-18
Dockerfile
Dockerfile
+27
-14
scripts/development
scripts/development
+8
-4
scripts/watch-and-resize
scripts/watch-and-resize
+12
-0
No files found.
Dockerfile
View file @
c19d780f
FROM
ubuntu:focal AS
nodejs_base
FROM
ubuntu:focal AS
essential_base
LABEL
maintainer="andreas.knote@uni-wuerzburg.de"
...
...
@@ -9,15 +9,9 @@ RUN apt-get update && apt-get upgrade && \
apt-get
install
-y
\
curl ssh git-lfs build-essential locales
RUN
apt-get update
&&
\
curl
-sL
https://deb.nodesource.com/setup_13.x | bash -
&&
\
apt-get
install
-y
nodejs
&&
\
echo
'Node: '
&&
\
node
-v
&&
\
echo
'NPM: '
&&
\
npm
-v
FROM
nodejs_base AS ruby_jekyll
# Install Ruby and Jekyll
FROM
essential_base AS ruby_jekyll
RUN
apt-get update
&&
\
apt-get
install
-y
\
...
...
@@ -39,18 +33,37 @@ RUN locale-gen en_US.UTF-8 && \
ENV
LANG en_US.UTF-8
ENV
LC_ALL en_US.UTF-8
FROM
ruby_jekyll AS image_resize
RUN
apt-get update
&&
apt-get
install
-y
\
imagemagick
## Install NodeJS
FROM
ruby_jekyll AS nodejs
RUN
apt-get update
&&
\
curl
-sL
https://deb.nodesource.com/setup_13.x | bash -
&&
\
apt-get
install
-y
nodejs
&&
\
echo
'Node: '
&&
\
node
-v
&&
\
echo
'NPM: '
&&
\
npm
-v
FROM
image_resize AS hci_theme
## Install the batch-resize script
FROM
nodejs AS image_resize
## Build Theme from source
RUN
apt-get update
&&
apt-get
install
-y
\
python3-pil imgp rsync inotify-tools
&&
\
git clone https://gitlab2.informatik.uni-wuerzburg.de/hci-development/batch-resize.git /batch-resize
&&
\
ln
-s
/batch-resize/batch-resize /usr/bin/batch-resize
## Build HCI-Theme from source
## Installs the built gem system-wide
COPY
. /
RUN
bundle
install
&&
\
bundle
exec
rake gem
&&
\
gem
install
hci-theme.gem
&&
\
rm
-rf
node_modules
&&
\
rm
package-lock.json
# Make development scripts available
RUN
ln
-s
/scripts/
*
/usr/bin/
&&
hash
scripts/development
View file @
c19d780f
#!/usr/bin/env bash
# Build
# Resize Images
watch-and-resize ./assets/images/ ./public/assets/images/ &
# Serve HCI Site
bundle
bundle update
bundle
exec
war
&
jekyll serve
--host
=
0.0.0.0
--port
=
4200
--trace
--incremental
&
jekyll serve
--host
=
0.0.0.0
--port
=
4200
--trace
--incremental
&
PIDS[0]
=
$!
trap
"kill
${
PIDS
[*]
}
"
SIGINT
wait
\ No newline at end of file
wait
scripts/watch-and-resize
0 → 100755
View file @
c19d780f
#!/usr/bin/env bash
source_dir
=
${
1
}
target_dir
=
${
2
}
batch-resize
${
source_dir
}
${
target_dir
}
echo
"[watch-and-resize]
$source_dir
->
$target_dir
"
while
inotifywait
-q
-e
modify
-r
${
source_dir
}
;
do
batch-resize
${
source_dir
}
${
target_dir
}
done
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment