Jump to content

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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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?

Share this post


Link to post
Share on other sites

Yeah, but that's just about it. Any module / template / field or other setting is saved in the db.

  • Like 2

Share this post


Link to post
Share on other sites

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By szabesz
      Warning: it's going to be TL;DR so proceed with caution
      In an effort to come up with an optimized development workflow, I have come up with the idea of implementing most of the required template files in the form of static HTML files first (based on a "CSS framework" which will also serve as the CSS base of the site).
      Basically I want to implement most of the frontend without touching ProcessWire in the first place. The advantage of this approach is that it is a lot faster to work with only HTML/CSS/JS during the frontend design phase of the project, and the end result of the design phase can be "similar" to a wireframe/mockup which can be presented to a client, but this "mockup" actually represents (say) 80% of the final design, so it is something that is rather good to work with when the backend development with ProcessWire begins.
      This also means that my ProcessWire template files will be mostly implemented with <?php echo ... ?> and alternative syntax control structures that can be "just injected" into the above mentioned static HTML template files to turn them into ProcessWire template files later on.
      So far so good, but my ProcessWire template files are going to be separated into "template file partials", and I also want to implement the static HTML template files in the same way, so that they are also separated into "template file partials", and ideally organized in the very same structure.
      E.g. I will include the site's navigation in the ProcessWire template file like this:
      <?php echo $navigation ?>
      So I want to do the same in the corresponding static HTML template file, something like this:
      <div data-template="partials_navigation"></div>
      If it can be done recursively, then I can implement the same in both cases. With ProcessWire, I use wireRenderFile() to render partials recursively, so I just had to figure out what to use in the case of the static HTML template files.
      What else to use if not JavaScript? I started off by googling around, looking for some pre-made solutions... I did not find too much that could help me, the only thing useful I could dig up is "HTML Imports", for example:
      http://blog.teamtreehouse.com/introduction-html-imports
      Note, that currently this technique only works in Chrome(-ium), but that is my choice in frontend development anyway. I've read somewhere that other browsers might never implement "HTML Imports", but that is to be seen...
      I have found a lot of articles explaining the basics of "HTML Imports", but I could not find any libraries or frameworks nor even something similar to what I need, so I implemented a proof of concept version of mine:
      I'm quite happy with the result so far. The JavaScript code needs some additional error handling, but otherwise it seems to do what I need.
      Here it is in action (Chrome(-ium) only!!!): [...no longer live...]
      And here is the source code for those who want to take a closer look: [...old stuff, I removed it to save space...]
      However, I'm pretty sure that someone must have already come up with this idea, so I'm asking the ProcessWire community if anyone can point me to similar solutions, something that I can study and/or use.
      So any piece of advice that might help me to take it to the next level, or any objections to this "HTML Imports" technique, any disadvantages? Thank you in advance
    • By ksymmons
      Hey guys,
      As the question says, I'd really like to learn about your initial client communication workflows. In other words, what's your process like from the moment you get a request to provide a quote for a website to the moment you actually send the quote?
      My current workflow:
      A client fills out the contact form on my site to request a quote. I review the information provided and send them a Word document questionnaire with a list of questions. I ask for things like project scope, features needed, desired timeline, allocated budget, etc. They fill out the document and send it back to me. I review the information provided and make sure I've got everything I need. I write and send the quote to the client. Client accepts the quote. I send them a contract, get it signed and collect 50% of total payment. I gather some extra information from them, usually just by asking questions via email or by sending them another Word document questionnaire. I start building their site. Lately, I've been thinking about changing this workflow a bit. Currently, my online contact form has three fields: name, email and message. What I'm thinking is, what if I provide a select toggle above my form so that clients can choose between a simple, general enquiries form and a larger form (with all the questions I've got in my Word document) to request a quote? This would allow me to do away with the Word document, and would make this a one-step process.
      The reason why I haven't done this so far is because I'm not sure how good of an idea it is to have a long contact form with say, 10-15 questions. What's your take on this?
      Another thing I'm not entirely happy with is having to send them two questionnaires (steps 2 and 8). The reason why I do this is because I don't want to overwhelm them with lots of questions at the beginning, and also because, to be honest, the questions I ask in the 2nd questionnaire do not really influence pricing, as they have more to do with the nature of their business, their goals with the new site, possible corporate colours they may have, things like that.
      What do you guys think? Does my workflow seem sensible to you? Is it similar to what you do? What would you change?
      Thanks, and sorry for the brick!
      P.S. If some of you guys are willing to share your client questionnaires I would certainly appreciate it.
    • By thmsnhl
      Hi everybody,
      we started our first Processwire driven project in my new company and for the first time, I was working on one site with more than 2 colleagues on the same site.
      It didn't take long for us to stumble across some problems when multiple developers work at the same time, conflicts with updating the database on vagrant machines, like duplicate entries for page IDs, errors when setting up fields and stuff like this. We ended up working on a dedicated database server, that we linked to our vagrant machines and most of the problems were gone, but the performance of this constellation is really bad compared to our first approach with database running on vagrant machines.
      I already tried to find a solution in the forums but I couldn't find anyone with problems like this.
      So I was wondering: how do you manage projects with multiple developers on vagrant machines in a git-based workflow?
    • By clsource
      Hello folks,
      I was working on different projects and needed to have a better way to organize my code
      and a workflow.
      And I came across this methodology
      https://about.gitlab.com/2014/09/29/gitlab-flow/
      Here's a video explaining the workflow

      Hope it helps
×
×
  • Create New...