Compare commits

..

18 commits

Author SHA1 Message Date
1d35c57680
Add pdo_sqlsrv
Some checks failed
Test build / build (push) Successful in 33m55s
Release into production / build (release) Has been cancelled
2025-01-20 18:20:02 +01:00
00f7530bb5
Fix docker registry
Some checks failed
Test build / build (push) Failing after 15s
2025-01-20 15:33:48 +01:00
0e9bcaf531
No python in pipeline
Some checks failed
Test build / build (push) Failing after 29s
2025-01-20 14:13:53 +01:00
3bd1605272
Python version
Some checks failed
Test build / build (push) Has been cancelled
2025-01-20 14:12:05 +01:00
30674f7e51
Fix python version
Some checks failed
Test build / build (push) Failing after 5s
2025-01-20 14:11:22 +01:00
cff0c70f0d
Fix workflow_dispatch input
Some checks failed
Test build / build (push) Has been cancelled
2025-01-20 14:10:30 +01:00
d128f30e78
Fix release pipeline
Some checks failed
Test build / build (push) Has been cancelled
2025-01-20 14:10:05 +01:00
54be74db63
Fix test pipeline
Some checks failed
Test build / build (push) Has been cancelled
2025-01-20 14:09:33 +01:00
9b772ff87b
Switch to plain progress
Some checks failed
Test build / build (push) Failing after 9m42s
2025-01-20 00:20:54 +01:00
f85560426b
Fixed of the testing process, drop parallel building of Python
Some checks failed
Test build / build (push) Has been cancelled
2025-01-20 00:07:09 +01:00
c6d7126d2a
Better test workflow 2025-01-19 23:01:59 +01:00
ef43ec73ad
Fix rosti.sh generator
Some checks failed
Test build / build (push) Failing after 26m25s
2025-01-19 22:55:11 +01:00
0db0f874fa
Fix deno
Some checks failed
Test build / build (push) Failing after 29m8s
2025-01-19 20:36:10 +01:00
6c7c6f80fb
Test fix, parallel procesing of Node.js builds
Some checks failed
Test build / build (push) Failing after 24m43s
2025-01-19 16:00:07 +01:00
d462f6c091
Final workflow, fix test workflow
Some checks failed
Test build / build (push) Failing after 36m19s
2025-01-19 14:41:22 +01:00
6af035476b
First try for 2024.12-1, new versions of everything, fix ruby bug
Some checks are pending
Test build / build (push) Waiting to run
2025-01-19 14:30:03 +01:00
4de583b57e
Fix PHP
All checks were successful
Test build / build (push) Successful in 41m35s
2024-11-23 16:35:10 +01:00
c740329c99
Initial commit of 2024.12-1
Some checks failed
Test build / build (push) Has been cancelled
2024-11-23 16:26:03 +01:00
10 changed files with 122 additions and 55 deletions

31
.github/workflows/release.yml vendored Normal file
View file

@ -0,0 +1,31 @@
name: Release into production
on:
release:
types: [published]
workflow_dispatch:
inputs:
version:
description: 'Version to release'
required: true
default: 'latest'
type: string
jobs:
build:
runs-on: [dev, amd64]
steps:
- uses: actions/checkout@v4
- name: Get git tag
id: get_tag
if: github.event_name == 'release'
run: echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- name: Set version from input
if: github.event_name == 'workflow_dispatch'
run: echo "TAG_NAME=${{ github.event.inputs.version }}" >> $GITHUB_ENV
- name: Registry login
run: echo -n "${{ secrets.HARBOR_REPO_PASSWORD }}" | docker login harbor.rosti.cz -u "${{ secrets.HARBOR_REPO_USERNAME }}" --password-stdin
- name: Final build
run: task squashed REPO=harbor.rosti.cz/rosti/runtime VERSION=${{ env.TAG_NAME }}
- name: Push
run: task push REPO=harbor.rosti.cz/rosti/runtime VERSION=${{ env.TAG_NAME }}

View file

