Commit da4d4f0a authored by Guillermo Sanz López's avatar Guillermo Sanz López
Browse files

Merge branch 'SDK15-create-dockerfile-image-with-sdk' into 'staging'

Sdk15 create dockerfile image with sdk

See merge request !9
parents cded8215 0a0cb1dd
Loading
Loading
Loading
Loading
Loading
+10 −10
Original line number Original line Diff line number Diff line
FROM labs.etsi.org:5050/ocf/capif/python:3-slim-bullseye
FROM labs.etsi.org:5050/ocf/capif/python:3-slim-bullseye


RUN apt update
# Update package index and install required tools
RUN apt update && apt install -y git nano && \
RUN apt update && apt install -y git nano && \
    rm -rf /var/lib/apt/lists/*
    rm -rf /var/lib/apt/lists/*


ARG BRANCH=main

RUN echo "Cloning branch: ${BRANCH}" && \
    git clone -b ${BRANCH} https://labs.etsi.org/rep/ocf/sdk.git

WORKDIR /sdk
WORKDIR /sdk


# Copy project files into the container
COPY .. .

# Install Python dependencies
RUN python -m pip install --upgrade pip
RUN python -m pip install --upgrade pip
RUN pip install -r installation/requirements.txt
RUN pip install -r installation/requirements.txt
RUN pip install .
RUN pip install .


# Define entrypoint: run provider first, then invoker
ENTRYPOINT sh -c '\
ENTRYPOINT sh -c '\
  set -e && \
  set -e && \
  echo "🚀 Ejecutando provider..." && \
  echo "🚀 Starting provider execution..." && \
  cd ci_cd_test/testing_samples/testing_provider_sample && \
  cd ci_cd_test/testing_samples/testing_provider_sample && \
  python testing_provider.py && \
  python testing_provider.py && \
  echo "✅ Provider finalizado." && \
  echo "✅ Provider execution finished." && \
  echo "🚀 Ejecutando invoker..." && \
  echo "🚀 Starting invoker execution..." && \
  cd ../testing_invoker_sample && \
  cd ../testing_invoker_sample && \
  python network_app_invoker.py && \
  python network_app_invoker.py && \
  echo "✅ Invoker finalizado."'
  echo "✅ Invoker execution finished."'
 No newline at end of file
 No newline at end of file
+1 −1
Original line number Original line Diff line number Diff line
#!/bin/bash
#!/bin/bash


# Nombre del contenedor e imagen
#  Name of container image
CONTAINER_NAME=capif-sdk-runner
CONTAINER_NAME=capif-sdk-runner
IMAGE_NAME=opencapif_sdk
IMAGE_NAME=opencapif_sdk


+8 −5
Original line number Original line Diff line number Diff line
#!/bin/bash
#!/bin/bash


# Nombre del contenedor e imagen
# Name of container image
CONTAINER_NAME=capif-sdk-runner
CONTAINER_NAME=capif-sdk-runner
IMAGE_NAME=opencapif_sdk
IMAGE_NAME=opencapif_sdk
BRANCH_NAME=SDK15-create-dockerfile-image-with-sdk
BRANCH_NAME=${CI_COMMIT_REF_NAME}
NETWORK_NAME=capif-network
NETWORK_NAME=capif-network


SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(dirname "$SCRIPT_DIR")"

echo "🛠️ Building image: $IMAGE_NAME from branch: $BRANCH_NAME with no cache..."
echo "🛠️ Building image: $IMAGE_NAME from branch: $BRANCH_NAME with no cache..."
docker build --no-cache . -t $IMAGE_NAME -f ci_cd_test/Dockerfile --build-arg BRANCH=$BRANCH_NAME
docker build --no-cache "$PROJECT_ROOT" -t $IMAGE_NAME -f "$SCRIPT_DIR/Dockerfile" --build-arg BRANCH=$BRANCH_NAME


echo "🚀 Running container: $CONTAINER_NAME in network: $NETWORK_NAME..."
echo "🚀 Running container: $CONTAINER_NAME in network: $NETWORK_NAME..."
docker run \
docker run \
  --rm \
  --name $CONTAINER_NAME \
  --name $CONTAINER_NAME \
  --network $NETWORK_NAME \
  --network $NETWORK_NAME \
  $IMAGE_NAME
  $IMAGE_NAME


echo "End"
echo "✅ End of script"
 No newline at end of file

cicd/exclusions

0 → 100644
+4 −0
Original line number Original line Diff line number Diff line
doc/
.git/
network_app_samples/
ci_cd_test/
 No newline at end of file

cicd/ruff.toml

0 → 100644
+3 −0
Original line number Original line Diff line number Diff line
line-length = 120
target-version = "py39"
lint.select = ["E", "W"]
 No newline at end of file
Loading