diff --git a/.drone.yml b/.drone.yml index 97b0cc5..03e1b40 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,19 +1,19 @@ kind: pipeline type: exec -name: willaengine +name: default steps: - - name: build_production + - name: build to production commands: - - docker build -t registry.willaspace.com/willaspace/${IMAGE_NAME}:latest --build-arg ssh_prv_key="$(cat /home/administrator/.ssh/id_rsa)" . - - cd /home/administrator/apps/${IMAGE_NAME}/;sudo ./BuildDocker + - sudo cp /home/administrator/apps/willaengine/composer-prod.json . + - docker build -t registry.willaspace.com/willaspace/willaengine:latest --build-arg ssh_prv_key="$(cat /home/administrator/.ssh/id_rsa)" . when: branch: - master - - name: deploy_production + - name: deploy to production commands: - - cd /home/administrator/apps/${IMAGE_NAME}/ ; docker-compose up -d + - cd /home/administrator/apps/willaengine/ ; docker-compose up -d - docker exec willaengine bash -c "COMPOSER=composer-prod.json composer update" - docker exec willaengine service cron start - docker exec willaengine php artisan config:cache @@ -22,17 +22,17 @@ steps: branch: - master - - name: build_staging + - name: build to staging commands: - - docker build -t registry.willaspace.com/willaspace/${IMAGE_NAME}-staging:latest -f Dockerfile.staging --build-arg ssh_prv_key="$(cat /home/administrator/.ssh/id_rsa)" . - - docker build -t registry.willaspace.com/willaspace/${IMAGE_NAME}-staging-nginx:latest -f Dockerfile.nginx . + - docker build -t registry.willaspace.com/willaspace/willaengine-staging:latest --build-arg COMPOSER_FILE_NAME=composer-staging -f Dockerfile.staging . + - docker build -t registry.willaspace.com/willaspace/willaengine-staging-nginx:latest -f Dockerfile.nginx . when: branch: - dev - - name: deploy_staging + - name: deploy to staging commands: - - cd /apps/${IMAGE_NAME}-staging/ ; docker-compose up -d + - cd /apps/willaengine-staging/ ; docker-compose up -d when: branch: - dev @@ -41,6 +41,3 @@ trigger: branch: - master - dev - -environment: - - IMAGE_NAME=willaengine diff --git a/Dockerfile.nginx b/Dockerfile.nginx index db0a5bb..40860b1 100644 --- a/Dockerfile.nginx +++ b/Dockerfile.nginx @@ -1,8 +1,3 @@ -FROM registry.willaspace.com/willaspace/willaengine-staging:latest AS php_builder - -WORKDIR /var/www/html/ -RUN npm install -RUN npm run staging - FROM nginx:1.21.1 -COPY --from=php_builder /var/www/html /var/www/html + +COPY public /var/www/html/public diff --git a/Dockerfile.staging b/Dockerfile.staging index 9aa17cf..c953bb4 100644 --- a/Dockerfile.staging +++ b/Dockerfile.staging @@ -1,38 +1,6 @@ -FROM dfs1368/laravel-php-fpm:7.4 - -ARG ssh_prv_key +FROM fsaravi/standard-laravel:7.4 WORKDIR /var/www/html - -RUN apt install -y sendmail openssh-server libpng-dev - -# Authorize SSH Host -RUN mkdir -p /root/.ssh && \ - chmod 0700 /root/.ssh && \ - echo "$ssh_prv_key" > /root/.ssh/id_rsa && \ - ssh-keyscan git.willaspace.com > /root/.ssh/known_hosts && \ - chmod 600 /root/.ssh/id_rsa - -RUN docker-php-ext-install gd - -RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - && \ - apt-get install -y nodejs - -RUN printf 'upload_max_filesize=300M;\npost_max_size=300M;\nmax_execution_time=600;\nmax_input_time=600;\n' >> /usr/local/etc/php/conf.d/docker-php-memlimit.ini; -RUN echo 'pm.max_children = 100' >> /usr/local/etc/php-fpm.d/zz-docker.conf - -COPY database /var/www/html/database - -COPY composer-staging.* /var/www/html/ - -RUN composer clearcache && COMPOSER=composer-staging.json composer install --no-scripts - -COPY . /var/www/html - RUN php artisan morphmap:cache -RUN chown -R www-data:www-data \ - /var/www/html/public \ - /var/www/html/storage \ - /var/www/html/bootstrap/cache diff --git a/composer-staging.json b/composer-staging.json index 236e89f..4a6aa71 100644 --- a/composer-staging.json +++ b/composer-staging.json @@ -20,10 +20,23 @@ "spatie/laravel-medialibrary": "^8.0.0", "io-developer/php-whois": "^4.0", "silber/bouncer": "v1.0.0-rc.10", - "wm/blog": "dev-dev", - "wm/common": "dev-dev", - "wm/core": "dev-dev", - "wm/crm": "dev-dev", + "wm/blog": "dev-master", + "wm/common": "dev-master", + "wm/core": "dev-master", + "wm/crm": "dev-master", + "wm/portfolio": "dev-master", + "wm/product": "dev-master", + "wm/service": "dev-master", + "wm/store": "dev-master", + "wm/finance": "dev-master", + "wm/admin": "dev-master", + "wm/web-builder": "dev-master", + "wm/app-management": "dev-master", + "wm/notification": "dev-master", + "wm/roll-call": "dev-master", + "wm/lms": "dev-master", + "wm/service-store": "dev-master", + "wm/contact-us": "dev-master", "zircote/swagger-php": "^3.0" }, "provide": { @@ -93,6 +106,59 @@ { "type": "vcs", "url": "git@git.willaspace.com:WillaEngine-Project/blog.git" + }, + { + "type": "vcs", + "url": "git@git.willaspace.com:WillaEngine-Project/portfolio.git" + }, + { + "type": "vcs", + "url": "git@git.willaspace.com:WillaEngine-Project/product.git" + }, + { + "type": "vcs", + "url": "git@git.willaspace.com:WillaEngine-Project/service.git" + }, + { + "type": "vcs", + "url": "git@git.willaspace.com:WillaEngine-Project/store.git" + }, + { + "type": "vcs", + "url": "git@git.willaspace.com:WillaEngine-Project/notification.git" + }, + { + "type": "vcs", + "url": "git@git.willaspace.com:WillaEngine-Project/roll-call.git" + }, + { + "type": "vcs", + "url": "git@git.willaspace.com:WillaEngine-Project/app-management.git" + }, + { + "type": "vcs", + "url": "git@git.willaspace.com:WillaEngine-Project/web-builder.git" + }, + { + "type": "vcs", + "url": "git@git.willaspace.com:WillaEngine-Project/finance.git" + }, + { + "type": "vcs", + "url": "git@git.willaspace.com:WillaEngine-Project/service-store.git" + }, + { + "type": "vcs", + "url": "git@git.willaspace.com:WillaEngine-Project/admin.git" + }, + { + "type": "vcs", + "url": "git@git.willaspace.com:WillaEngine-Project/lms.git" + }, + { + "type": "vcs", + "url": "git@git.willaspace.com:WillaEngine-Project/contact-us.git" } + ] }