fix: missing branch name to gitlab job

This commit is contained in:
Pierre Mavro
2020-11-03 00:55:26 +01:00
committed by Pierre Mavro
parent e188459d66
commit 0512d2e202
3 changed files with 4 additions and 2 deletions

View File

@@ -32,6 +32,7 @@ jobs:
run: |
branch=$(echo ${{github.ref}} | sed -r 's/.+\/(.+)/\1/')
echo "Branch name: $branch"
export GITHUB_BRANCH=$branch
gh_json=$(curl -s -H "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/Qovery/engine/pulls?state=open")
gh_pr=$(echo $gh_json | jq --compact-output '.[] | {labels, ref: .head.ref}' | awk "/$branch/")
echo "Pull request info: $(echo $gh_pr)"

View File

@@ -21,10 +21,11 @@ function run_tests() {
test -z $GITLAB_PROJECT_ID && variable_not_found "GITLAB_PROJECT_ID"
test -z $GITLAB_TOKEN && variable_not_found "GITLAB_TOKEN"
test -z $GITLAB_PERSONAL_TOKEN && variable_not_found "GITLAB_PERSONAL_TOKEN"
test -z $GITHUB_BRANCH && variable_not_found "GITHUB_BRANCH"
GITLAB_REF="dev"
echo "Requesting Gitlab pipeline"
pipeline_id=$(curl -s -X POST -F "token=$GITLAB_TOKEN" -F "ref=$GITLAB_REF" -F "variables[GITHUB_ENGINE_BRANCH_NAME]=$(echo $GITHUB_CONTEXT | jq --raw-output '.ref')" -F "variables[TESTS_TYPE]=$TESTS_TYPE" https://gitlab.com/api/v4/projects/$GITLAB_PROJECT_ID/trigger/pipeline | jq --raw-output '.id')
pipeline_id=$(curl -s -X POST -F "token=$GITLAB_TOKEN" -F "ref=$GITLAB_REF" -F "variables[GITHUB_ENGINE_BRANCH_NAME]=$GITHUB_BRANCH" -F "variables[TESTS_TYPE]=$TESTS_TYPE" https://gitlab.com/api/v4/projects/$GITLAB_PROJECT_ID/trigger/pipeline | jq --raw-output '.id')
if [ $(echo $pipeline_id | egrep -c '^[0-9]+$') -eq 0 ] ; then
echo "Pipeline ID is not correct, we expected a number and got: $pipeline_id"
exit 1

View File

@@ -487,7 +487,7 @@ impl Create for Router {
let listeners_helper = ListenersHelper::new(&self.listeners);
// Todo: inform the client about the fact we're going to check for a certain amount of time
let check_result = retry::retry(Fixed::from_millis(3000).take(100), || {
let check_result = retry::retry(Fixed::from_millis(3000).take(200), || {
let rs_ips = lookup_host(self.default_domain.as_str());
match rs_ips {
Ok(ips) => {