Closed moylop260 closed 6 years ago
@ruiztulio Any help is welcome here
@moylop260 As for the TRAVIS_BRANCH
there is a CI_COMMIT_REF_NAME
, it stores the branch name.
To know if you are in a branch we could do one of these two:
TRAVIS_PULL_REQUEST
) using only or exceptMaybe there are other options, but in the documentation there is not a variable specific to know if we are in a MR
As mentioned in this Gitlab issue, there are no available variable to access merge request information.
So, I think our best guess is to use something like @ruiztulio 's idea:
CI_COMMIT_REF_NAME != VERSION
I'd like to know:
travis_run_tests
or travis_install_nightly
, or should it be on a separate script, something like travis_init_env
?We have 2 options:
@moylop260 I think is better to use the MQT script because in this way we'll have it available in all repos instead of changing all the ci files
Travis set the following environment variables
TRAVIS_PULL_REQUEST - The pull request number if the current job is a pull request, “false” if it’s not a pull request.
TRAVIS_BRANCH - this is the name of the branch targeted by the pull request. E.g. 11.0
Gitlab works a little different and then these checks are not emitted.
Differences between gitlab and github:
If there is a PR from vauxoo-dev:11.0-devx-moy to vauxoo:11.0 the repository cloned is:
git clone vauxoo
and in order to get the PR commits uses therefs
defined by github:git fetch -p origin +refs/pull/*/head:refs/pull/origin/*
after that creates a checkout topull/origin/${TRAVIS_PULL_REQUEST}
gitlab creates the pipeline before to create a MR then I think that the remote of the target repository is not defined yet and is not cloned the target repo. (I think so...)
Then maybe we will need to define a environment variable (or use one defined from gitlab) in order to add the remote to target branch. Same case for the target branch.