@ -6,14 +6,20 @@ on:
jobs: jobs:
build: build:
runs-on: [moon, amd64] runs-on: [dev, amd64]
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Test build - name: docker login
run: | run: |
# echo "${{ secrets.repo_password }}" | podman login -u $USERNAME --password-stdin $REPO
docker login gitea.ceperka.net -u "${{ secrets.REPO_USERNAME }}" -p "${{ secrets.REPO_PASSWORD }}" docker login gitea.ceperka.net -u "${{ secrets.REPO_USERNAME }}" -p "${{ secrets.REPO_PASSWORD }}"
task pipeline REPO=gitea.ceperka.net/rosti/runtime VERSION=pipeline - name: Build
run: task build REPO=gitea.ceperka.net/rosti/runtime VERSION=pipeline
- name: Test
run: task test REPO=gitea.ceperka.net/rosti/runtime VERSION=pipeline
- name: Push
run: task push REPO=gitea.ceperka.net/rosti/runtime VERSION=pipeline
- name: Cleaning step
if: always()
run: docker stop dev_test || exit 0

View file

@ -22,7 +22,8 @@ libcurl4-openssl-dev python3-dev libproj-dev gdal-bin libmemcached-dev swig mutt
ffmpeg libyaml-dev libc-client2007e-dev libonig-dev libkrb5-dev dialog \ ffmpeg libyaml-dev libc-client2007e-dev libonig-dev libkrb5-dev dialog \
whiptail tmux rsync nmap libzip-dev libfreetype6-dev \ whiptail tmux rsync nmap libzip-dev libfreetype6-dev \
jpegoptim optipng pngquant gifsicle webp libvpx-dev libwebp-dev jq inotify-tools ripgrep \ jpegoptim optipng pngquant gifsicle webp libvpx-dev libwebp-dev jq inotify-tools ripgrep \
wkhtmltopdf libzbar0 fzf wkhtmltopdf libzbar0 fzf \
gnupg2 unixodbc-dev apt-transport-https libgssapi-krb5-2 # for MS SQL Server extension
# This is stange thing in Debian 12, it blocks installation of chromium # This is stange thing in Debian 12, it blocks installation of chromium
RUN DEBIAN_FRONTEND=noninteractive apt-get remove -y luit RUN DEBIAN_FRONTEND=noninteractive apt-get remove -y luit
@ -50,52 +51,54 @@ ENV TERM xterm
# From https://nodejs.org/en/about/previous-releases # From https://nodejs.org/en/about/previous-releases
WORKDIR /usr/src WORKDIR /usr/src
ADD build_node.sh /usr/local/bin/build_node.sh ADD build_node.sh /usr/local/bin/build_node.sh
RUN build_node.sh 18.20.4 RUN build_node.sh 18.20.5 & \
RUN build_node.sh 20.18.0 build_node.sh 20.18.1 & \
RUN build_node.sh 21.7.3 build_node.sh 21.7.3 & \
RUN build_node.sh 22.9.0 build_node.sh 22.13.0 & \
build_node.sh 23.6.0
## Python ## Python
# https://www.python.org/downloads/ # https://www.python.org/downloads/
WORKDIR /usr/src WORKDIR /usr/src
ADD build_python.sh /usr/local/bin/build_python.sh ADD build_python.sh /usr/local/bin/build_python.sh
RUN build_python.sh 3.11.10 RUN build_python.sh 3.11.11
RUN build_python.sh 3.12.7 RUN build_python.sh 3.12.8
RUN build_python.sh 3.13.0 RUN build_python.sh 3.13.1
## PHP 8 ## PHP 8
# https://www.php.net/downloads.php # https://www.php.net/downloads.php
ADD build_php8.sh /usr/local/bin/build_php8.sh ADD build_php8.sh /usr/local/bin/build_php8.sh
RUN build_php8.sh 8.2.24 RUN build_php8.sh 8.3.16
RUN build_php8.sh 8.3.12 RUN build_php8.sh 8.4.3
## Ruby ## Ruby
# https://www.ruby-lang.org/en/downloads/releases/ # https://www.ruby-lang.org/en/downloads/releases/
WORKDIR /usr/src WORKDIR /usr/src
ADD build_ruby.sh /usr/local/bin/build_ruby.sh ADD build_ruby.sh /usr/local/bin/build_ruby.sh
RUN build_ruby.sh 3.2.5 RUN build_ruby.sh 3.3.7
RUN build_ruby.sh 3.3.5 RUN build_ruby.sh 3.4.1
## Deno ## Deno
# From: https://github.com/denoland/deno/releases # From: https://github.com/denoland/deno/releases
ADD build_deno.sh /usr/local/bin/build_deno.sh ADD build_deno.sh /usr/local/bin/build_deno.sh
# TODO: deno cannot run in parallel because it downloads filenames with the same name
RUN build_deno.sh 1.46.3 RUN build_deno.sh 1.46.3
RUN build_deno.sh 2.1.6
# Bun # Bun
# From here: https://bun.sh/ # From here: https://bun.sh/
ADD build_bun.sh /usr/local/bin/build_bun.sh ADD build_bun.sh /usr/local/bin/build_bun.sh
RUN build_bun.sh 1.1.29 RUN build_bun.sh 1.1.45
# OpenJDK # OpenJDK
# From here: https://jdk.java.net/ # From here: https://jdk.java.net/
ADD build_openjdk.sh /usr/local/bin/build_openjdk.sh ADD build_openjdk.sh /usr/local/bin/build_openjdk.sh
# RUN build_openjdk.sh 22.0.2 c9ecb94cd31b495da20a27d4581645e8 9 RUN build_openjdk.sh 23.0.1 c28985cbf10d4e648e4004050f8781aa 11
RUN build_openjdk.sh 23 3c5b90190c68498b986a97f276efd28a 37
# Golang # Golang
# From here: https://go.dev/dl/ # From here: https://go.dev/dl/
ADD build_golang.sh /usr/local/bin/build_golang.sh ADD build_golang.sh /usr/local/bin/build_golang.sh
RUN build_golang.sh 1.23.2 RUN build_golang.sh 1.23.5
############# #############

