Commit 88b1ef77 authored by Nicolas Gelot's avatar Nicolas Gelot Committed by Romain Hunault

Update prod deployement to use tagged docker image

Close: #31
parent b95c6ec1
......@@ -94,8 +94,9 @@ coverage:
- echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
script:
- ssh -2 $PUBLISH_USER@$PUBLISH_URL "docker login -u gitlab-ci-token -p ${CI_JOB_TOKEN} ${CI_REGISTRY}"
- ssh -2 $PUBLISH_USER@$PUBLISH_URL "mkdir -p ${DEPLOY_FOLDER} && cd ${DEPLOY_FOLDER} && if [ ! -d ${CI_PROJECT_NAME} ] ; then git clone ${CI_PROJECT_URL}.git ; fi && cd ${CI_PROJECT_NAME} && git fetch && git checkout $CI_COMMIT_SHA"
- ssh -2 $PUBLISH_USER@$PUBLISH_URL "SPOT_HOSTNAME=$SPOT_HOSTNAME && export SPOT_HOSTNAME && cd ${DEPLOY_FOLDER}/${CI_PROJECT_NAME} && docker-compose pull && docker-compose up -d --build --force-recreate"
- ssh -2 $PUBLISH_USER@$PUBLISH_URL "SPOT_DOCKER_TAG=$SPOT_DOCKER_TAG && COMPOSE_FILE=$COMPOSE_FILE && SPOT_HOSTNAME=$SPOT_HOSTNAME && export SPOT_HOSTNAME COMPOSE_FILE SPOT_DOCKER_TAG && cd ${DEPLOY_FOLDER}/${CI_PROJECT_NAME} && docker-compose pull && docker-compose up -d --build --force-recreate"
test:
extends: .deploy:template
......@@ -105,6 +106,7 @@ test:
GIT_STRATEGY: none
SPOT_HOSTNAME: spot.test.ecloud.global
SSH_PRIVATE_KEY: ${SSH_PRIVATE_KEY_TEST}
COMPOSE_FILE: docker-compose.yml:docker-compose-dev.yml
prod:
extends: .deploy:template
......@@ -115,4 +117,6 @@ prod:
PUBLISH_URL: spot.ecloud.global
GIT_STRATEGY: none
SPOT_HOSTNAME: spot.ecloud.global
SPOT_DOCKER_TAG: ${CI_COMMIT_TAG}
SSH_PRIVATE_KEY: ${SSH_PRIVATE_KEY_PROD}
COMPOSE_FILE: docker-compose.yml
......@@ -34,6 +34,7 @@ First run the redis database:
Then on spot workdir run the following commands to start spot:
- ``export COMPOSE_FILE=docker-compose.yml:docker-compose-dev.yml``
- ``docker-compose build spot``
- ``docker-compose run --rm -v $(pwd):/ws -w /ws -e PYTHONPATH=/ws spot sh``
- ``python3 -X dev searx/webapp.py``
......
......@@ -2,6 +2,7 @@ version: '3.6'
services:
spot:
build: .
entrypoint:
- coverage
- run
......
version: '3.6'
services:
spot:
build: .
......@@ -6,7 +6,7 @@ services:
image: redis:5-alpine
spot:
build: .
image: registry.gitlab.e.foundation:5000/e/cloud/my-spot:${SPOT_DOCKER_TAG:-latest}
restart: unless-stopped
environment:
SEARX_REDIS_HOST: redis
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment