diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 185c71f9..081e344f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,43 +1,38 @@ -image: php:7.2 +image: registry.gitlab.com/thegamecraft/c-cms:latest -cache: - paths: - - vendor/ +services: + - mysql:5.7 -before_script: -- apt-get update -qq && apt-get install -y -qq sshpass -- apt-get install zip unzip -- apt-get install git -yqq -- sshpass -V +variables: + MYSQL_DATABASE: homestead + MYSQL_ROOT_PASSWORD: secret + DB_HOST: mysql + DB_USERNAME: root -build_stage: - stage: build +stages: + - test + - deploy + +unit_test: + stage: test script: - - curl -sS https://getcomposer.org/installer | php - - php composer.phar install - - mv composer.phar /usr/local/bin/composer - - chmod -R 777 storage - - chmod -R 777 bootstrap - - composer update + - cp .env.example .env + - composer install + - php artisan key:generate -deploy_697: +deploy_production: stage: deploy - only: - - master - environment: - name: C697 script: - - export SSHPASS=$USER_PASS - - sshpass -e scp -o stricthostkeychecking=no -r . admin@54.39.97.124:/var/www/website/C697 - - sshpass -e ssh -t admin@54.39.97.124 "cd /var/www/website/C697 && php artisan migrate" + - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )' + - eval $(ssh-agent -s) + - ssh-add <(echo "$SSH_PRIVATE_KEY") + - mkdir -p ~/.ssh + - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config' -deploy_736: - stage: deploy - only: - - master + - ~/.composer/vendor/bin/envoy run deploy --commit="$CI_COMMIT_SHA" environment: - name: C736 - script: - - export SSHPASS=$USER_PASS - - sshpass -e scp -o stricthostkeychecking=no -r . admin@54.39.97.124:/var/www/website/C736 - - sshpass -e ssh -t admin@54.39.97.124 "cd /var/www/website/C736 && php artisan migrate" \ No newline at end of file + name: production + url: http://dev.exvps.ca + when: manual + only: + - master \ No newline at end of file diff --git a/DockerFile b/Dockerfile similarity index 82% rename from DockerFile rename to Dockerfile index b2098688..28429ee9 100644 --- a/DockerFile +++ b/Dockerfile @@ -5,14 +5,16 @@ FROM php:7.2 RUN apt-get update # Install PHP and composer dependencies -RUN apt-get install -qq git curl libmcrypt-dev libjpeg-dev libpng-dev libfreetype6-dev libbz2-dev +RUN apt-get install -qq git curl libmcrypt-dev libjpeg-dev libpng-dev libfreetype6-dev libbz2-dev autoconf libc-dev pkg-config # Clear out the local repository of retrieved package files RUN apt-get clean # Install needed extensions # Here you can install any other extension that you need during the test and deployment process -RUN docker-php-ext-install mcrypt pdo_mysql zip +RUN docker-php-ext-install pdo_mysql zip + +RUN pecl install mcrypt-1.0.1 # Install Composer RUN curl --silent --show-error https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer