Jump to content

Hector Nguyen
 Share

Recommended Posts

Hello everyone,

I didn't play much with ProcessWire, my project has just started and I have no experience about how ProcessWire will be when go live. I'm using a tool to deploy my code automatically to production server after build passed (Magallanes).

Please give me the answers for the questions below:

  • Which folders/files will be created by the application after installed ?
  • Which folders/files usually be overwritten?
  • Which folders/files using as cache, as session, as temporary?
  • Do ProcessWire supports logs? If so, where is it?
  • Which files are using as configuration files? Should I concern about template configuration files?

Any help would be appreciated.

Thank you!

  • Like 1
Link to comment
Share on other sites

@Hector Nguyen I've never heard of it but Magallanes does look "interesting" indeed. So I'm interested in how you will set up your projects. I would be happy to improve my workflow if Magallanes can be the tool to do so.
As for your actual question, I could answer it too but let's leave it to more experienced ProcessWire developers. I might miss something...

  • Like 1
Link to comment
Share on other sites

11 minutes ago, szabesz said:

@Hector Nguyen I've never heard of it but Magallanes does look "interesting" indeed. So I'm interested in how you will set up your projects. I would be happy to improve my workflow if Magallanes can be the tool to do so.
As for your actual question, I could answer it too but let's leave it to more experienced ProcessWire developers. I might miss something...

Hi @szabesz, thanks for your interesting.

I've created poor documentation here: https://magephp.github.io

I'm using GitLab and GitLab CI for all projects I had. So the purpose of the tool is, whenever I have a new push or accept merge request to production branch (master) or staging branch on GitLab. GitLab CI will start building my project and execute Magallanes deploy command. The repo changes content will be pulled to my server as a new release, and that release directory will be symlink to my `public_html` directory.

 

I'm using 2 environments: production and staging.

My magallanes config for staging should look like this (located at <project_folder>/.mage/config/environments/staging.yml)

# staging environment
deployment:
  strategy: git-remote-cache # git clone a bare repository on your server, then using git archive to get your code faster than usual ways
  user: www # your webserver user, or whatever user you want if it had read write access to webserver group
  port: 998 # ssh port
  from: ./ # local source code directory, e.g if you put source code into src/ directory, you need to change this
  to: /srv/users/www/apps/magento # your remote directory which contains public directory
  excludes_file: .rsync_excludes # all files/directories declared in this file will be deleted if you are using rsync strategy
extras:
  enabled: true # don't turn it off :)
  directory: shared # your bloody share directory on the server
  vcs:
    enabled: true
    kind: git
    repository: git@gitlab.com:xxx/magento.git
    branch: staging # change if you are using different branch, obviously
    remote: origin # looks at above comment
    directory: repo
  rsync:
    enabled: false # set to true if you are using rsync-remote-cache strategy
    from: ./
    local: .rsync_cache
    remote: cached-copy
  magento:
    enabled: false # set to true if you are deploying magento application
    app_path: bin/magento # magento executable file
  shared: # most important section
    enabled: true # always set to enable
    linking_strategy: absolute # i do not suggest you change this to relative
    linked_files: # contains all files you want to keep every deploy
      - app/etc/env.php
      - var/.magento_cronjob_status
      - var/.setup_cronjob_status
      - var/.update_cronjob_status
      - sitemap.xml
    linked_folders: # directory contains dynamic assets like logs, product images, session you want to keep
      - pub/media
      - var/log
      - var/session
releases:
  enabled: true # i recommend you turn on release mode :)
  max: 10 # how many release you want to keep in releases directory
  symlink: public # what is the symlink name of every release after deploy, it may be public, public_html... based on your webserver configurations
  directory: releases # the directory you keep releases, it will be created inside 'to' of 'deployment' section
hosts:
  - bloody-production-machine # your ip, ssh aliases. i do recommend you use ssh aliases for the god sake.
tasks:
  pre-deploy: # task will be execute before deploy
  on-deploy: # task will be execute while deploying
  post-release: # task will be execute right after a release created
    - composer/update
    - magento/staging-setup
    - magento/set-permissions
    - filesystem/link-shared-files
  post-deploy: # tasks will be execute right after all above tasks section complete

 

So with the above configuration, Magallanes will work like this as sequence (all remote tasks in Magallanes will open new ssh connection):

  1. Check your SSH is fine and created extras >> directory on your server if it didn't exists.
  2. Clone a bare repository into 'shared' directory from extras >> vcs >> repository.
  3. If releases >> enabled == true, then create new directory on your server named releases >> directory.
  4. Using git archive from bare repository to a new directory in releases >> directory >> unix_time
  5. Check tasks section and execute all tasks inside post-release
  6. If no error, then created new symlink in your deployment >> to under name releases >> symlink
  7. Done.

If you need further information, please let me know.

Sorry for my bloody English.

  • Like 1
Link to comment
Share on other sites

  • Which folders/files will be created by the application after installed ?
    After installation usually the only place where folders/files are created by ProcessWire is inside /site/assets. But 3rd party modules may also use different places.
  • Which folders/files usually be overwritten?
    Same answer as above
  • Which folders/files using as cache, as session, as temporary?
    /site/assets/files /site/assets/cache /site/assets/sessions
  • Do ProcessWire supports logs? If so, where is it?
    /site/assets/logs, $log
  • Which files are using as configuration files? Should I concern about template configuration files?
    That's the place where deployment tools won't help, as ProcessWire doesn't store configuration in files (for the most part anyways). There are a few tools out there to accomodate for that fact, but iirc my Migrations module is the only one you could run via cli by a deployment script.
  • Like 3
Link to comment
Share on other sites

1 hour ago, LostKobrakai said:
  • Which folders/files will be created by the application after installed ?
    After installation usually the only place where folders/files are created by ProcessWire is inside /site/assets. But 3rd party modules may also use different places.
  • Which folders/files usually be overwritten?
    Same answer as above
  • Which folders/files using as cache, as session, as temporary?
    /site/assets/files /site/assets/cache /site/assets/sessions
  • Do ProcessWire supports logs? If so, where is it?
    /site/assets/logs, $log
  • Which files are using as configuration files? Should I concern about template configuration files?
    That's the place where deployment tools won't help, as ProcessWire doesn't store configuration in files (for the most part anyways). There are a few tools out there to accomodate for that fact, but iirc my Migrations module is the only one you could run via cli by a deployment script.

 

Regarding to #5 (config files), ProcessWire does store database configuration in site/config.php, isn't it?

Link to comment
Share on other sites

 Share

×
×
  • Create New...