[solved]Possible to have different before_scripts for different stages?

continuing along with my previous thread where I am trying to setup Gitlab CI tests for a WordPress based project, I have all the basic configurations figured out now.

I am now stuck with a problem where I want to use different versions of WordPress on same PHP version.

For eg. I want to use PHP5.6 with multiple versions of WordPress, I cannot seem to do so.

In Travis CI you can set enviornment variables which can be used in the build script

I am not able to figure how would you do this in gitlab.c.yml.

Here is my gitlab.ci.yml file.

Any help would be appreciated.

After some debugging, I seemed to have fixed this as well.