View file

@ -3,8 +3,9 @@
version: '3' version: '3'
vars: vars:
REPO: harbor.hq.rosti.cz/rosti/runtime REPO: harbor.hq.rosti.cz
VERSION: 2024.10-1 REPO_PUBLIC: rosti/runtime
VERSION: 2025.01-1
BASEIMAGE: debian:bookworm BASEIMAGE: debian:bookworm
tasks: tasks:
@ -21,7 +22,7 @@ tasks:
build: build:
cmds: cmds:
- docker pull {{ .BASEIMAGE }} - docker pull {{ .BASEIMAGE }}
- docker build -t {{ .REPO }}:dev . - docker build --progress plain -t {{ .REPO }}:dev .
- docker tag {{ .REPO }}:dev {{ .REPO }}:{{ .VERSION }} - docker tag {{ .REPO }}:dev {{ .REPO }}:{{ .VERSION }}
- echo "JSON for admin:" - echo "JSON for admin:"
- python3 generate_versions.py - python3 generate_versions.py
@ -33,7 +34,7 @@ tasks:
squashed: squashed:
cmds: cmds:
- docker pull {{ .BASEIMAGE }} - docker pull {{ .BASEIMAGE }}
- docker build --squash -t {{ .REPO }}:dev-squashed . - docker build --progress plain --squash -t {{ .REPO }}:dev-squashed .
- docker tag {{ .REPO }}:dev-squashed {{ .REPO }}:{{ .VERSION }} - docker tag {{ .REPO }}:dev-squashed {{ .REPO }}:{{ .VERSION }}
- echo "JSON for admin:" - echo "JSON for admin:"
- python3 generate_versions.py - python3 generate_versions.py
@ -43,3 +44,12 @@ tasks:
- docker push {{ .REPO }}:{{ .VERSION }} - docker push {{ .REPO }}:{{ .VERSION }}
# deps: # deps:
# - squashed # - squashed
install:
cmds:
- ssh rosti-node-26 docker pull {{ .REPO }}:{{ .VERSION }}
- ssh rosti-node-26 docker tag {{ .REPO }}:{{ .VERSION }} {{ .REPO_PUBLIC }}:{{ .VERSION }}
publish:
cmds:
- ssh rosti-node-26 docker push {{ .REPO_PUBLIC }}:{{ .VERSION }}

View file

