From 9ab6003fbfd92ffdd83679be9fab417949912577 Mon Sep 17 00:00:00 2001 From: Ougherb Mohammed Walid <67202540+Omwalid@users.noreply.github.com> Date: Mon, 23 May 2022 17:08:51 +0200 Subject: [PATCH 1/2] Update gitlab.yml --- tasks/gitlab.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tasks/gitlab.yml b/tasks/gitlab.yml index cb7489d..b01dc24 100644 --- a/tasks/gitlab.yml +++ b/tasks/gitlab.yml @@ -153,8 +153,8 @@ - use_kubernetes - name: Setting gitlab_clone_url set_fact: - gitlab_clone_url: 'http://xtesting:xtesting@gitlab.{{ - external_ipaddress }}.nip.io:{{ gitlab_port }}/xtesting/{{ + gitlab_clone_url: 'http://{{ gitlab_user }}:{{ gitlab_password }}@gitlab.{{ + external_ipaddress }}.nip.io:{{ gitlab_port }}/{{ gitlab_user }}/{{ project }}.git' when: - gitlab_deploy @@ -283,7 +283,7 @@ - gitlab_configure - name: Checking if GitLab user is already created uri: - url: '{{ gitlab_url }}/api/v4/users?username=xtesting&access_token={{ + url: '{{ gitlab_url }}/api/v4/users?username={{ gitlab_user }}&access_token={{ oauth.json.access_token }}' status_code: - 200 @@ -301,8 +301,8 @@ url: '{{ gitlab_url }}/api/v4/users?access_token={{ oauth.json.access_token }}' method: POST - body: "email={{ gitlab_user_mail }}&username=xtesting&name=xtesting&\ - password=xtesting&skip_confirmation=true" + body: "email={{ gitlab_user_mail }}&username={{ gitlab_user }}&name={{ gitlab_user }}&\ + password={{ gitlab_user }}&skip_confirmation=true" status_code: - 201 register: http_response @@ -319,7 +319,7 @@ uri: url: '{{ gitlab_url }}/oauth/token' method: POST - body: "grant_type=password&username=xtesting&password=xtesting" + body: "grant_type=password&username={{ gitlab_user }}&password={{ gitlab_password }}" status_code: - 200 register: oauth @@ -424,7 +424,7 @@ body_format: form-urlencoded body: - [description, '{{ project }}-daily'] - - [cron, "0 16 * * *"] + - [cron, '{{ triggers[0].timed }}'] - [ref, master] status_code: - 201 @@ -452,7 +452,7 @@ scope: local repo: '{{ tmp_dir }}/{{ project }}' name: user.name - value: xtesting + value: "{{ gitlab_user }}" when: - gitlab_configure - name: Adding scripts/chained-ci-tools as git submodule From 6a6f884389e0c5923ae8fcc5dfdb8d06d088e6bf Mon Sep 17 00:00:00 2001 From: Ougherb Mohammed Walid <67202540+Omwalid@users.noreply.github.com> Date: Mon, 23 May 2022 17:10:59 +0200 Subject: [PATCH 2/2] Update main.yml --- defaults/main.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index c580d0e..2c338db 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -45,7 +45,7 @@ suites: tests: - seventh triggers: - - timed: '@daily' + - timed: '0 0 * * *' use_artifacts: false use_artifacts_from: @@ -162,6 +162,8 @@ gitlab_deploy: false gitlab_port: 80 gitlab_shell_port: 32022 gitlab_url: http://{{ ipaddress }}:{{ gitlab_port }} +gitlab_user: xtesting +gitlab_password: xtesting gitlab_configure: "{{ gitlab_deploy }}" gitlab_create_jobs: "{{ gitlab_configure }}" gitlab_clone_url: "http://xtesting:xtesting@{{ ipaddress }}:\