Commit bb72fd12 authored by okhin's avatar okhin 🚴

Fixing the CI

parent 536c5932
Pipeline #700 failed with stage
in 0 seconds
before_script:
- '[[ -d /srv/piphone/ ]] || mkdir -p /srv/piphone/'
- 'which git || (apt-get update -yq && apt-get install git -yqq)'
- 'which virtualenv || (apt-get update -yq && apt-get install python3-virtualenv -yqq)'
- 'which sqlite3 || (apt-get update -yq && apt-get install sqlite3 -yqq)'
job install:
variables:
SQLITE_DB: "/srv/piphone/backend_sip.sqlite3"
BASE_PATH: "$PREPROD_BASE_PATH"
SQLITE_DB: "${BASE_PATH}/backend_sip.sqlite3"
VIRTUALENV: "${BASE_PATH}/.sip-backend_env/"
script:
- chmod a+x ci/install.sh
- ./ci/install.sh
- rsync -ruC . ${BASE_PATH}
- source ${VIRTUALENV}/bin/activate
- pip install --upgrade pip
- pip install --upgrade -r requirements.txt
stage: deploy
tags:
- preprod
tags: [preprod]
only:
- master
#!/bin/bash
# This schript is used to setup what needs to be (virtualenv and stuff)
# before running the pthon setup.py part
# We need those variables
if [ -z "$CI_PROJECT_DIR" ]
then
echo "CI_PROJECT_DIR undefined"
exit 1
fi
export CI_PROJECT_NAME=$(basename $CI_PROJECT_DIR)
if [ -z "$CI_BUILD_REPO" ]
then
echo "CI_BUILD_REPO undefined"
exit 1
fi
cd /srv/piphone
if [ -d $CI_PROJECT_NAME ]
then
cd $CI_PROJECT_NAME
git pull origin master
else
git clone $CI_BUILD_REPO $CI_PROJECT_NAME
cd $CI_PROJECT_NAME
fi
if [ ! -d ./.${CI_PROJECT_NAME}_env ]
then
virtualenv --python=python3 .${CI_PROJECT_NAME}_env
fi
source .${CI_PROJECT_NAME}_env/bin/activate
pip install -r ./requirements.txt
if [ ! -e $SQLITE_DB ]
then
sqlite3 $SQLITE_DB < database.sql
fi
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