Search code examples
deploymentenvironmentstaging

Staging Environment best practices


I'm setting up a staging environment for my laravel application because I want to see how my changes would behave live before going into production.

Setting up the env. is fine, since I'm using bitbucket and dploy, which makes the workflow very smooth.

My questions are about the domain setup. Should I create a subdomain staging.mydomain.com to test it? Should I limit the staging version's access somehow or should I make it public but with an unpublished url?

Any other tips on creating this environment?

It's my first application.. any help would be welcome.


Solution

  • If you need to test Facebook integration, for instance, it's better to have a subdomain (instead of your domain in two ports, i.e., http://www.domain.com:8080 would clash Facebook app with http://www.domain.com, there is NO way of having separate FB applications just by changing port, but if you have http://test.domain.com that can be another app in FB).

    Also, if you rely on encrypted stuff eventually, you will on the other hand have to use the same domain for staging and testing, since those commercial libs are usually issued with a key which uses the domain of the application (e.g. you licensed the lib for http://www.domain.com and it will not work on http://test.domain.com). SSL certificates have the same issue.

    You must have a robots.txt hiding your staging don't forget! And if you want to issue some basic http authentication that's your decision too :)