mirror of
https://github.com/outbackdingo/ghorg.git
synced 2026-01-27 10:19:03 +00:00
Add gitlab local setup scripts
This commit is contained in:
8
scripts/local-gitlab/clone.sh
Executable file
8
scripts/local-gitlab/clone.sh
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
BASE_URL="http://gitlab.example.com"
|
||||
TOKEN=${1:-'EVvbmz5qb28ok-rU-zo5'}
|
||||
|
||||
ghorg clone all-groups --scm=gitlab --base-url=${BASE_URL} --token=$TOKEN --preserve-dir --concurrency=25 --output-dir=local-gitlab-v15-repos
|
||||
|
||||
ghorg clone all-groups --scm=gitlab --base-url=${BASE_URL} --token=$TOKEN --concurrency=25 --output-dir=local-gitlab-v15-repos-flat
|
||||
37
scripts/local-gitlab/run.sh
Executable file
37
scripts/local-gitlab/run.sh
Executable file
@@ -0,0 +1,37 @@
|
||||
#! /bin/bash
|
||||
|
||||
# Note: you will need to stop manually
|
||||
# docker stop gitlab
|
||||
# docker rm gitlab
|
||||
# https://docs.gitlab.com/ee/install/docker.html#install-gitlab-using-docker-engine
|
||||
|
||||
# Tags at https://hub.docker.com/r/gitlab/gitlab-ce/tags for CE, EE is only latest
|
||||
|
||||
# make sure 127.0.0.1 gitlab.example.com is added to your /etc/hosts
|
||||
|
||||
export GITLAB_IMAGE_TAG=latest
|
||||
export GITLAB_HOME=$HOME/Desktop/ghorg/local-gitlab-ee-data-$GITLAB_IMAGE_TAG
|
||||
|
||||
docker run \
|
||||
--hostname gitlab.example.com \
|
||||
--publish 443:443 --publish 80:80 --publish 22:22 \
|
||||
--name gitlab \
|
||||
--restart always \
|
||||
--volume $GITLAB_HOME/config:/etc/gitlab \
|
||||
--volume $GITLAB_HOME/logs:/var/log/gitlab \
|
||||
--volume $GITLAB_HOME/data:/var/opt/gitlab \
|
||||
gitlab/gitlab-ee:$GITLAB_IMAGE_TAG
|
||||
|
||||
# Once running get pw with
|
||||
docker exec -it gitlab grep 'Password:' /etc/gitlab/initial_root_password
|
||||
|
||||
# Login at
|
||||
|
||||
# http://gitlab.example.com/users/sign_in
|
||||
# username: root
|
||||
|
||||
# Create an api token
|
||||
# http://gitlab.example.com/-/profile/personal_access_tokens
|
||||
|
||||
# seed new instance using
|
||||
# ./scripts/local-gitlab/seed.sh $TOKEN
|
||||
46
scripts/local-gitlab/seed.sh
Executable file
46
scripts/local-gitlab/seed.sh
Executable file
@@ -0,0 +1,46 @@
|
||||
#! /bin/bash
|
||||
|
||||
# https://docs.gitlab.com/ee/install/docker.html#install-gitlab-using-docker-engine
|
||||
|
||||
TOKEN=${1:-'EVvbmz5qb28ok-rU-zo5'}
|
||||
BASE_URL="http://gitlab.example.com"
|
||||
|
||||
# Create 3 groups, namespace_id will start at 4
|
||||
curl --request POST --header "PRIVATE-TOKEN: $TOKEN" \
|
||||
--header "Content-Type: application/json" \
|
||||
--data '{"path": "group1", "name": "group1" }' \
|
||||
"${BASE_URL}/api/v4/groups"
|
||||
|
||||
curl --request POST --header "PRIVATE-TOKEN: $TOKEN" \
|
||||
--header "Content-Type: application/json" \
|
||||
--data '{"path": "group2", "name": "group2" }' \
|
||||
"${BASE_URL}/api/v4/groups"
|
||||
|
||||
curl --request POST --header "PRIVATE-TOKEN: $TOKEN" \
|
||||
--header "Content-Type: application/json" \
|
||||
--data '{"path": "group3", "name": "group3" }' \
|
||||
"${BASE_URL}/api/v4/groups"
|
||||
|
||||
# create repos for user
|
||||
for ((a=0; a <= 10 ; a++))
|
||||
do
|
||||
curl --header "PRIVATE-TOKEN: $TOKEN" -X POST "${BASE_URL}/api/v4/projects?name=baz${a}&initialize_with_readme"
|
||||
done
|
||||
|
||||
# create repos in group1
|
||||
for ((a=0; a <= 10 ; a++))
|
||||
do
|
||||
curl --header "PRIVATE-TOKEN: $TOKEN" -X POST "${BASE_URL}/api/v4/projects?name=baz${a}&namespace_id=4&initialize_with_readme"
|
||||
done
|
||||
|
||||
# create repos in group2
|
||||
for ((a=0; a <= 10 ; a++))
|
||||
do
|
||||
curl --header "PRIVATE-TOKEN: $TOKEN" -X POST "${BASE_URL}/api/v4/projects?name=baz${a}&namespace_id=5&initialize_with_readme"
|
||||
done
|
||||
|
||||
# create repos in group3
|
||||
for ((a=0; a <= 10 ; a++))
|
||||
do
|
||||
curl --header "PRIVATE-TOKEN: $TOKEN" -X POST "${BASE_URL}/api/v4/projects?name=baz${a}&namespace_id=6&initialize_with_readme"
|
||||
done
|
||||
Reference in New Issue
Block a user