Rewrite VVV Instructions
tomjn opened this issue ยท 17 comments
Describe the bug
The Wiki describes install instructions for VVV, but these are manual instructions that would need to be redone on every new VM, and don't use the official way to install things
Expected behavior
Instructions on how to add a utility to config/config.yml
that installs wordmove
https://varyingvagrantvagrants.org/docs/en-US/utilities/
Literally just create a repo, put a wordmove/provision.sh
in it, fill it with the code snippet from the wiki, then tell users to add it to their config/config.yml
Ref: https://github.com/welaika/wordmove/wiki/Getting-Wordmove-installed-in-VVV-(or-any-Vagrant)
Also VVV doesn't include anymore ruby
Hello there,
I'm absolutely not able to document anything about VVV. Labeling as help wanted and the wiki should be editable by everyone so I hope some VVV user will take over on this one :)
Thanks for reporting.
This will require some development steps to complete, a utility needs to be created that installs/updates wordmove
, aka a git repo with a wordmove/provision.sh
file. Put the code snippet that's in the existing doc in there
Ok, since, as far as I understand, supporting the (new?) official way of installing things is a matter of setup an ad hoc project, this is out of the scope of Wordmove itself.
I've updated the documentation present on this wiki with a big deprecation warning and a reference to this issue in order to bring interested users on the additional info.
With this info added, I consider the bug in our documentation solved.
Cheers
@pioneerskies we came here because one of your users wanted help understanding your docs, we noticed it was advising what it should say.
Ok, since, as far as I understand, supporting the (new?) official way of installing things is a matter of setup an ad hoc project, this is out of the scope of Wordmove itself.
This is not true. I think there has been a misunderstanding. The tool isn't installed on a per site basis, I'm not sure why the docs ever suggested it be added to a single site provisioner in the first place. VVV just needs a single script to install it system-wide. That script has already been written and put in the exisitng wiki docs
VVV needs a git repo containing a folder with a provision.sh
to checkout that it can run. This could be a dedicated repo, it could even be this repo. A .vvv
subfolder of this repo would suffice, or even a provision.sh
in the bin
folder. This is intended for system wide installation.
As for what goes in provision.sh
, @joeguilmette wrote it in a code block in the wiki 5 years ago:
# Rubygems update
if [ $(gem -v|grep '^2.') ]; then
echo "gem installed"
else
apt-get install -y ruby-dev
echo "ruby-dev installed"
echo "gem not installed"
gem install rubygems-update
update_rubygems
fi
# wordmove install
wordmove_install="$(gem list wordmove -i)"
if [ "$wordmove_install" = true ]; then
echo "wordmove installed"
else
echo "wordmove not installed"
gem install wordmove
wordmove_path="$(gem which wordmove | sed -s 's/.rb/\/deployer\/base.rb/')"
if [ "$(grep yaml $wordmove_path)" ]; then
echo "can require yaml"
else
echo "can't require yaml"
echo "set require yaml"
sed -i "7i require\ \'yaml\'" $wordmove_path
echo "can require yaml"
fi
fi
@pioneerskies I've created a PR that basically does what we suggested should be done, it was a simple copy pasta.
I don't mind if you don't intend to personally support VVV, but you have 2 VVV core developers here offering help for something super low hanging that once implemented is completely finished and resolved.
something super low hanging that once implemented is completely finished and resolved.
This is the real misunderstanding in my honest opinion.
I don't mind if you don't intend to personally support VVV
And this is a hasty assumption.
I can't get how you are envisioning the ecosystem. My doubt as mainteiner - not as supporter, nor user, nor developer - is why a command line utility should take on its shoulders and in its repository the configuration needed to be installed inside a specific environment.
For example I also maintain the wordmove's docker image, but I manage the configurations needed to install Wordmove into Alpine Linux in a separated, standalone repository.
Wordmove exposes itself to the public through rubygems.org and as Wordmove's maintainer I've the responsibility to publish the gem there in order to make it easilly installable everywhere.
That said every environment has its own caveats, dependencies, gotchas. I cannot takeover as the maintainer of every configuration script out there. Not because I'm not supporting all those cool OSS projects, but simply because supporting does not mean necessarily to publish and maintain the code needed to install this piece of software into another one.
It's not in my mindset to bind me and future maintainers of Wordmove to the need to know what that script is doing, just like I do with docker images. And to be more subjective, I don't want the responsibility to maintain something that I can't understand, thus on which I cannot give support to final users, just because when i wrote it it was just a simple copy paste.
I can't see how the transition from a user-contributed wiki page to a hosted config script could appear so natural.
I hope to have spotted out my point of view more clearly.
That said:
- I am and will always be glad to support VVV as I've always done in my niche - you can find 51 issues in searching for
vvv
in our tracker and I've always tried to help on those, even if I've never been a VVV user - I honestly think that the coolest way to manage your "Utilities" would be to have a dedicated repository under the vvv organization, accepting PR and providing a space for community contributed "integrations". Just my 2 cents: obviously I'm giving advices with out knowing all the ecosystem
- if you think that it could be useful for whatever reason to spread out the utilities and having them hosted from "official" oganizations, I'd be glad to open a new repository. On that repository I could invite collaborators or I could write a discalimer about the specific maintenence policy
- if you think that I could do something in Wordmove to make it more easilly installable into VVV, I'd be glad to take the tour (just e.g.:
sed -i "7i require\ \'yaml\'" $wordmove_path
is injecting code into the source code...wtf?! I can't imagine why, but that's awkward!) - if you think it could be useful for VVV, I'd be glad to endorse it or specifically the new-coming wordmove utility's repository in the main README of this project
Let me know if something fits with your intent and to propose other matters of discussion.
Cheers
I honestly think that the coolest way to manage your "Utilities" would be to have a dedicated repository under the vvv organization, accepting PR and providing a space for community contributed "integrations". Just my 2 cents: obviously I'm giving advices with out knowing all the ecosystem
We've recently started discussing this, ironically the biggest obstacle is naming. We don't want to imply we're supporting anything and everything or choosing favourites, or that we maintain it ourselves
if you think that it could be useful for whatever reason to spread out the utilities and having them hosted from "official" oganizations, I'd be glad to open a new repository. On that repository I could invite collaborators or I could write a discalimer about the specific maintenence policy
hmmm can you ellaborate? Do you mean registering a wordmove
github org? Or is this something like having a vvv-wordmove
repo on the VVV org with a disclaimer?
if you think that I could do something in Wordmove to make it more easilly installable into VVV, I'd be glad to take the tour (just e.g.: sed -i "7i require\ 'yaml'" $wordmove_path is injecting code into the source code...wtf?! I can't imagine why, but that's awkward!)
I did wonder why it did this ๐ค I wonder if this is necessary, I just ported the instructions from the wiki
For understanding what it needs to do, it's just a bash script that installs wordmove on an ubuntu/debian type system. E.g. it would work on my Digital Ocean VPS the same. The only VVV specific part is changing the config and knowing how to acquire it which is sorted already.
I do have some questions though:
- Currently it only looks for
provision.sh
but would it be better if it wereinstall
orinstall.sh
? That might make sense with yourbin
folder files for consistency, it just means we tell people to use the newest VVV which I don't mind - I had an idea of adding a
gems
section to the VVV config file, but I don't know a huge amount about how gem distribution works, would that be feasible to just list gems and includewordmove
in the list? Or is that too simplistic with ruby versions? Does it need a rake/bundler file? If that works then that would be a great simplifier for all involved
If once all of this is done you put a disclaimer saying something like Last known to work at X/Y/2020, mileage may vary, I'd understand :)
We don't want to imply we're supporting anything and everything or choosing favourites, or that we maintain it ourselves
Yeah, I know that feel; and that's why I think that should be evident that it would be an index of community contributed utilities.
For the same sake I said
On that repository I could invite collaborators or I could write a discalimer about the specific maintenence policy
what I meant to say was more or less what you sentenced:
If once all of this is done you put a disclaimer saying something like Last known to work at X/Y/2020, mileage may vary, I'd understand :)
I'd write the disclaimer in a friendly manner, encouraging people to require an access as contributor and promoting the research of a maintainer. At the same time I have for sure to say that I cannot guarantee any maintenence on the script by myself or by my organization.
The repositoy would be welaika/vvv-wordmove
.
Reading what you said
t's just a bash script that installs wordmove on an ubuntu/debian type system. E.g. it would work on my Digital Ocean VPS the same
I'd like to give my personal one-time contribution updating the script we have in out wiki with a more modern and savvy - or simpler at least - approach. In order to do that I'd like to ask you some informations:
- what operative system does VVV ships with?
- is SSH already installed by default? - I bet on yes
- is LFTP already installed by default? - obviously no! I can imagine ;)
- is WP-CLI already installed by default? - I bet on yes
- is RSYNC already installed by default? - I bet on yes
- do you confirm that ruby is not installed by default?
Replying to you questions:
Currently it only looks for provision.sh but would it be better if it were install or install.sh? That might make sense with your bin folder files for consistency, it just means we tell people to use the newest VVV which I don't mind
Having a standalone repo we can strictly adhere to the standard, so wordmove/provision.sh
will be just ok.
I had an idea of adding a gems section to the VVV config file, but I don't know a huge amount about how gem distribution works, would that be feasible to just list gems and include wordmove in the list? Or is that too simplistic with ruby versions? Does it need a rake/bundler file? If that works then that would be a great simplifier for all involved
I don't know if you have to deal with different gems; if the implementation should be just for wordmove, I think you should delegate all the responsibilities to the utility. Moreover Wordmove has peer - I mean external - dependencies: lftp
, ssh
, wp-cli
, bla bla bla so installing it is a matter of gem install wordmove
, but you need a prepared environment in order to use specific protocols and options...all wordmove stuff you should ignore.
Installing a single gem does not require to have rake nor bundler. The gem self-contain all the ruby dependencies it needs and download it through rubygems, just like an npm module would do.
One fact is that Wordmove actually supports ruby >=2.6 and the utility has to be sure to install a supported version.
Well, that's all I think.
I'm looking forward to hear back some info from you ;)
Thanks in advance
what operative system does VVV ships with?
Ubuntu 18.04 Bionic LTS, at some point in the future we'd switch to 20 LTS but an Ubuntu-Debian type system is a safe assumption
is SSH already installed by default? - I bet on yes
I believe so
is LFTP already installed by default? - obviously no! I can imagine ;)
No, but it can be, Varying-Vagrant-Vagrants/VVV#2137
is WP-CLI already installed by default? - I bet on yes
Yes!
is RSYNC already installed by default? - I bet on yes
Yes!
do you confirm that ruby is not installed by default?
It isn't installed by default:
vagrant@vvv:~$ ruby --version
Command 'ruby' not found, but can be installed with:
snap install ruby # version 2.7.1, or
apt install ruby
See 'snap info ruby' for additional versions.
vagrant@vvv:~$
Moreover Wordmove has peer - I mean external - dependencies: lftp, ssh, wp-cli, bla bla bla so installing it is a matter of gem install wordmove, but you need a prepared environment in order to use specific protocols and options...all wordmove stuff you should ignore.
Installing a single gem does not require to have rake nor bundler. The gem self-contain all the ruby dependencies it needs and download it through rubygems, just like an npm module would do.
That's very good to know, in which case the packages feature might be the best path forward for all there :D ( Varying-Vagrant-Vagrants/VVV#2135 ) I don't think we'd have come upon that as a possible solution without your help
Some notes:
- Installing
ruby
viaapt
will only get us up to v2.5,sudo snap install ruby --classic
will installruby 2.7.1p83
- Provisioners run as root, what's the advice on running
gem install
as root? Should we run it as the normalvagrant
user instead?
hey @tomjn ,
I've been a bit burned out by job; I've not forgot this task, but I'll probably take a "free" weekend. Thanks for your replies in the meantime ๐
Hey, better later than never: https://github.com/welaika/vvv-wordmove :)
Let me know if it sounds good. I've also added a note on the wiki page.
At the moment the provisioner 100% reflects the one in the PR
I will test it monday :-D
I consider it tested and updated, so I'm going to close this one :)
I'll always be happy to help where/when I can. Thanks for support and best luck.
Yes, in case we can do a pr to the provisioner if needed :-)