I have the following .gitlab-ci.yml
file:
stages:
- pull
- optimize
variables:
GIT_SSL_NO_VERIFY: "1"
before_script:
- git config --global http.sslVerify false
- git config --global credential.helper store
- echo "https://${CI_REPOSITORY_USER}:${CI_REPOSITORY_PASSWORD}@gitlab.com" > ~/.git-credentials
pull_job:
stage: pull
script:
- echo "Pulling the project on the server through git"
- git pull origin master
only:
- master
It works well. Now I need to execute one more command after pulling to clear the cache:
php artisan optimize
So, I add this at the end of file above:
optimize_job:
stage: optimize
script:
- echo "Clearing the cache by optimize command.."
- php artisan optimize
It throws:
.gitlab-ci.yml returns /usr/bin/bash: line 156: php: command not found error
Any idea how can I fix it?