Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#37 2016-03-19 17:23:29

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,909
Website

Re: WebFaction users

This post moved to Flarum thread because it wasn’t a WebFaction problem.

Last edited by Destry (2016-03-20 12:58:27)

Offline

#38 2016-03-19 17:47:19

bici
Member
From: vancouver
Registered: 2004-02-24
Posts: 2,075
Website Mastodon

Re: WebFaction users

What if you use a symbolic link in webapps/dir to the directory where Flarum is located? which would be above the webapps/dir ?? i have never tried this, just a thought

also, i wonder if you created a subdomain, used the flarium .htaccess with restrictions there if that would help you out in testing by invited users.


…. texted postive

Offline

#39 2016-04-21 07:53:44

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,909
Website

Re: WebFaction users

Anyone installed Composer on WebFaction? There’s no official doc for this that I can find, but I have found this dated Composer installer script for WebFaction on GitHub. Not sure if I should try using it.

The reason I think we need it is because Flarum requires Composer for updates, including the installation and updating of extensions. I can do all this locally just fine, but I want to make sure I can upload everything to production reliably.

Our situation is typical. I have a local install of Flarum that’s synced with a GitHub repo, and we have the production site that’s out on it’s own. (Same setup as with our Txp install.) Composer is installed locally and test installs of Flarum extensions there using Composer work fine.

Not being a Composer maestro, what I’m trying to understand is the proper workflow in this case when Composer is in the equation. The gray area for me relates with the fact that while it’s best practice to install extensions locally first, the production database always has the latest content and user accounts, so when I update local database with production dump, I don’t want to undo any extensions that were since installed locally.

So does this workflow makes sense:

  1. Update local with production database.
  2. Install extensions locally via Composer and test/configure as desired.
  3. Sync local with GitHub repo. (All those extension files get added)1
  4. SFTP the local Flarum tree to production

Steps 1 and 2 could feasibly be in reverse by necessity. Is that a problem as far as it concerns Composer, or do I need to strictly follow those steps above?

Also, I was told in the Flarum boards (and I may have misunderstood the person) that if Composer is installed on production too (WebFaction), then I don’t have to drag all the installed extension files via SFTP, rather I just ensure the composer.lock file is uploaded, and then composer on production will auto-run the declared extensions that were installed locally. Does that make sense? I’m a little confused by it.

1 Flarum extensions aren’t single text files like with Txp, unfortunately.

Offline

#40 2016-04-21 10:02:17

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,909
Website

Re: WebFaction users

Just found this page in the WF forum, and the latest post there (almost exactly 2 years ago) from a WF support dude says use this to install Composer:

cd $HOME
ln -s `which php55` ~/bin/php
export PATH=$HOME/bin:$PATH
curl -sS https://getcomposer.org/installer | php55
echo -e "\n# Composer\nalias composer=\"php55 \$HOME/composer.phar\"" >> $HOME/.bash_profile
source $HOME/.bash_profile

Our server’s setup with php7, so I guess it’s just adjusting for that:

cd $HOME
ln -s `which php7` ~/bin/php
export PATH=$HOME/bin:$PATH
curl -sS https://getcomposer.org/installer | php7
echo -e "\n# Composer\nalias composer=\"php7 \$HOME/composer.phar\"" >> $HOME/.bash_profile
source $HOME/.bash_profile

But problem I seem to have right off the bat is no access to the $HOME directory (I can see it in Transmit). Or does HOME in that case mean to suggest where the app is installed (i.e. /webapp/here)?

Offline

#41 2016-04-21 13:33:23

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,909
Website

Re: WebFaction users

WF says these commands for installing Composer on WF are better, where “$HOME” means home/[wf-user] (and I’m probably the only person in the world who didn’t know that):

$ cd $HOME
$ git clone https://github.com/composer/composer.git
$ wget http://getcomposer.org/composer.phar
$ cd composer
$ php70 ../composer.phar install
$ find ./bin -type f -executable | xargs sed -i 's/env php$/env php70/g'

And indeed they work. I just used them with success.

Last edited by Destry (2016-04-21 20:04:35)

Offline

#42 2016-06-14 09:23:47

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,909
Website

Re: WebFaction users

Any Composer users out there?

When updating installs and extensions running under Composer — e.g. on local dev — you then should be able to just copy the composer.lock and composer.jason files to production, get into the app’s install directory, and run1:

composer install --no-dev --prefer-dist

Which will then update/install core/extension code for you automatically.

But after running the command, I get…

-bash: composer: command not found

Composer was/is installed, as my previous post indicates.

What might be wrong? What should I check?

1 Note about the command, as I’ve been informed in relation to the app in question:

  • install prefers the composer.lock above the composer.json for installing dependencies.
  • --no-dev will not install dependencies defined under require-dev in each package composer.json file (keeping disk space limited)
  • --prefer-dist will try to load a tarball from the version control server, keeping bandwidth and temporary diskspace limited.

UPDATE:
Problem solved. I had installed Composer as a “global” install on WebFaction so I could use it, if necessary, on any webapp I might install in the future, as opposed to a given one now. This means the composer.phar file is located in $HOME (my user root). So, turned out I needed to create an alias to the composer.phar file so that when in a given webapp directory, it knows where to find the file. These two commands were all I needed to run after tunneling in:

echo -e "\n# Composer\nalias composer=\"php70 \$HOME/composer.phar\"" >> $HOME/.bash_profile

source $HOME/.bash_profile

Just make sure you have the right version of php indicated.

Last edited by Destry (2016-06-14 13:12:19)

Offline

#43 2016-06-14 21:47:25

bici
Member
From: vancouver
Registered: 2004-02-24
Posts: 2,075
Website Mastodon

Re: WebFaction users

what are you mainly using composer for?


…. texted postive

Offline

#44 2016-06-14 22:03:49

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,909
Website

Re: WebFaction users

It’s necessary to work with Flarum right now, though it won’t be when their first stable release comes out. But I’m composer.lock(ed) and loaded now for whatever comes my way.

Offline

Board footer

Powered by FluxBB