Compare commits

..

No commits in common. "main" and "2024.10-1" have entirely different histories.

10 changed files with 56 additions and 123 deletions

View file

@ -1,31 +0,0 @@
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,20 +6,14 @@ on:
jobs: jobs:
build: build:
runs-on: [dev, amd64] runs-on: [moon, amd64]
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: docker login - name: Test build
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 }}"
- name: Build task pipeline REPO=gitea.ceperka.net/rosti/runtime VERSION=pipeline
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,8 +22,7 @@ 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
@ -51,54 +50,52 @@ 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.5 & \ RUN build_node.sh 18.20.4
build_node.sh 20.18.1 & \ RUN build_node.sh 20.18.0
build_node.sh 21.7.3 & \ RUN build_node.sh 21.7.3
build_node.sh 22.13.0 & \ RUN build_node.sh 22.9.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.11 RUN build_python.sh 3.11.10
RUN build_python.sh 3.12.8 RUN build_python.sh 3.12.7
RUN build_python.sh 3.13.1 RUN build_python.sh 3.13.0
## 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.3.16 RUN build_php8.sh 8.2.24
RUN build_php8.sh 8.4.3 RUN build_php8.sh 8.3.12
## 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.3.7 RUN build_ruby.sh 3.2.5
RUN build_ruby.sh 3.4.1 RUN build_ruby.sh 3.3.5
## 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.45 RUN build_bun.sh 1.1.29
# 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 23.0.1 c28985cbf10d4e648e4004050f8781aa 11 # RUN build_openjdk.sh 22.0.2 c9ecb94cd31b495da20a27d4581645e8 9
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.5 RUN build_golang.sh 1.23.2
############# #############

View file

@ -3,9 +3,8 @@
version: '3' version: '3'
vars: vars:
REPO: harbor.hq.rosti.cz REPO: harbor.hq.rosti.cz/rosti/runtime
REPO_PUBLIC: rosti/runtime VERSION: 2024.10-1
VERSION: 2025.01-1
BASEIMAGE: debian:bookworm BASEIMAGE: debian:bookworm
tasks: tasks:
@ -22,7 +21,7 @@ tasks:
build: build:
cmds: cmds:
- docker pull {{ .BASEIMAGE }} - docker pull {{ .BASEIMAGE }}
- docker build --progress plain -t {{ .REPO }}:dev . - docker build -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
@ -34,7 +33,7 @@ tasks:
squashed: squashed:
cmds: cmds:
- docker pull {{ .BASEIMAGE }} - docker pull {{ .BASEIMAGE }}
- docker build --progress plain --squash -t {{ .REPO }}:dev-squashed . - docker build --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
@ -44,12 +43,3 @@ 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,8 +71,6 @@ 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
@ -80,16 +78,14 @@ 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,8 +1,8 @@
worker_processes 1; worker_processes 1;
error_log stderr;
pid /srv/run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf; error_log stderr;
pid /srv/run/nginx.pid;
events { events {
@ -82,6 +82,3 @@ http {
include /srv/conf/nginx.d/*; include /srv/conf/nginx.d/*;
} }
include /srv/conf/nginx.main.d/*;

View file

@ -4,14 +4,9 @@ set TECHS_FILE /tmp/techs.txt
echo -n > $TECHS_FILE echo -n > $TECHS_FILE
for line in (cat Dockerfile | grep "build_" | grep -v "/usr/local") for line in (cat Dockerfile | grep "RUN build_")
set line (echo $line | sed "s/RUN //") set VERSION (echo $line | cut -d " " -f 3)
set line (echo $line | sed "s/ADD //") set TECH_SCRIPT (echo $line | cut -d " " -f 2)
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,16 +19,12 @@ 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 "build_" in line and "ADD" not in line: if line.startswith("RUN build_"):
line = line.replace("RUN ", "").strip()
line = line.replace("& \\", "")
line = line.lstrip(" ")
parts = line.split(" ") parts = line.split(" ")
name = parts[0].replace("build_", "").replace(".sh", "") name = parts[1].replace("build_", "").replace(".sh", "")
if name.startswith("php"): if name.startswith("php"):
name = "php" name = "php"
version = parts[1].strip() version = line.split(" ")[2].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_NODE="23.6.0" VERSION_PYTHON="3.13.0"
VERSION_PYTHON="3.13.1" VERSION_PHP="8.3.12"
VERSION_PHP="8.4.3" VERSION_NODE="22.9.0"
VERSION_RUBY="3.4.1" VERSION_RUBY="3.3.5"
VERSION_DENO="2.1.6" VERSION_DENO="1.46.3"
VERSION_BUN="1.1.45" VERSION_BUN="1.1.29"
VERSION_OPENJDK="23.0.1" VERSION_OPENJDK="23"
VERSION_GOLANG="1.23.5" VERSION_GOLANG="1.23.2"
WIDTH=180 WIDTH=180
HEIGHT=25 HEIGHT=25
@ -54,15 +54,6 @@ 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
@ -121,6 +112,14 @@ 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 "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` COUNT=`cat Dockerfile | grep -e "^RUN build_" | sed "s/RUN build_//" | sed "s/\.sh//" | sed "s/php8/php/" | wc -l`
I=1 I=1
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/" | \ cat Dockerfile | grep -e "^RUN build_" | sed "s/RUN 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`