Compare commits
16 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e6f23d798c | ||
|
|
f6070572fa | ||
|
|
8e8647fdbd | ||
|
|
0acc97e09e | ||
|
|
ec6ab11c75 | ||
|
|
a649d9686e | ||
|
|
f4eee886e9 | ||
|
|
71122c46b6 | ||
|
|
9e1f29dfd9 | ||
|
|
d372cd9f09 | ||
|
|
c04f57309b | ||
|
|
dbb05df99f | ||
|
|
27ec180b79 | ||
|
|
1e0e997f17 | ||
|
|
23529c78d9 | ||
|
|
76da536bbd |
20 changed files with 316 additions and 207 deletions
|
|
@ -6,8 +6,8 @@ variables:
|
||||||
PACKER_VERSION: 1.4.3
|
PACKER_VERSION: 1.4.3
|
||||||
ANNOUNCE: http://labsync.lab.fablab-nea.de:6969/announce
|
ANNOUNCE: http://labsync.lab.fablab-nea.de:6969/announce
|
||||||
WEBSEED: http://labsync.lab.fablab-nea.de/labsync/$CI_COMMIT_REF_NAME/$CI_PIPELINE_ID/images
|
WEBSEED: http://labsync.lab.fablab-nea.de/labsync/$CI_COMMIT_REF_NAME/$CI_PIPELINE_ID/images
|
||||||
DOCKER_IMAGE_BUILDER: ${CI_REGISTRY_IMAGE}/labsync-builder:$CI_COMMIT_REF_SLUG
|
DOCKER_IMAGE_BUILDER: ${CI_REGISTRY_IMAGE}/labsync-builder:main
|
||||||
DOCKER_IMAGE_SECURITY_SCANNER: ${CI_REGISTRY_IMAGE}/security-scanner:$CI_COMMIT_REF_SLUG
|
DOCKER_IMAGE_SECURITY_SCANNER: ${CI_REGISTRY_IMAGE}/security-scanner:main
|
||||||
DOCKER_TLS_CERTDIR: ""
|
DOCKER_TLS_CERTDIR: ""
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
|
|
@ -21,17 +21,26 @@ dockerimage_builder:
|
||||||
- apk add --no-cache make
|
- apk add --no-cache make
|
||||||
services:
|
services:
|
||||||
- docker:dind
|
- docker:dind
|
||||||
|
variables:
|
||||||
|
DOCKER_IMAGE_BUILDER: ${CI_REGISTRY_IMAGE}/labsync-builder:$CI_COMMIT_REF_SLUG
|
||||||
script:
|
script:
|
||||||
- docker pull $DOCKER_IMAGE_BUILDER || true
|
- docker pull $DOCKER_IMAGE_BUILDER || true
|
||||||
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY
|
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
|
||||||
- make builderimg
|
- make builderimg
|
||||||
- docker push $DOCKER_IMAGE_BUILDER
|
- docker push $DOCKER_IMAGE_BUILDER
|
||||||
tags:
|
- echo "DOCKER_IMAGE_BUILDER=$DOCKER_IMAGE_BUILDER" >> build.env
|
||||||
- fablab
|
artifacts:
|
||||||
- ssd
|
reports:
|
||||||
except:
|
dotenv: build.env
|
||||||
refs:
|
rules:
|
||||||
- schedules
|
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
|
||||||
|
when: on_success
|
||||||
|
- if:
|
||||||
|
changes:
|
||||||
|
paths:
|
||||||
|
- builder/**/*
|
||||||
|
compare_to: main
|
||||||
|
when: on_success
|
||||||
|
|
||||||
dockerimage_security_scanner:
|
dockerimage_security_scanner:
|
||||||
stage: prepare
|
stage: prepare
|
||||||
|
|
@ -41,15 +50,22 @@ dockerimage_security_scanner:
|
||||||
- docker:dind
|
- docker:dind
|
||||||
script:
|
script:
|
||||||
- docker pull $DOCKER_IMAGE_SECURITY_SCANNER || true
|
- docker pull $DOCKER_IMAGE_SECURITY_SCANNER || true
|
||||||
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY
|
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
|
||||||
- make secscanimg
|
- make secscanimg
|
||||||
- docker push $DOCKER_IMAGE_SECURITY_SCANNER
|
- docker push $DOCKER_IMAGE_SECURITY_SCANNER
|
||||||
tags:
|
- echo "DOCKER_IMAGE_SECURITY_SCANNER=${CI_REGISTRY_IMAGE}/security-scanner:$CI_COMMIT_REF_SLUG" >> build.env
|
||||||
- fablab
|
artifacts:
|
||||||
- ssd
|
reports:
|
||||||
except:
|
dotenv: build.env
|
||||||
refs:
|
rules:
|
||||||
- schedules
|
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
|
||||||
|
when: on_success
|
||||||
|
- if:
|
||||||
|
changes:
|
||||||
|
paths:
|
||||||
|
- security-scanner/**/*
|
||||||
|
compare_to: main
|
||||||
|
when: on_success
|
||||||
|
|
||||||
security_scanner:
|
security_scanner:
|
||||||
stage: check
|
stage: check
|
||||||
|
|
@ -65,8 +81,17 @@ security_scanner:
|
||||||
variables:
|
variables:
|
||||||
- $task == "security-scanner"
|
- $task == "security-scanner"
|
||||||
- $target
|
- $target
|
||||||
tags:
|
|
||||||
- dedicated
|
lightburn-download:
|
||||||
|
stage: prepare
|
||||||
|
image: alpine
|
||||||
|
script:
|
||||||
|
- mkdir -p packer/ansible/roles/lightburn/files
|
||||||
|
- 'wget -O packer/ansible/roles/lightburn/files/lightburn.zip --header "JOB-TOKEN: $CI_JOB_TOKEN" "${CI_SERVER_URL}/api/v4/projects/fablab%2Flightburn-patched/jobs/artifacts/main/download?job=patch-Linux64"'
|
||||||
|
artifacts:
|
||||||
|
paths:
|
||||||
|
- packer/ansible/roles/lightburn/files/lightburn.zip
|
||||||
|
expire_in: 4 hours
|
||||||
|
|
||||||
.squashfs_template: &squashfs_template
|
.squashfs_template: &squashfs_template
|
||||||
image: $DOCKER_IMAGE_BUILDER
|
image: $DOCKER_IMAGE_BUILDER
|
||||||
|
|
@ -74,6 +99,8 @@ security_scanner:
|
||||||
services:
|
services:
|
||||||
- docker:dind
|
- docker:dind
|
||||||
script:
|
script:
|
||||||
|
- echo DOCKER_IMAGE_BUILDER=$DOCKER_IMAGE_BUILDER
|
||||||
|
- echo DOCKER_IMAGE_SECURITY_SCANNER=$DOCKER_IMAGE_SECURITY_SCANNER
|
||||||
- scripts/packer.sh debian-bookworm
|
- scripts/packer.sh debian-bookworm
|
||||||
- aws --endpoint-url "$AWS_ENDPOINT_URL" s3 cp images/ "s3://$AWS_BUCKET/$CI_COMMIT_REF_SLUG/$CI_JOB_ID/" --recursive --no-progress
|
- aws --endpoint-url "$AWS_ENDPOINT_URL" s3 cp images/ "s3://$AWS_BUCKET/$CI_COMMIT_REF_SLUG/$CI_JOB_ID/" --recursive --no-progress
|
||||||
artifacts:
|
artifacts:
|
||||||
|
|
@ -84,9 +111,6 @@ security_scanner:
|
||||||
- images/*.linux
|
- images/*.linux
|
||||||
#- images/*.squashfs
|
#- images/*.squashfs
|
||||||
- images/*.torrent
|
- images/*.torrent
|
||||||
tags:
|
|
||||||
- fablab
|
|
||||||
- ssd
|
|
||||||
|
|
||||||
squashfs_featurebranch:
|
squashfs_featurebranch:
|
||||||
<<: *squashfs_template
|
<<: *squashfs_template
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,8 @@
|
||||||
- role: firefox
|
- role: firefox
|
||||||
- role: windowmanager
|
- role: windowmanager
|
||||||
- role: inkscape
|
- role: inkscape
|
||||||
|
- role: lightburn
|
||||||
|
- role: prusa-slicer
|
||||||
- role: fablab
|
- role: fablab
|
||||||
- role: hardware
|
- role: hardware
|
||||||
- role: docker
|
- role: docker
|
||||||
|
|
@ -44,51 +46,6 @@
|
||||||
version: 3.3.1
|
version: 3.3.1
|
||||||
lightburn:
|
lightburn:
|
||||||
dockerimage: r.jalr.de/fablab/lightburn
|
dockerimage: r.jalr.de/fablab/lightburn
|
||||||
prusa_slicer:
|
|
||||||
settings: |
|
|
||||||
no_controller = 1
|
|
||||||
no_defaults = 1
|
|
||||||
preset_update = 0
|
|
||||||
show_splash_screen = 0
|
|
||||||
use_inches = 0
|
|
||||||
version_check = 0
|
|
||||||
view_mode = expert
|
|
||||||
|
|
||||||
[filaments]
|
|
||||||
AmazonBasics TPU @MINI = 1
|
|
||||||
Das Filament PLA = 1
|
|
||||||
Generic PETG = 1
|
|
||||||
Generic PETG @MINI = 1
|
|
||||||
Generic PETG @MMU2 = 1
|
|
||||||
Generic PLA = 1
|
|
||||||
Generic PLA @MMU2 = 1
|
|
||||||
Prusament ASA = 1
|
|
||||||
Prusament ASA @MINI = 1
|
|
||||||
Prusament ASA @MMU2 = 1
|
|
||||||
Prusament PC Blend = 1
|
|
||||||
Prusament PC Blend @MINI = 1
|
|
||||||
Prusament PC Blend @MMU2 = 1
|
|
||||||
Prusament PETG = 1
|
|
||||||
Prusament PETG @MINI = 1
|
|
||||||
Prusament PETG @MMU2 = 1
|
|
||||||
Prusament PLA = 1
|
|
||||||
Prusament PLA @MMU2 = 1
|
|
||||||
Prusament PVB = 1
|
|
||||||
Prusament PVB @MMU2 = 1
|
|
||||||
Verbatim BVOH = 1
|
|
||||||
Verbatim BVOH @MMU2 = 1
|
|
||||||
|
|
||||||
[presets]
|
|
||||||
filament = Prusament PLA
|
|
||||||
physical_printer =
|
|
||||||
print = 0.15mm QUALITY @MK3
|
|
||||||
printer = Original Prusa i3 MK3
|
|
||||||
sla_material =
|
|
||||||
sla_print =
|
|
||||||
|
|
||||||
[vendor:PrusaResearch]
|
|
||||||
model:MK3 = 0.4
|
|
||||||
model:MK3SMMU2S = 0.4
|
|
||||||
firefox:
|
firefox:
|
||||||
language_packs:
|
language_packs:
|
||||||
- de
|
- de
|
||||||
|
|
@ -109,3 +66,56 @@
|
||||||
Du hast Dich mit einem Gast-Account angemeldet. Alle Daten werden nach
|
Du hast Dich mit einem Gast-Account angemeldet. Alle Daten werden nach
|
||||||
der Anmeldung gelöscht. Wenn Du Deine Daten dauerhaft speichern
|
der Anmeldung gelöscht. Wenn Du Deine Daten dauerhaft speichern
|
||||||
möchtest, lege Dir bitte einen Account an!
|
möchtest, lege Dir bitte einen Account an!
|
||||||
|
lightburn:
|
||||||
|
devices:
|
||||||
|
- https://raw.githubusercontent.com/fablab-nea/LaserKutter/main/lightburn/LaserKutter.lbdev
|
||||||
|
prusa_slicer:
|
||||||
|
settings: |
|
||||||
|
no_controller = 1
|
||||||
|
no_defaults = 1
|
||||||
|
preset_update = 0
|
||||||
|
show_splash_screen = 0
|
||||||
|
use_inches = 0
|
||||||
|
version_check = 0
|
||||||
|
view_mode = expert
|
||||||
|
tls_accepted_cert_store_location = /etc/ssl/certs/ca-certificates.crt
|
||||||
|
tls_cert_store_accepted = yes
|
||||||
|
|
||||||
|
[filaments]
|
||||||
|
AmazonBasics TPU @MINI = 1
|
||||||
|
Das Filament PLA = 1
|
||||||
|
Generic PETG = 1
|
||||||
|
Generic PETG @MINI = 1
|
||||||
|
Generic PETG @MMU2 = 1
|
||||||
|
Generic PLA = 1
|
||||||
|
Generic PLA @MMU2 = 1
|
||||||
|
Prusament ASA = 1
|
||||||
|
Prusament ASA @MINI = 1
|
||||||
|
Prusament ASA @MMU2 = 1
|
||||||
|
Prusament PC Blend = 1
|
||||||
|
Prusament PC Blend @MINI = 1
|
||||||
|
Prusament PC Blend @MMU2 = 1
|
||||||
|
Prusament PETG = 1
|
||||||
|
Prusament PETG @MINI = 1
|
||||||
|
Prusament PETG @MMU2 = 1
|
||||||
|
Prusament PLA = 1
|
||||||
|
Prusament PLA @MMU2 = 1
|
||||||
|
Prusament PVB = 1
|
||||||
|
Prusament PVB @MMU2 = 1
|
||||||
|
Verbatim BVOH = 1
|
||||||
|
Verbatim BVOH @MMU2 = 1
|
||||||
|
|
||||||
|
[presets]
|
||||||
|
filament = Prusament PLA
|
||||||
|
physical_printer =
|
||||||
|
print = 0.15mm QUALITY @MK3
|
||||||
|
printer = Original Prusa i3 MK3
|
||||||
|
sla_material =
|
||||||
|
sla_print =
|
||||||
|
|
||||||
|
[vendor:PrusaResearch]
|
||||||
|
model:MK3 = 0.4
|
||||||
|
model:MK3SMMU2S = 0.4
|
||||||
|
|
||||||
|
[vendor:Ultimaker]
|
||||||
|
model:ULTIMAKER2 = 0.4
|
||||||
|
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
[Desktop Entry]
|
|
||||||
Name=LightBurn
|
|
||||||
GenericName=LightBurn
|
|
||||||
Comment=Laser Cutter Job Control Application
|
|
||||||
Exec=x-terminal-emulator -e 'sudo /usr/local/bin/lightburn'
|
|
||||||
Icon=/usr/local/share/lightburn/lightburn.png
|
|
||||||
Terminal=false
|
|
||||||
Type=Application
|
|
||||||
Categories=Graphics
|
|
||||||
|
|
@ -1,34 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
. /etc/default/lightburn
|
|
||||||
|
|
||||||
if [ ! -z "$SUDO_COMMAND" ] && [ "$SUDO_COMMAND" = "$0" ]; then
|
|
||||||
home="$(getent passwd "$SUDO_UID" | cut -d: -f6)"
|
|
||||||
export PUID="$SUDO_UID"
|
|
||||||
export PGID="$SUDO_GID"
|
|
||||||
else
|
|
||||||
home="$HOME"
|
|
||||||
export PUID=$(id -u)
|
|
||||||
export PGID=$(id -g)
|
|
||||||
fi
|
|
||||||
|
|
||||||
config_dir="$home/.config/lightburn"
|
|
||||||
|
|
||||||
mkdir -p "$config_dir"
|
|
||||||
|
|
||||||
media="/media/$(id -un $PUID)"
|
|
||||||
if [ -e "$media" ]; then
|
|
||||||
media_volume="-v $media:/media"
|
|
||||||
fi
|
|
||||||
|
|
||||||
docker run \
|
|
||||||
--rm \
|
|
||||||
-e PUID \
|
|
||||||
-e PGID \
|
|
||||||
-e DISPLAY \
|
|
||||||
-v /tmp/.X11-unix/:/tmp/.X11-unix/ \
|
|
||||||
-v $config_dir:/config/ \
|
|
||||||
-v $home:/workdir/ \
|
|
||||||
$media_volume \
|
|
||||||
--network=none \
|
|
||||||
"$LIGHTBURN_DOCKER_IMAGE"
|
|
||||||
|
|
@ -1,66 +0,0 @@
|
||||||
---
|
|
||||||
- file:
|
|
||||||
path: /usr/local/share/lightburn
|
|
||||||
state: directory
|
|
||||||
mode: "0755"
|
|
||||||
owner: root
|
|
||||||
group: root
|
|
||||||
|
|
||||||
- name: copy icon
|
|
||||||
copy:
|
|
||||||
src: lightburn/lightburn.png
|
|
||||||
dest: /usr/local/share/lightburn/lightburn.png
|
|
||||||
owner: root
|
|
||||||
group: root
|
|
||||||
mode: "0644"
|
|
||||||
|
|
||||||
- name: copy script
|
|
||||||
copy:
|
|
||||||
src: lightburn/lightburn.sh
|
|
||||||
dest: /usr/local/bin/lightburn
|
|
||||||
owner: root
|
|
||||||
group: root
|
|
||||||
mode: "0755"
|
|
||||||
|
|
||||||
- name: add lightburn configuration
|
|
||||||
template:
|
|
||||||
src: lightburn/lightburn.j2
|
|
||||||
dest: /etc/default/lightburn
|
|
||||||
owner: root
|
|
||||||
group: root
|
|
||||||
mode: "0644"
|
|
||||||
|
|
||||||
- name: add lightburn to applications menu
|
|
||||||
copy:
|
|
||||||
src: lightburn/lightburn.desktop
|
|
||||||
dest: /usr/share/applications/lightburn.desktop
|
|
||||||
owner: root
|
|
||||||
group: root
|
|
||||||
mode: "0644"
|
|
||||||
|
|
||||||
- name: add group
|
|
||||||
group:
|
|
||||||
name: lightburn
|
|
||||||
system: yes
|
|
||||||
|
|
||||||
- name: add sudoers config
|
|
||||||
copy:
|
|
||||||
content: "%lightburn ALL=/usr/local/bin/lightburn, NOPASSWD:/usr/local/bin/lightburn\n"
|
|
||||||
dest: /etc/sudoers.d/lightburn
|
|
||||||
owner: root
|
|
||||||
group: root
|
|
||||||
mode: "0644"
|
|
||||||
|
|
||||||
- name: ensure guest-account settings directory exists
|
|
||||||
file:
|
|
||||||
path: /etc/guest-account
|
|
||||||
state: directory
|
|
||||||
mode: "0755"
|
|
||||||
owner: root
|
|
||||||
group: root
|
|
||||||
|
|
||||||
- name: add lightburn group to guest account
|
|
||||||
lineinfile:
|
|
||||||
path: /etc/guest-account/groups
|
|
||||||
line: lightburn
|
|
||||||
create: yes
|
|
||||||
|
|
@ -18,12 +18,6 @@
|
||||||
- import_tasks: visicut.yml
|
- import_tasks: visicut.yml
|
||||||
tags:
|
tags:
|
||||||
- fablab:visicut
|
- fablab:visicut
|
||||||
- import_tasks: lightburn.yml
|
|
||||||
tags:
|
|
||||||
- fablab:lightburn
|
|
||||||
- import_tasks: prusa.yml
|
|
||||||
tags:
|
|
||||||
- fablab:prusa
|
|
||||||
# - import_tasks: platformio.yml
|
# - import_tasks: platformio.yml
|
||||||
# tags:
|
# tags:
|
||||||
# - fablab:platformio
|
# - fablab:platformio
|
||||||
|
|
|
||||||
|
|
@ -1,25 +0,0 @@
|
||||||
---
|
|
||||||
- name: install slic3r-prusa
|
|
||||||
apt:
|
|
||||||
name: slic3r-prusa
|
|
||||||
state: present
|
|
||||||
|
|
||||||
- name: create skel directories
|
|
||||||
file:
|
|
||||||
path: "/etc/skel/{{ item }}"
|
|
||||||
state: directory
|
|
||||||
loop:
|
|
||||||
- .config
|
|
||||||
- .config/PrusaSlicer
|
|
||||||
- .config/PrusaSlicer/vendor
|
|
||||||
|
|
||||||
- name: create symlink to vendor profiles
|
|
||||||
file:
|
|
||||||
src: /usr/share/PrusaSlicer/profiles/PrusaResearch.ini
|
|
||||||
dest: /etc/skel/.config/PrusaSlicer/vendor/PrusaResearch.ini
|
|
||||||
state: link
|
|
||||||
|
|
||||||
- name: Copy Prusa slicer settings
|
|
||||||
copy:
|
|
||||||
content: "{{ fablab.prusa_slicer.settings }}"
|
|
||||||
dest: /etc/skel/.config/PrusaSlicer/PrusaSlicer.ini
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
LIGHTBURN_DOCKER_IMAGE='{{ fablab.lightburn.dockerimage }}'
|
|
||||||
1
packer/ansible/roles/lightburn/.gitignore
vendored
Normal file
1
packer/ansible/roles/lightburn/.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
*.zip
|
||||||
6
packer/ansible/roles/lightburn/files/lightburn.desktop
Normal file
6
packer/ansible/roles/lightburn/files/lightburn.desktop
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
[Desktop Entry]
|
||||||
|
Name=LightBurn
|
||||||
|
Exec=/opt/LightBurn/LightBurn
|
||||||
|
Icon=/opt/LightBurn/LightBurn.png
|
||||||
|
Type=Application
|
||||||
|
Categories=Graphics;VectorGraphics;Engineering;
|
||||||
34
packer/ansible/roles/lightburn/tasks/devices.yml
Normal file
34
packer/ansible/roles/lightburn/tasks/devices.yml
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
- name: Download devices files
|
||||||
|
uri:
|
||||||
|
url: "{{ device_url }}"
|
||||||
|
return_content: true
|
||||||
|
loop: "{{ lightburn.devices }}"
|
||||||
|
loop_control:
|
||||||
|
loop_var: device_url
|
||||||
|
register: lightburn_downloaded_devices
|
||||||
|
|
||||||
|
- name: Create lightburn settings
|
||||||
|
set_fact:
|
||||||
|
lightburn_devices: "{{ lightburn_devices | default([]) + [device_settings] }}"
|
||||||
|
vars:
|
||||||
|
device_settings: "{{ (device.content | from_json)['DeviceList'][0] }}"
|
||||||
|
loop: "{{ lightburn_downloaded_devices.results }}"
|
||||||
|
loop_control:
|
||||||
|
loop_var: device
|
||||||
|
label: "{{ device_settings.DisplayName }}"
|
||||||
|
|
||||||
|
- name: Create settings directory
|
||||||
|
file:
|
||||||
|
path: "{{ item }}"
|
||||||
|
state: directory
|
||||||
|
loop:
|
||||||
|
- /etc/skel/.config
|
||||||
|
- /etc/skel/.config/LightBurn
|
||||||
|
|
||||||
|
- name: Create settings file
|
||||||
|
copy:
|
||||||
|
dest: /etc/skel/.config/LightBurn/prefs.ini
|
||||||
|
content: "{{ lightburn_settings | to_nice_json() }}"
|
||||||
|
vars:
|
||||||
|
lightburn_settings:
|
||||||
|
DeviceList: "{{ lightburn_devices }}"
|
||||||
13
packer/ansible/roles/lightburn/tasks/install.yml
Normal file
13
packer/ansible/roles/lightburn/tasks/install.yml
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
---
|
||||||
|
- name: Extract zip file
|
||||||
|
unarchive:
|
||||||
|
src: lightburn.zip
|
||||||
|
dest: /opt
|
||||||
|
- name: Create applications directory
|
||||||
|
file:
|
||||||
|
path: /usr/local/share/applications/
|
||||||
|
state: directory
|
||||||
|
- name: Copy desktop file
|
||||||
|
copy:
|
||||||
|
src: lightburn.desktop
|
||||||
|
dest: /usr/local/share/applications/lightburn.desktop
|
||||||
10
packer/ansible/roles/lightburn/tasks/main.yml
Normal file
10
packer/ansible/roles/lightburn/tasks/main.yml
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
---
|
||||||
|
- block:
|
||||||
|
- import_tasks: install.yml
|
||||||
|
tags:
|
||||||
|
- lightburn:install
|
||||||
|
- import_tasks: devices.yml
|
||||||
|
tags:
|
||||||
|
- lightburn:devices
|
||||||
|
tags:
|
||||||
|
- lightburn
|
||||||
2
packer/ansible/roles/prusa-slicer/defaults/main.yml
Normal file
2
packer/ansible/roles/prusa-slicer/defaults/main.yml
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
---
|
||||||
|
prusa_slicer_use_package: false
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
[Desktop Entry]
|
||||||
|
Name=Prusa GCode viewer
|
||||||
|
Exec=/opt/PrusaSlicer/bin/prusa-slicer --gcodeviewer %F
|
||||||
|
Icon=/opt/PrusaSlicer/resources/icons/PrusaSlicer-gcodeviewer.svg
|
||||||
|
Terminal=false
|
||||||
|
Type=Application
|
||||||
|
MimeType=text/x.gcode;
|
||||||
|
Categories=Graphics;3DGraphics;
|
||||||
|
Keywords=3D;Printing;Slicer;
|
||||||
12
packer/ansible/roles/prusa-slicer/files/PrusaSlicer.desktop
Normal file
12
packer/ansible/roles/prusa-slicer/files/PrusaSlicer.desktop
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
[Desktop Entry]
|
||||||
|
Name=PrusaSlicer
|
||||||
|
GenericName=3D Printing Software
|
||||||
|
Terminal=false
|
||||||
|
Exec=/opt/PrusaSlicer/bin/prusa-slicer %F
|
||||||
|
Icon=/opt/PrusaSlicer/resources/icons/PrusaSlicer.png
|
||||||
|
Type=Application
|
||||||
|
MimeType=model/stl;application/vnd.ms-3mfdocument;application/prs.wavefront-obj;application/x-amf;
|
||||||
|
Categories=Graphics;3DGraphics;Engineering;
|
||||||
|
Keywords=3D;Printing;Slicer;slice;3D;printer;convert;gcode;stl;obj;amf;SLA
|
||||||
|
StartupNotify=false
|
||||||
|
StartupWMClass=prusa-slicer
|
||||||
46
packer/ansible/roles/prusa-slicer/tasks/configure.yml
Normal file
46
packer/ansible/roles/prusa-slicer/tasks/configure.yml
Normal file
|
|
@ -0,0 +1,46 @@
|
||||||
|
---
|
||||||
|
- set_fact:
|
||||||
|
prusa_slicer_profiles_directory: /usr/share/PrusaSlicer/profiles
|
||||||
|
when: prusa_slicer_use_package | bool
|
||||||
|
|
||||||
|
- set_fact:
|
||||||
|
prusa_slicer_profiles_directory: /opt/PrusaSlicer/resources/profiles
|
||||||
|
when: not prusa_slicer_use_package | bool
|
||||||
|
|
||||||
|
- name: create skel directories
|
||||||
|
file:
|
||||||
|
path: "/etc/skel/{{ item }}"
|
||||||
|
state: directory
|
||||||
|
loop:
|
||||||
|
- .config
|
||||||
|
- .config/PrusaSlicer
|
||||||
|
- .config/PrusaSlicer/vendor
|
||||||
|
|
||||||
|
- name: create symlink to vendor profiles
|
||||||
|
file:
|
||||||
|
src: "{{ prusa_slicer_profiles_directory }}/{{ item }}.ini"
|
||||||
|
dest: /etc/skel/.config/PrusaSlicer/vendor/{{ item }}.ini
|
||||||
|
state: link
|
||||||
|
loop:
|
||||||
|
- PrusaResearch
|
||||||
|
- Ultimaker
|
||||||
|
|
||||||
|
- name: Stat /opt/PrusaSlicer
|
||||||
|
stat:
|
||||||
|
path: /opt/PrusaSlicer
|
||||||
|
register: prusa_slicer_stat
|
||||||
|
|
||||||
|
- name: Set version
|
||||||
|
set_fact:
|
||||||
|
prusa_slicer_version: "{{ prusa_slicer_stat.stat.lnk_target | regex_replace('^/opt/PrusaSlicer-(.*)-[0-9]{12}$', '\\1') }}"
|
||||||
|
when: prusa_slicer_stat.stat.exists and prusa_slicer_stat.stat.islnk
|
||||||
|
|
||||||
|
- debug:
|
||||||
|
var: prusa_slicer_version
|
||||||
|
|
||||||
|
- name: Copy Prusa slicer settings
|
||||||
|
copy:
|
||||||
|
content: |
|
||||||
|
version_system_info_sent = {{ prusa_slicer_version | default('') }}
|
||||||
|
{{ prusa_slicer.settings }}
|
||||||
|
dest: /etc/skel/.config/PrusaSlicer/PrusaSlicer.ini
|
||||||
|
|
@ -0,0 +1,60 @@
|
||||||
|
---
|
||||||
|
- name: Get latest release
|
||||||
|
uri:
|
||||||
|
url: https://api.github.com/repos/prusa3d/PrusaSlicer/releases/latest
|
||||||
|
return_content: true
|
||||||
|
register: prusa_slicer_release
|
||||||
|
|
||||||
|
- name: Create tarball tempfile
|
||||||
|
tempfile:
|
||||||
|
state: file
|
||||||
|
suffix: .tar.gz
|
||||||
|
register: prusa_slicer_tarball
|
||||||
|
|
||||||
|
- name: Select asset
|
||||||
|
set_fact:
|
||||||
|
prusa_slicer_asset: "{{ asset }}"
|
||||||
|
when: "asset.name | regex_search('PrusaSlicer-.*linux-x64-GTK3.*\\.tar\\.bz2$')"
|
||||||
|
loop: "{{ prusa_slicer_release.json.assets }}"
|
||||||
|
loop_control:
|
||||||
|
loop_var: asset
|
||||||
|
label: "{{ asset.name }}"
|
||||||
|
|
||||||
|
- name: Download release file
|
||||||
|
get_url:
|
||||||
|
url: "{{ prusa_slicer_asset.browser_download_url }}"
|
||||||
|
dest: "{{ prusa_slicer_tarball.path }}"
|
||||||
|
force: true
|
||||||
|
|
||||||
|
- name: Extract tarball
|
||||||
|
unarchive:
|
||||||
|
src: "{{ prusa_slicer_tarball.path }}"
|
||||||
|
dest: /opt
|
||||||
|
remote_src: true
|
||||||
|
|
||||||
|
- name: Remove tarball
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: "{{ prusa_slicer_tarball.path }}"
|
||||||
|
state: absent
|
||||||
|
when: prusa_slicer_tarball.path is defined
|
||||||
|
|
||||||
|
- name: Create symlink
|
||||||
|
file:
|
||||||
|
src: "/opt/{{ prusa_slicer_directory }}"
|
||||||
|
dest: "/opt/PrusaSlicer"
|
||||||
|
state: link
|
||||||
|
vars:
|
||||||
|
prusa_slicer_directory: "{{ prusa_slicer_asset.name | regex_replace('\\.tar\\.bz2$', '') }}"
|
||||||
|
|
||||||
|
- name: Create applications directory
|
||||||
|
file:
|
||||||
|
path: /usr/local/share/applications/
|
||||||
|
state: directory
|
||||||
|
|
||||||
|
- name: Copy desktop files
|
||||||
|
copy:
|
||||||
|
src: "{{ item }}.desktop"
|
||||||
|
dest: /usr/local/share/applications/{{ item }}.desktop
|
||||||
|
loop:
|
||||||
|
- PrusaSlicer
|
||||||
|
- PrusaGcodeviewer
|
||||||
18
packer/ansible/roles/prusa-slicer/tasks/main.yml
Normal file
18
packer/ansible/roles/prusa-slicer/tasks/main.yml
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
---
|
||||||
|
- block:
|
||||||
|
- import_tasks: package.yml
|
||||||
|
when: prusa_slicer_use_package | bool
|
||||||
|
tags:
|
||||||
|
- prusa-slicer:install
|
||||||
|
|
||||||
|
- import_tasks: install_from_github.yml
|
||||||
|
when: not prusa_slicer_use_package | bool
|
||||||
|
tags:
|
||||||
|
- prusa-slicer:install
|
||||||
|
|
||||||
|
- import_tasks: configure.yml
|
||||||
|
tags:
|
||||||
|
- prusa-slicer:configure
|
||||||
|
|
||||||
|
tags:
|
||||||
|
- prusa-slicer
|
||||||
5
packer/ansible/roles/prusa-slicer/tasks/package.yml
Normal file
5
packer/ansible/roles/prusa-slicer/tasks/package.yml
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
- name: install slic3r-prusa
|
||||||
|
apt:
|
||||||
|
name: slic3r-prusa
|
||||||
|
state: present
|
||||||
Loading…
Add table
Add a link
Reference in a new issue