Alireza Azizi 3 years ago
commit a081af688b

@ -1,19 +1,19 @@
kind: pipeline kind: pipeline
type: exec type: exec
name: willaengine name: default
steps: steps:
- name: build_production - name: build to production
commands: commands:
- docker build -t registry.willaspace.com/willaspace/${IMAGE_NAME}:latest --build-arg ssh_prv_key="$(cat /home/administrator/.ssh/id_rsa)" . - sudo cp /home/administrator/apps/willaengine/composer-prod.json .
- cd /home/administrator/apps/${IMAGE_NAME}/;sudo ./BuildDocker - docker build -t registry.willaspace.com/willaspace/willaengine:latest --build-arg ssh_prv_key="$(cat /home/administrator/.ssh/id_rsa)" .
when: when:
branch: branch:
- master - master
- name: deploy_production - name: deploy to production
commands: 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 bash -c "COMPOSER=composer-prod.json composer update"
- docker exec willaengine service cron start - docker exec willaengine service cron start
- docker exec willaengine php artisan config:cache - docker exec willaengine php artisan config:cache
@ -22,17 +22,17 @@ steps:
branch: branch:
- master - master
- name: build_staging - name: build to staging
commands: 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/willaengine-staging:latest --build-arg COMPOSER_FILE_NAME=composer-staging -f Dockerfile.staging .
- docker build -t registry.willaspace.com/willaspace/${IMAGE_NAME}-staging-nginx:latest -f Dockerfile.nginx . - docker build -t registry.willaspace.com/willaspace/willaengine-staging-nginx:latest -f Dockerfile.nginx .
when: when:
branch: branch:
- dev - dev
- name: deploy_staging - name: deploy to staging
commands: commands:
- cd /apps/${IMAGE_NAME}-staging/ ; docker-compose up -d - cd /apps/willaengine-staging/ ; docker-compose up -d
when: when:
branch: branch:
- dev - dev
@ -41,6 +41,3 @@ trigger:
branch: branch:
- master - master
- dev - dev
environment:
- IMAGE_NAME=willaengine

@ -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 FROM nginx:1.21.1
COPY --from=php_builder /var/www/html /var/www/html
COPY public /var/www/html/public

@ -1,38 +1,6 @@
FROM dfs1368/laravel-php-fpm:7.4 FROM fsaravi/standard-laravel:7.4
ARG ssh_prv_key
WORKDIR /var/www/html 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 php artisan morphmap:cache
RUN chown -R www-data:www-data \
/var/www/html/public \
/var/www/html/storage \
/var/www/html/bootstrap/cache

@ -20,10 +20,23 @@
"spatie/laravel-medialibrary": "^8.0.0", "spatie/laravel-medialibrary": "^8.0.0",
"io-developer/php-whois": "^4.0", "io-developer/php-whois": "^4.0",
"silber/bouncer": "v1.0.0-rc.10", "silber/bouncer": "v1.0.0-rc.10",
"wm/blog": "dev-dev", "wm/blog": "dev-master",
"wm/common": "dev-dev", "wm/common": "dev-master",
"wm/core": "dev-dev", "wm/core": "dev-master",
"wm/crm": "dev-dev", "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" "zircote/swagger-php": "^3.0"
}, },
"provide": { "provide": {
@ -93,6 +106,59 @@
{ {
"type": "vcs", "type": "vcs",
"url": "git@git.willaspace.com:WillaEngine-Project/blog.git" "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"
} }
] ]
} }

Loading…
Cancel
Save