@ -71,6 +71,8 @@ cd -
echo "no" | /opt/techs/php-$VERSION/bin/pecl install redis echo "no" | /opt/techs/php-$VERSION/bin/pecl install redis
echo "no" | /opt/techs/php-$VERSION/bin/pecl install mongodb echo "no" | /opt/techs/php-$VERSION/bin/pecl install mongodb
echo "no" | /opt/techs/php-$VERSION/bin/pecl install sqlsrv
echo "no" | /opt/techs/php-$VERSION/bin/pecl install pdo_sqlsrv
export PATH=$PATH:/opt/techs/php-$VERSION/bin export PATH=$PATH:/opt/techs/php-$VERSION/bin
composer.phar require ext-simplexml composer.phar require ext-simplexml
@ -78,14 +80,16 @@ composer.phar require ext-simplexml
echo "zend_extension=opcache.so" > /opt/techs/php-$VERSION/etc/conf.d/extensions.ini echo "zend_extension=opcache.so" > /opt/techs/php-$VERSION/etc/conf.d/extensions.ini
echo "extension=redis.so" >> /opt/techs/php-$VERSION/etc/conf.d/extensions.ini echo "extension=redis.so" >> /opt/techs/php-$VERSION/etc/conf.d/extensions.ini
echo "extension=mongodb.so" >> /opt/techs/php-$VERSION/etc/conf.d/extensions.ini echo "extension=mongodb.so" >> /opt/techs/php-$VERSION/etc/conf.d/extensions.ini
echo "extension=sqlsrv.so" >> /opt/techs/php-$VERSION/etc/conf.d/extensions.ini
echo "extension=pdo_sqlsrv.so" >> /opt/techs/php-$VERSION/etc/conf.d/extensions.ini
# Not supported yet # Not supported yet
# https://github.com/Imagick/imagick/issues/358 # https://github.com/Imagick/imagick/issues/358
# We ignore PHP 8.3.2 until it's fixed # We ignore PHP 8.3.2 until it's fixed
if [ "$VERSION" != "8.3.2" -a "$VERSION" != "8.3.6" -a "$VERSION" != "8.3.9" -a "$VERSION" != "8.3.12" ]; then # if [ "$VERSION" != "8.3.2" -a "$VERSION" != "8.3.6" -a "$VERSION" != "8.3.9" -a "$VERSION" != "8.3.12" ]; then
echo "no" | /opt/techs/php-$VERSION/bin/pecl install imagick # echo "no" | /opt/techs/php-$VERSION/bin/pecl install imagick
echo "extension=imagick.so" >> /opt/techs/php-$VERSION/etc/conf.d/extensions.ini # echo "extension=imagick.so" >> /opt/techs/php-$VERSION/etc/conf.d/extensions.ini
fi # fi
ln -s /srv/conf/php-fpm/php.ini /opt/techs/php-$VERSION/etc/conf.d/99-app.ini ln -s /srv/conf/php-fpm/php.ini /opt/techs/php-$VERSION/etc/conf.d/99-app.ini

View file

