how to start mailman server in test mode - ruby

I installed mailman server locally(localhost:3000) and run the mailman server using
bundle exec script/mailman_server start.
it access my local 'development' database. But I want to access my 'test' database. Is there any way to do this?? any help would be grateful

The CLI has an environments options so you'd just run:
bundle exec script/mailman_server start --environment=test

Related

Running GUI Testing on bamboo agent as service

There is a way to run CI of GUI testing in bamboo agent as service on windows server?
I don't think it is possible, just run the bamboo agent as a proccess.
I am using puppeteer as libray to run the GUI testing on electron app.
any type of another solution will help :)
If you can achieve running the build via PowerShell or cmd prompt, you may do so with a script task.
For this, you have to make the agent run as a local user as explained in this page. This way, you have the same environment as the local user and the commands to execute your electron app will work successfully.

configure sinatra as a server

I have written an app in ruby using sinatra. the app works fine and I am testing the post/get request using postman.
Right now I start the app using the command rackup but it starts the server locally on the port 9292. using postman, I send the POST on localhost:9292
I would like to test the app when access from another computer. I expect something using POSTMAN sending a POST on http://182.12.34.1:9292 but I didn't find how to do this.
config.ru
load './app/init.rb'
run Sinatra::Application
Procfile
web: bundle exec unicorn -p $PORT -E $RACK_ENV -c ./config/unicorn.rb
Any idea, how to switch from local test to a server ?
Thansks
The easiest way is to use an existing tool like ngrok or localtunnel.
If you have npm installed, then you can do this in a new terminal:
sudo npm install -g localtunnel
lt --port 9292
It will then give you a URL that you can share. Keep in mind these two things:
The URL is only valid as long as the localtunnel process is running
You still need to have your server running on localhost:9292 for it to work.
Did you perhaps listen to localhost only in the config?
You need to bind the host to 0.0.0.0 otherwise it will only only be available locally...

Starting Bitbucket Server in Ansible

I'm using Vagrant and Ansible to create my Bitbucket Server on Ubuntu 15.10. I have the server setup complete and working but I have to manually run the start-webapp.sh script to start the server each time I reprovision the server.
I have the following task in my Bitbucket role in Ansible and when I increase the verbosity I can see that I get a positive response from the server saying it will be running at http://localhost/ but when I go to the URL the server isn't on. If I then SSH in to the server and run the script myself, getting the exact same response after running the script I can see the startup webpage.
- name: Start the Bitbucket Server
become: yes
shell: /bitbucket-server/atlassian-bitbucket-4.7.1/bin/start-webapp.sh
Any advice would be great on how to fix this.
Thanks,
Sam
Probably better to change that to an init script and use the service module to start it. For example, see this role for installing bitbucket...
Otherwise, you're subject to HUP and other issues from running processes under an ephemeral session.

Can't get service to start on chef

I have a service resource but I can't get chef to start it, instead chef just spits out an error message:
SystemCallError: The specified service does not exist as an installed service. - OpenService: The specified service does not exist as an installed service.
I'm not sure what to do to fix this and I can't find anything on this error (could be I'm not looking in the right place).
The service is distributed as a gem that's installed.
The service itself is a Sinatra app that uses the win32-service gem to start it as a service
The platform is windows server (I know but I have no choice, I have to use windows server)
The code in the chef recipe for this service is:
service service_name do
init_command ("#{%x(gem env gemdir).strip.gsub('/','\\')}\\gems\\#{service_name}-#{installing_version}")
start_command "rake service:start"
stop_command "rake service:stop"
reload_command "rake service:reload"
restart_command "rake service:restart"
supports start: true, restart: true, reload: true
action [:enable,:start]
end
The issue is not with Chef, but with your service itself. Typically when I'm in this situation, I will login manually and attempt to start the service. Sometimes that will give you additional information. Also, take a look at the log files for your app and see if you can figure out why it's not starting.
Ultimately, Chef just calls your init and start commands, but it can't do much if those commands fail.

Environment variables with Rackup, Thin, and Oracle

I've written a server using Sinatra that accesses an Oracle database using ActiveRecord (though this is not a Rails app). I wrote it in Sinatra's "classic" style and previously started the server like this:
bundle exec ruby bin/server.rb
I also used require 'thin' and Thin was magically used as the HTTP server. However, I needed to change Thin's default timeout, so I transitioned to a rackup config.ru file. I now start the server like this:
bundle exec thin -C config/thin.yml -R config/config.ru start
However, since doing this I can't connect to the Oracle database with the server. I'm using a service name and the TNS_ADMIN environment variable is set correctly and I can connect with sqlplus or even the same server if not launched using Thin. Launching with Thin, when I try to start the connection I get OCIError - ORA-12154: TNS:could not resolve the connect identifier specified.
What is the right way to set environment variables for servers launched with Thin? The solution here doesn't work because I can't give ruby-oci8 the information, it automatically reads them from the environment.

Resources