Non-interactive Rake task "db:initial_setup" - rake

I'm trying to automate the installation of canvas LMS which requires the execution of
bundle exec rake db:initial_setup
which asks for an admin email and password interactively
How do I pass those values in a non-interactive way?

It should be done by setting the following environmental variables :
CANVAS_LMS_ADMIN_EMAIL
CANVAS_LMS_ADMIN_PASSWORD
CANVAS_LMS_STATS_COLLECTION
CANVAS_LMS_ACCOUNT_NAME

I realize it's a late addition, but to clarify Eslam's answer, the details you're seeking are on the Production Start page under the Database Population heading.

Related

zlogin usage in Runeck task

As part of rundeck task i'm trying to login to a global zone, use the command zoneadm list and trying to login to each of the local zone [to shut down various apps & to issue reboot] using the command /usr/sbin/zlogin and execute hostname command to ensure it did login to localzone
however this is not working
Is there a better way to do this? Please guide
Make sure that your job is dispatching to your remote node correctly, you can call the command on "Commands" (right panel) pointing to your node (referenced in the "Nodes" textbox) in that way you can discard possible path/user rights issue, take a look at this. Now, zlogin seems an interactive shell, and as you can see, you need to use it in the non-interactive mode.

Is it possible to know the username executing a cap task to use it from inside Capfile?

Do you know if it's possible to access the username running the 'cap deploy' task to use it from a cap task in the Capfile?
For example, we need to mark a deploy in newrelic after doing a deploy, so I added a task "mark_deploy" in the capfile that does the work. The problem is that it will be nice to register the user running the 'cap deploy', but for that I need to know the username at the time the "mark" task is invoked.
Thanks in advance!
It's solved, I discovered that there is a global variable in Capistrano that you can use just for this:
#{local_user}
Thanks for the help!

Force capistrano to ask for password immediately

I have a cap script that performs some lengthy compilation steps before running any remote code. I would like to be able to walk away while all this is happening, but as soon as the compilation is finished it will ask me for the remote server password. Is there a way I can force the script to ask for the password immediately, so that I can leave the rest to run unattended?
I know that I can set up passwordless ssh to avoid the password prompt entirely, but I am looking for a method that will allow unattended deploys for users that don't have passwordless ssh set up yet.
I feel like I have seen a simple solution for this somewhere, but I am having trouble finding the correct search terms.
If you're running most commands via sudo (that is, you have set :use_sudo, true) you can probably do this by hooking before "deploy", "ask_for_password", and create a task "ask_for_password" and immediately using it to perform any command with sudo, such as sudo date. Sudo will prompt the first time only, then presumably has a long enough timeout to get through the deploy.
If that doesn't work...
...we're talking about capistrano -- ain't nothin' simple with capistrano. It's an incredibly powerful tool, and I don't know anyone who finds it "simple".
Instead of setting up everyone to be able to deploy, maybe set up a host that you can let people ssh into as a user like "deployer", then have that execute the deploys.
But deploying is a pretty significant task -- not everyone should be able to do it, especially to production. I think you're better off installing passwordless public keys of users having authority to deploy on servers they are permitted to deploy to (e.g. more to test than to staging, or production).

Hiding few steps in an already existing installer

Is there a way to hide few steps during an installation of an already existing installer? Like, hide the steps for the inputting of username or password? I want to hide these steps during the installation and run a batch file or script to set the default username or password instead.
Is there a possible way for this? How can I do this?
For example, installing postgreSQL, I'd like to hide the steps/windows for the username/password input, and run a batch file to set the username and password.
PS: I am not the author of the installer, I just want to modify it that way, if it is possible.
Thanks.
I already found an answer for my problem. It is performing an unattended installation where a user interaction is not needed anymore. Installation can be done in the command line where parameters can just be added (a config file can also be used for these parameters).
See the following links:
http://www.enterprisedb.com/docs/en/8.4/instguide/Postgres_Plus_Advanced_Server_Installation_Guide-15.htm#P889_74430
For command line options reference:
http://www.enterprisedb.com/docs/en/8.4/instguide/Postgres_Plus_Advanced_Server_Installation_Guide-17.htm#P1062_89370
Although this installation process only displays a progress bar, my problem is already solved since no user interaction is already needed. :)
I don't think it is possible to just hide particular one step from installer. Moreover AFAIK One Click Installer is only closed source, so you can't change its behaviour. However there are two alternative ways:
show visually that step, but with other default values, so user can simply click next
run installer in non-interactive mode (--mode unattended)
First of all check available options with Installation Guide and:
cmd>postgresql-9.0.4-1-windows_x64.exe --help
For example you can adjust --superaccount MyCustomizedUser --superpassword 12345 with such result (default is postgres and blank password):

Set a script to run on a schedule?

How can I set a PHP script to run on a schedule? I don't have full control over the server as I am using a hosting company, I have a PLESK administration for the hosting though.
Thanks
I believe PLESK has a crontab area underneath each domain.
Alternatively, if you have shell access, here's a good tutorial on editing your crontab from the command-line.
crontab. video tutorial here:
http://www.webhostingresourcekit.com/flash/plesk-8-linux/plesk8linux_crontab.html
What you're looking for is called a cron job: an automated task that can execute a http request on your server.
Since you're hosted, it's impossible to manually set up a cron job to run. However, many web hosts offer online tools for creating cron jobs through their control panel (cpanel, plesk, etc).
If that isn't an option, there are some paid and SOME free cron services you might be able to find if you poke around long enough.