Commit ed277bb4 authored by Sam McCollum's avatar Sam McCollum

sm - add icon generation to CI

parent e0d5db85
Pipeline #566 canceled with stage
in 1 minute and 3 seconds
image: 'selenium/standalone-firefox:latest'
stages:
- build
build:
stage: build
script:
- ./build_icons.sh
artifacts:
paths:
- build/*.png
expire_in: 3 week
after_script:
- echo "End CI"
#!/bin/bash
#########################################
# Take a screenshot of given dimensions #
# #
# size: size of output picture #
# slen: side length for CSS var #
#########################################
function take_icon_screenshot(){
mkdir -p tmp
cp cube* tmp/
sed -i "s/^\t--side-length: [[:digit:]]*px/\t--side-length: ${slen}px/" tmp/cube.css
cd build/
firefox -headless -screenshot http://localhost:8000/tmp/cube.html --window-size=$size,$size
mv screenshot.png "icon-${size}.png"
cd ../
rm -rf tmp
}
python -m SimpleHTTPServer&
mkdir -p build
size=1024 slen=610 take_icon_screenshot
size=512 slen=300 take_icon_screenshot
size=256 slen=145 take_icon_screenshot
size=128 slen=68 take_icon_screenshot
size=96 slen=48 take_icon_screenshot
kill $(jobs -pr)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment