export: image: obra/kicad-tools:latest stage: build artifacts: paths: - _out/* expire_in: 1 week before_script: # change the distribution from ubuntu disco to focal (LTS) - sed -i s/disco/focal/g /etc/apt/sources.list - head -n -1 /etc/apt/sources.list > /tmp/sources.list - mv /tmp/sources.list /etc/apt/sources.list - apt-get update -y && apt-get install openssh-client wget -y - chmod 700 "$SSH_PRIVATE_KEY" - wget -O /tmp/svgcleaner.tar.gz https://github.com/RazrFalcon/svgcleaner-gui/releases/download/v0.9.5/svgcleaner_linux_x86_64_0.9.5.tar.gz - cd /tmp && tar xzf svgcleaner.tar.gz - python3 -m pip install pyquery==1.2.11 script: - mkdir /tmp/build/ - cd $CI_PROJECT_DIR/93646A - mkdir /tmp/build/93646A - python -m kicad-automation.eeschema.schematic --schematic 93646A.sch --output_dir /tmp/build export -f pdf -a || true - python -m kicad-automation.eeschema.schematic --schematic 93646A.sch --output_dir /tmp/build/93646A export -f svg -a || true - cd $CI_PROJECT_DIR/93646B - mkdir /tmp/build/93646B - python -m kicad-automation.eeschema.schematic --schematic 93646B.sch --output_dir /tmp/build export -f pdf -a || true - python -m kicad-automation.eeschema.schematic --schematic 93646B.sch --output_dir /tmp/build/93646B export -f svg -a || true - cd $CI_PROJECT_DIR/93646E - mkdir /tmp/build/93646E - python -m kicad-automation.eeschema.schematic --schematic 93646E.sch --output_dir /tmp/build export -f pdf -a || true - python -m kicad-automation.eeschema.schematic --schematic 93646E.sch --output_dir /tmp/build/93646E export -f svg -a || true - cd $CI_PROJECT_DIR/CPB-001A - mkdir /tmp/build/CPB-001A - python -m kicad-automation.eeschema.schematic --schematic CPB-001A.sch --output_dir /tmp/build export -f pdf -a || true - python -m kicad-automation.eeschema.schematic --schematic CPB-001A.sch --output_dir /tmp/build/CPB-001A export -f svg -a || true - cd $CI_PROJECT_DIR/DLs/DL-1827 - mkdir /tmp/build/DL-1827 - python -m kicad-automation.eeschema.schematic --schematic DL-1827.sch --output_dir /tmp/build export -f pdf -a || true - python -m kicad-automation.eeschema.schematic --schematic DL-1827.sch --output_dir /tmp/build/DL-1827 export -f svg -a || true - cd $CI_PROJECT_DIR/DLs/DL-1727 - mkdir /tmp/build/DL-1727 - python -m kicad-automation.eeschema.schematic --schematic DL-1727.sch --output_dir /tmp/build export -f pdf -a || true - python -m kicad-automation.eeschema.schematic --schematic DL-1727.sch --output_dir /tmp/build/DL-1727 export -f svg -a || true - cd $CI_PROJECT_DIR/DLs/DL-1927 - mkdir /tmp/build/DL-1927 - python -m kicad-automation.eeschema.schematic --schematic DL-1927.sch --output_dir /tmp/build export -f pdf -a || true - python -m kicad-automation.eeschema.schematic --schematic DL-1927.sch --output_dir /tmp/build/DL-1927 export -f svg -a || true - cd $CI_PROJECT_DIR/DLs/DL-2027 - mkdir /tmp/build/DL-2027 - python -m kicad-automation.eeschema.schematic --schematic DL-2027.sch --output_dir /tmp/build export -f pdf -a || true - python -m kicad-automation.eeschema.schematic --schematic DL-2027.sch --output_dir /tmp/build/DL-2027 export -f svg -a || true - cd $CI_PROJECT_DIR/DLs/DL-0311/DL-0311 - mkdir /tmp/build/DL-0311 - python -m kicad-automation.eeschema.schematic --schematic DL-0311.sch --output_dir /tmp/build export -f pdf -a || true - python -m kicad-automation.eeschema.schematic --schematic DL-0311.sch --output_dir /tmp/build/DL-0311 export -f svg -a || true - cd $CI_PROJECT_DIR/DLs/DL-0921/DL-0921 - mkdir /tmp/build/DL-0921 - python -m kicad-automation.eeschema.schematic --schematic DL-0921.sch --output_dir /tmp/build export -f pdf -a || true - python -m kicad-automation.eeschema.schematic --schematic DL-0921.sch --output_dir /tmp/build/DL-0921 export -f svg -a || true - cd $CI_PROJECT_DIR - for i in `find /tmp/build/ -maxdepth 1 -type d | grep -v '/$'`; do cp DLs/tools/svg-viewer.html ${i}/index.html; done - sed -i 's/fill="none;"/fill="none"/g' /tmp/build/*/*.svg - for i in `ls /tmp/build/*/*.svg`; do /tmp/svgcleaner $i $i.comp.svg; python3 DLs/tools/svg-transform.py $i.comp.svg $i DLs/tools/fonts/newstroke-light.woff2; rm $i.comp.svg; done - cp -r DLs/tools/fonts /tmp/build/ - mkdir -p _out && cp -r /tmp/build/* _out/ - BRANCH=`echo -n $CI_COMMIT_REF_NAME | sed 's/^master$//g' | sed 's!^\(.*\)$!.\1/!g'` - scp -r -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i "$SSH_PRIVATE_KEY" /tmp/build/* $SSH_TARGET$BRANCH