Merge pull request 'feat: Update Gitea authentication to use username and password instead of a token and downgrade Python base image to 3.11.' (#6) from CIzz22/rbd-app:main into main

Reviewed-on: DigitalTwin/rbd-app#6
main
CIzz22 3 weeks ago
commit e87edd4d6e

@ -1,13 +1,11 @@
# Use the official Python 3.11 image from the Docker Hub # Use the official Python 3.11 image from the Docker Hub
FROM python:3.13-slim as builder FROM python:3.11-slim as builder
ARG GITEA_TOKEN
# Install Poetry # Install Poetry
RUN pip install poetry RUN pip install poetry
ARG GITEA_USERNAME
RUN poetry config http-basic.licaeros-repo token ${GITEA_TOKEN} ARG GITEA_PASSWORD
# Set environment variables for Poetry # Set environment variables for Poetry
ENV POETRY_NO_INTERACTION=1 \ ENV POETRY_NO_INTERACTION=1 \
@ -18,6 +16,8 @@ ENV POETRY_NO_INTERACTION=1 \
# Set the working directory # Set the working directory
WORKDIR /app WORKDIR /app
RUN poetry config http-basic.licaeros-repo ${GITEA_USERNAME} ${GITEA_PASSWORD}
# Copy the Poetry configuration files # Copy the Poetry configuration files
COPY pyproject.toml poetry.lock ./ COPY pyproject.toml poetry.lock ./
@ -25,7 +25,7 @@ COPY pyproject.toml poetry.lock ./
RUN poetry install --no-root RUN poetry install --no-root
# Use a new slim image for the runtime # Use a new slim image for the runtime
FROM python:3.13-slim as runtime FROM python:3.11-slim as runtime
# Install necessary tools for running the app, including `make` # Install necessary tools for running the app, including `make`
RUN apt-get update && apt-get install -y --no-install-recommends \ RUN apt-get update && apt-get install -y --no-install-recommends \

6
Jenkinsfile vendored

@ -5,7 +5,7 @@ pipeline {
DOCKER_HUB_USERNAME = 'aimodocker' DOCKER_HUB_USERNAME = 'aimodocker'
// This creates DOCKER_AUTH_USR and DOCKER_AUTH_PSW // This creates DOCKER_AUTH_USR and DOCKER_AUTH_PSW
DOCKER_AUTH = credentials('aimodocker') DOCKER_AUTH = credentials('aimodocker')
GITEA_ID = 'gitea-token-secret' GITEA_CREDS = credentials('gitea-credentials')
IMAGE_NAME = 'rbd-service' IMAGE_NAME = 'rbd-service'
SERVICE_NAME = 'ahm-app' SERVICE_NAME = 'ahm-app'
@ -53,12 +53,12 @@ pipeline {
stage('Build & Tag') { stage('Build & Tag') {
steps { steps {
withCredentials([string(credentialsId: GITEA_ID, variable: 'GITEA_TOKEN')]) { withCredentials([usernamePassword(credentialsId: 'gitea-credentials', usernameVariable: 'GITEA_USERNAME', passwordVariable: 'GITEA_PASSWORD')]) {
// Logic and variable definitions go inside 'script' // Logic and variable definitions go inside 'script'
script { script {
def fullImageName = "${DOCKER_HUB_USERNAME}/${IMAGE_NAME}" def fullImageName = "${DOCKER_HUB_USERNAME}/${IMAGE_NAME}"
sh "docker build --build-arg GITEA_TOKEN=${GITEA_TOKEN} -t ${fullImageName}:${IMAGE_TAG} ." sh "docker build --build-arg GITEA_USERNAME=${GITEA_USERNAME} --build-arg GITEA_PASSWORD=${GITEA_PASSWORD} -t ${fullImageName}:${IMAGE_TAG} ."
if (SECONDARY_TAG) { if (SECONDARY_TAG) {
sh "docker tag ${fullImageName}:${IMAGE_TAG} ${fullImageName}:${SECONDARY_TAG}" sh "docker tag ${fullImageName}:${IMAGE_TAG} ${fullImageName}:${SECONDARY_TAG}"

Loading…
Cancel
Save