@ -1,9 +1,9 @@
worker_processes 1; worker_processes 1;
error_log stderr; error_log stderr;
pid /srv/run/nginx.pid; pid /srv/run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;
events { events {
worker_connections 1024; worker_connections 1024;
@ -82,3 +82,6 @@ http {
include /srv/conf/nginx.d/*; include /srv/conf/nginx.d/*;
} }
include /srv/conf/nginx.main.d/*;

View file

@ -4,9 +4,14 @@ set TECHS_FILE /tmp/techs.txt
echo -n > $TECHS_FILE echo -n > $TECHS_FILE
for line in (cat Dockerfile | grep "RUN build_") for line in (cat Dockerfile | grep "build_" | grep -v "/usr/local")
set VERSION (echo $line | cut -d " " -f 3) set line (echo $line | sed "s/RUN //")
set TECH_SCRIPT (echo $line | cut -d " " -f 2) set line (echo $line | sed "s/ADD //")
set line (echo $line | sed "s/& \\\//")
set line (echo $line | sed "s/^[ ]*//")
set VERSION (echo $line | cut -d " " -f 2)
set TECH_SCRIPT (echo $line | cut -d " " -f 1)
switch $TECH_SCRIPT switch $TECH_SCRIPT
case "build_php.sh" case "build_php.sh"

View file

@ -19,12 +19,16 @@ with open("Dockerfile") as f:
if line.startswith("FROM debian:"): if line.startswith("FROM debian:"):
image = line.split(" ")[1].strip() image = line.split(" ")[1].strip()
continue continue
if line.startswith("RUN build_"): if "build_" in line and "ADD" not in line:
line = line.replace("RUN ", "").strip()
line = line.replace("& \\", "")
line = line.lstrip(" ")
parts = line.split(" ") parts = line.split(" ")
name = parts[1].replace("build_", "").replace(".sh", "") name = parts[0].replace("build_", "").replace(".sh", "")
if name.startswith("php"): if name.startswith("php"):
name = "php" name = "php"
version = line.split(" ")[2].strip() version = parts[1].strip()
if name not in output["techs"]: if name not in output["techs"]:
output["techs"][name] = { output["techs"][name] = {
"versions": [], "versions": [],

View file

@ -3,14 +3,14 @@
. ~/.bashrc . ~/.bashrc
# DEFAULT VERSIONS # DEFAULT VERSIONS
VERSION_PYTHON="3.13.0" VERSION_NODE="23.6.0"
VERSION_PHP="8.3.12" VERSION_PYTHON="3.13.1"
VERSION_NODE="22.9.0" VERSION_PHP="8.4.3"
VERSION_RUBY="3.3.5" VERSION_RUBY="3.4.1"
VERSION_DENO="1.46.3" VERSION_DENO="2.1.6"
VERSION_BUN="1.1.29" VERSION_BUN="1.1.45"
VERSION_OPENJDK="23" VERSION_OPENJDK="23.0.1"
VERSION_GOLANG="1.23.2" VERSION_GOLANG="1.23.5"
WIDTH=180 WIDTH=180
HEIGHT=25 HEIGHT=25
@ -54,6 +54,15 @@ function setTech() {
if [ -e /srv/app/supervisor.conf ]; then if [ -e /srv/app/supervisor.conf ]; then
mv /srv/app/supervisor.conf /srv/conf/supervisor.d/$name.conf mv /srv/app/supervisor.conf /srv/conf/supervisor.d/$name.conf
fi fi
# Ruby initialization specifics
if [ "$name" = "ruby" ]; then
mkdir -p /srv/app/public
rm /srv/conf/nginx.d/app.conf
mv /srv/app/index.html /srv/app/public/index.html
rm -rf /srv/conf/nginx.d
rm -f /srv/conf/supervisor.d/nginx.conf
fi
else else
echo "IMPORTANT: /srv/app found so no configuration or files are copied, make sure the application is ok after this process" echo "IMPORTANT: /srv/app found so no configuration or files are copied, make sure the application is ok after this process"
fi fi
@ -112,14 +121,6 @@ function setTech() {
echo ".. app configuration for nginx not found, adding it - please check /srv/conf/nginx.d/app.conf and make sure it fits your code" echo ".. app configuration for nginx not found, adding it - please check /srv/conf/nginx.d/app.conf and make sure it fits your code"
fi fi
if [ "$name" = "ruby" ]; then
mkdir -p /srv/app/public
rm /srv/conf/nginx.d/app.conf
mv /srv/app/index.html /srv/app/public/index.html
rm -rf /srv/conf/nginx.d
rm -f /srv/conf/supervisor.d/nginx.conf
fi
# We load new configuration into supervisor and it's automatically started or restarted if needed # We load new configuration into supervisor and it's automatically started or restarted if needed
supervisorctl reread supervisorctl reread
supervisorctl update supervisorctl update

View file

@ -24,10 +24,10 @@ fi
CONTAINER_NAME=dev_test CONTAINER_NAME=dev_test
$DOCKER stop $CONTAINER_NAME &>/dev/null $DOCKER stop $CONTAINER_NAME &>/dev/null
COUNT=`cat Dockerfile | grep -e "^RUN build_" | sed "s/RUN build_//" | sed "s/\.sh//" | sed "s/php8/php/" | wc -l` COUNT=`cat Dockerfile | grep -e "build_" | grep -v "/usr/local" | sed "s/RUN //" | sed "s/ADD //" | sed 's/& \\\//' | sed "s/^[ ]*//" | sed "s/build_//" | sed "s/\.sh//" | sed "s/php8/php/" | wc -l`
I=1 I=1
cat Dockerfile | grep -e "^RUN build_" | sed "s/RUN build_//" | sed "s/\.sh//" | sed "s/php8/php/" | \ cat Dockerfile | grep -e "build_" | grep -v "/usr/local" | sed "s/RUN //" | sed "s/ADD //" | sed 's/& \\//' | sed "s/^[ ]*//" | sed "s/build_//" | sed "s/\.sh//" | sed "s/php8/php/" | \
while read line while read line
do do
tech=`echo $line | cut -d " " -f 1` tech=`echo $line | cut -d " " -f 1`