Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow modification of username, psw and trigger time for gitlab #11

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ suites:
tests:
- seventh
triggers:
- timed: '@daily'
- timed: '0 0 * * *'

use_artifacts: false
use_artifacts_from:
Expand Down Expand Up @@ -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 }}:\
Expand Down
16 changes: 8 additions & 8 deletions tasks/gitlab.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -424,7 +424,7 @@
body_format: form-urlencoded
body:
- [description, '{{ project }}-daily']
- [cron, "0 16 * * *"]
- [cron, '{{ triggers[0].timed }}']
- [ref, master]
status_code:
- 201
Expand Down Expand Up @@ -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
Expand Down