Add configuration which workflow-pr binary to use #1

Merged
atartamo merged 1 commits from andriinikitin/giwtf:use_package_workflow_pr into main 2026-01-29 16:25:44 +01:00
9 changed files with 62 additions and 19 deletions

1
.gitignore vendored
View File

@@ -3,3 +3,4 @@ gitea-logs
rabbitmq-data
workflow-pr-repos
__pycache__/
/workflow-pr/workflow-pr

12
Makefile Normal file
View File

@@ -0,0 +1,12 @@
up:
podman-compose up
down:
podman-compose down
rmi:
podman rmi -f $$(podman images --filter=reference='giwtf_*' -q)
up-local-bots:
GIWTF_WORKFLOW_PR_IMAGE_SUFFIX=.local podman-compose up --force-recreate --build

View File

@@ -73,7 +73,7 @@ services:
workflow-pr:
build:
context: .
dockerfile: workflow-pr/Dockerfile
dockerfile: workflow-pr/Dockerfile${GIWTF_WORKFLOW_PR_IMAGE_SUFFIX}
container_name: workflow-pr
networks:
- gitea-network

View File

@@ -1,17 +0,0 @@
# Use the same base image as the Gitea container
FROM registry.suse.com/bci/bci-base:15.7
# Add the custom CA to the trust store
COPY rabbitmq-config/certs/cert.pem /usr/share/pki/trust/anchors/gitea-rabbitmq-ca.crt
RUN update-ca-certificates
# Install git and ssh
RUN zypper -n in git-core openssh-clients
# Copy the pre-built binary into the container
COPY workflow-pr/workflow-pr /usr/local/bin/workflow-pr
COPY workflow-pr/entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +4755 /usr/local/bin/entrypoint.sh
# Set the entrypoint for the container
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]

1
workflow-pr/Dockerfile Symbolic link
View File

@@ -0,0 +1 @@
Dockerfile.package

View File

@@ -0,0 +1,17 @@
# Use the same base image as the Gitea container
FROM registry.suse.com/bci/bci-base:15.7
# Add the custom CA to the trust store
COPY rabbitmq-config/certs/cert.pem /usr/share/pki/trust/anchors/gitea-rabbitmq-ca.crt
RUN update-ca-certificates
# Install git and ssh
RUN zypper -n in git-core openssh-clients
# Copy the pre-built binary into the container
COPY workflow-pr/workflow-pr /usr/local/bin/workflow-pr
COPY workflow-pr/entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +4755 /usr/local/bin/entrypoint.sh
# Set the entrypoint for the container
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]

View File

@@ -0,0 +1,22 @@
# Use the same base image as the Gitea container
FROM registry.suse.com/bci/bci-base:15.7
# Add the custom CA to the trust store
COPY rabbitmq-config/certs/cert.pem /usr/share/pki/trust/anchors/gitea-rabbitmq-ca.crt
RUN update-ca-certificates
RUN zypper ar -f http://download.opensuse.org/repositories/devel:/Factory:/git-workflow/15.7/devel:Factory:git-workflow.repo
RUN zypper --gpg-auto-import-keys ref
# Install git and ssh
RUN zypper -n in git-core openssh-clients autogits-workflow-pr
# Copy the pre-built binary into the container
# COPY workflow-pr/workflow-pr /usr/local/bin/workflow-pr
COPY workflow-pr/entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +4755 /usr/local/bin/entrypoint.sh
# Set the entrypoint for the container
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]

View File

@@ -55,4 +55,11 @@ for i in {1..10}; do
done
chmod 644 /root/.ssh/known_hosts
exec /usr/local/bin/workflow-pr "$@"
exe=$(which workflow-pr)
exe=${exe:-/usr/local/bin/workflow-pr}
package=$(rpm -qa | grep autogits-workflow-pr) || :
echo !!!!!!!!!!!!!!!! using binary $exe; installed package: $package
exec "$exe" "$@"

Binary file not shown.