first jenkins run
This commit is contained in:
@ -1,11 +0,0 @@
|
||||
services:
|
||||
|
||||
photo_refresh:
|
||||
container_name: photo_refresh
|
||||
image: php:8.0-apache
|
||||
ports:
|
||||
- 8080:80
|
||||
volumes:
|
||||
- /opt/docker/photo_refresh/:/var/www/html/
|
||||
network_mode: bridge
|
||||
restart: always
|
||||
@ -1,17 +0,0 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Dynamic Image Update</title>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<img id="refreshedImage" src="getImage.php" width="400" alt="Refreshed Image">
|
||||
<script>
|
||||
// Function to update the image every other second using AJAX
|
||||
setInterval(function() {
|
||||
$('#refreshedImage').attr('src', 'getImage.php?_=' + new Date().getTime()); // Adding timestamp to avoid caching
|
||||
}, 2000);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@ -1,22 +0,0 @@
|
||||
<?php
|
||||
header("Cache-Control: no-cache, must-revalidate");
|
||||
// Path to the directory where the images are stored
|
||||
$imageDirectory = 'capture/';
|
||||
// Get the list of image files in the directory
|
||||
$imageFiles = glob($imageDirectory . '*.{jpg,jpeg,png,gif}', GLOB_BRACE);
|
||||
// If there are no image files, return a default image
|
||||
if (empty($imageFiles)) {
|
||||
$defaultImage = 'default.jpg'; // Provide path to your default image
|
||||
header('Content-Type: image/jpeg'); // Adjust content type if default image type is different
|
||||
readfile($defaultImage);
|
||||
exit;
|
||||
}
|
||||
// Sort the image files by modification time, latest first
|
||||
array_multisort(array_map('filemtime', $imageFiles), SORT_DESC, $imageFiles);
|
||||
// Get the path to the latest image file
|
||||
$latestImage = $imageFiles[0];
|
||||
// Set header type
|
||||
header('Content-Type: image/jpeg');
|
||||
// Get the image
|
||||
readfile($latestImage);
|
||||
?>
|
||||
@ -11,9 +11,6 @@
|
||||
### Top Cam Feed Kiosk
|
||||
### Bottom Service Control Panel
|
||||
|
||||
# select display_name, city, state, postcode from addresses order by id desc limit 1;
|
||||
# curl -s http://10.18.1.1:8184/wheres_gali?api_key=
|
||||
|
||||
- name: Carputer Early Tasks
|
||||
include_tasks:
|
||||
- ustreamer.yaml
|
||||
|
||||
@ -4,11 +4,13 @@
|
||||
set_fact:
|
||||
- docker_source: "/opt/cosmos/photo_refresh"
|
||||
|
||||
- name: photo_refresh - create docker folder
|
||||
|
||||
# Create docker Folder
|
||||
- name: lldp - python - create api folder
|
||||
file:
|
||||
path: "{{ docker_source }}"
|
||||
state: directory
|
||||
mode: '0755'
|
||||
mode: '0755'
|
||||
|
||||
- name: photo_refresh - copy files for docker container
|
||||
copy:
|
||||
@ -21,7 +23,7 @@
|
||||
name: photo_refresh # Name of the Docker image
|
||||
source: build
|
||||
build:
|
||||
path: /opt/cosmos/photo_refresh # Path to the directory containing your Dockerfile
|
||||
path: "{{ docker_source }}" # Path to the directory containing your Dockerfile
|
||||
state: present
|
||||
tag: latest
|
||||
|
||||
@ -39,7 +41,7 @@
|
||||
dest: "{{ docker_source }}docker-compose.yaml"
|
||||
mode: 0644
|
||||
|
||||
- name: photo_refresh - Start container at 0.0.0.0:8080
|
||||
- name: photo_refresh - Start container at 0.0.0.0:3000
|
||||
shell: "docker-compose -f {{ docker_source }}/docker-compose.yaml up -d"
|
||||
register: local_index_output
|
||||
- debug: |
|
||||
|
||||
@ -1,5 +1,12 @@
|
||||
---
|
||||
|
||||
# Create working Folder
|
||||
- name: lldp - python - create api folder
|
||||
file:
|
||||
path: "{{ working_folder }}"
|
||||
state: directory
|
||||
mode: '0755'
|
||||
|
||||
- name: set template vars
|
||||
set_fact:
|
||||
# timelapse related scripts
|
||||
@ -23,9 +30,9 @@
|
||||
src: "{{ item.src }}"
|
||||
dest: "{{ item.dest }}"
|
||||
loop: "{{ timelapse_script_templates }}"
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
owner: timelapse
|
||||
group: timelapse
|
||||
mode: 0755
|
||||
|
||||
- name: template service file
|
||||
template:
|
||||
@ -41,6 +48,6 @@
|
||||
daemon_reload: yes
|
||||
state: started
|
||||
enabled: yes
|
||||
name: ustreamer
|
||||
name: timelapse
|
||||
|
||||
...
|
||||
@ -1,6 +1,10 @@
|
||||
#!/bin/bash
|
||||
# create timelapse
|
||||
|
||||
# end the loop
|
||||
rm $WORKING_DIR/run
|
||||
sleep 5
|
||||
|
||||
# create timelapse
|
||||
ffmpeg -r 30 -pattern_type glob -i "$WORKING_DIR/*.jpg" \
|
||||
-vf "scale=1920x1080" -vcodec libx264 /$WORKING_DIR/00-timelapse.mp4
|
||||
|
||||
|
||||
@ -1,4 +1,11 @@
|
||||
#!/bin/bash
|
||||
# no need to do this math forever
|
||||
input_width=1920
|
||||
input_height=1080
|
||||
output_width=1340
|
||||
output_height=580
|
||||
# Calculate the ratio for trimming the top part
|
||||
trim_ratio=$(echo "scale=4; $output_height / $output_width * $input_width" | bc)
|
||||
|
||||
# this saves a snapshot of the camera every second or so depending on how long all the other crap takes
|
||||
# let's hope the vars make it otherwise imma need to parse a bollocksing file
|
||||
@ -26,12 +33,6 @@ do
|
||||
# I have 1340x580. i think i will truncate the top
|
||||
# Calculate the height to trim based on the aspect ratios of the input and output images
|
||||
if (( $i % 5 == 0 )); then
|
||||
input_width=1920
|
||||
input_height=1080
|
||||
output_width=1340
|
||||
output_height=580
|
||||
# Calculate the ratio for trimming the top part
|
||||
trim_ratio=$(echo "scale=4; $output_height / $output_width * $input_width" | bc)
|
||||
NOW=$(date +%Y%m%d%H%M%S)
|
||||
convert $WORKING_DIR/$FILENAME.jpg -gravity North -crop x$trim_ratio +repage -resize 1340x580 {{ working_folder }}/small_thumbs/$NOW.jpg
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user