Skip to content
Snippets Groups Projects
Commit dec17159 authored by Florian Obersteiner's avatar Florian Obersteiner :octopus:
Browse files

add deploy stage to ci script

parent e3d196e8
No related branches found
No related tags found
1 merge request!11draft auto-deployment
......@@ -3,6 +3,7 @@ Dockerfile
.git
.gitignore
__pycache__/
.ruff_cache
*.pyc
*.pyo
*.pyd
......@@ -14,3 +15,4 @@ env/
*.sqlite3
instance/
experiments/
testdata/
......@@ -3,6 +3,9 @@ stages:
# - build_and_deploy
variables:
APP_NAME: iriscc-dashboard
HOST_PORT: 19000
CONTAINER_PORT: 19000
UV_VERSION: 0.6
PYTHON_VERSION: 3.12
BASE_LAYER: bookworm-slim
......@@ -30,26 +33,25 @@ test:
- uv cache prune --ci
only:
- tags
#
#
# # Build and deploy the Docker container directly on the server
# build_and_deploy:
# stage: build_and_deploy
# script:
# - echo "Starting build and deployment of $APP_NAME version $CI_COMMIT_TAG"
# # Build the Docker image locally
# - docker build -t $APP_NAME:$CI_COMMIT_TAG .
# # Stop and remove existing container if it exists
# - |
# if docker ps -a | grep -q $APP_NAME; then
# docker stop $APP_NAME
# docker rm $APP_NAME
# fi
# # Start the new container
# - docker run -d --name $APP_NAME -p $HOST_PORT:$CONTAINER_PORT --restart unless-stopped $APP_NAME:$CI_COMMIT_TAG
# - echo "Build and deployment complete!"
# only:
# - tags
# # This ensures the job runs on the specific runner on your server
# tags:
# - deployment-server
# Build and deploy the Docker container directly on the server
build_and_deploy:
stage: build_and_deploy
script:
- echo "Starting build and deployment of $APP_NAME version $CI_COMMIT_TAG"
# Build the Docker image locally
- docker build -t $APP_NAME:$CI_COMMIT_TAG .
# Stop and remove existing container if it exists
- |
if docker ps -a | grep -q $APP_NAME; then
docker stop $APP_NAME
docker rm $APP_NAME
fi
# Start the new container
- docker run -d --name $APP_NAME -p $HOST_PORT:$CONTAINER_PORT --env-file ./.env --restart unless-stopped $APP_NAME:$CI_COMMIT_TAG
- echo "Build and deployment complete!"
only:
- tags
# This ensures the job runs on the specific runner on your server
tags:
- deployment-server
# ###
# generated with Gemini 2.5 pro/experimental
# ###
# generated with Gemini 2.5 pro/experimental, revised.
#
# build: 'docker build -t iriscc-dash . --debug'
# run: 'docker run -p 19000:19000 --env-file ./.env -e DEBUG_MODE=True iriscc-dash'
# ###
# Use an official Python runtime as a parent image
# Choose a specific version for reproducibility, -slim versions are smaller
FROM python:3.12-slim
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment