Commit 53697ee1 authored by Henrik Skov Midtiby's avatar Henrik Skov Midtiby

Now the basic functionality seems to be in place.

parent e7a8b5d6
Pipeline #6419 canceled with stages
......@@ -22,7 +22,8 @@ def create_a_new_repository(repo_name):
headers={'Authorization': 'Bearer {}'.format(config.PersonalAcessToken)})
def create_a_new_repository_in_group(repo_name, group_id):
return requests.post(gitlab_url_api4('/projects?name=%s' % repo_name),
return requests.post(gitlab_url_api4('/projects?name=%s&namespace_id=%d' %
(repo_name, group_id)),
headers={'Authorization': 'Bearer {}'.format(config.PersonalAcessToken)})
def add_user_to_project(project_id, user_id):
......@@ -74,9 +75,10 @@ def push_git_repository_content_to_project_example():
def create_assignment_project(
project_name,
student_id,
group_id,
path_to_git_repository):
print("create_a_new_repository_example")
resp = create_a_new_repository(project_name)
resp = create_a_new_repository_in_group(project_name, group_id)
print(resp)
#pprint.pprint(resp.json())
assert(resp.status_code == 201)
......@@ -96,9 +98,22 @@ def create_assignment_project(
def create_assignment_project_example():
create_assignment_project(
project_name='hw01-henrikmidtiby4',
student_id=646,
student_id=646, # henrikmidtiby@gmail.com
group_id=715, # sdu-uas-center/gitlab-experiments
path_to_git_repository='hw01')
def create_a_new_repository_in_group_example():
print("create_a_new_repository_in_group_example")
resp = create_a_new_repository_in_group('hw01-henrikmidtiby5', 453)
print(resp)
pprint.pprint(resp.json())
def create_a_new_repository_in_group_example_two():
print("create_a_new_repository_in_group_example")
resp = create_a_new_repository_in_group('hw01-henrikmidtiby6', 715)
print(resp)
pprint.pprint(resp.json())
# fetch_and_show_commits_example()
......@@ -108,4 +123,9 @@ def create_assignment_project_example():
# add_user_to_project_example()
# push_git_repository_content_to_project_example()
create_assignment_project_example()
# create_a_new_repository_in_group_example()
# create_a_new_repository_in_group_example_two()
# SDU UAS Center - group_id = 453
# gitlab-experiments - group_id = 715
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment