Skip to content

Commit

Permalink
Merge pull request #1536 from StatCan/gitlab-docs
Browse files Browse the repository at this point in the history
chore: update gitlab documentation
  • Loading branch information
Jose-Matsuda authored Feb 6, 2023
2 parents e95d7d7 + 3fd97a9 commit c55115f
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
35 changes: 35 additions & 0 deletions docs/en/6-Gitlab/Gitlab.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
![image](https://user-images.githubusercontent.com/23174198/217059855-1ea17aba-d722-467e-96f4-0a37eda3f035.png)

Thankfully, using the cloud main gitlab on the AAW is just like how you would regularly use git.

### Step 1: Locate the Git repo you want to clone and copy the clone with HTTPS option
If your repository is private, you will need to also do Step 4 (Creating a Personal Access Token) for this to go through.
For me this was a test repo
![image](https://user-images.githubusercontent.com/23174198/217060353-ba229ced-b5c1-4eae-8878-9608835cc65f.png)

### Step 2: Paste the copied link into one of your workspace servers
![image](https://user-images.githubusercontent.com/23174198/217060697-535df6c1-d9bb-4bc3-a42b-9f085a5386d5.png)

### Step 3: Success!
As seen in the above screenshot I have cloned the repo!

### Step 4: Create a Personal Access Token for pushing (also used if pulling from a private repository)
If you try to `git push ....` you will encounter an error eventually leading you to the [gitlab help documentation](https://gitlab.k8s.cloud.statcan.ca/help/user/profile/account/two_factor_authentication.md#error-http-basic-access-denied-the-provided-password-or-token-)

You will need to make a Personal Access Token for this. To achieve this go in gitlab, click your profile icon and then hit `Preferences` and then `Access Tokens`
![image](https://user-images.githubusercontent.com/23174198/217061060-122dded8-dc80-46ce-a907-a85913cf5dd7.png)
Follow the prompts entering the name, the token expiration date and granting the token permissions (I granted `write_repository`)

### Step 5: Personalize `Git` to be you
Run `git config user.email ....` and `git config user.name ...` to match your gitlab identity.

### Step 6: Supply the Generated Token when asked for your password
The token will by copy-able at the top once you hit `Create personal access token` at the bottom
![image](https://user-images.githubusercontent.com/23174198/217062846-03a715f1-ded5-4d80-ad4b-c647ae5e30fd.png)

Once you have prepared everything it's time
![image](https://user-images.githubusercontent.com/23174198/217063198-c1bd6c3a-ebc5-444d-98ba-24ef32faa20e.png)

### Step 7: See the results of your hard work in gitlab
![image](https://user-images.githubusercontent.com/23174198/217063990-efaa8e81-a0eb-4b6d-842e-2ca3112bb4f7.png)

2 changes: 2 additions & 0 deletions mkdocs-en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,6 @@ nav:
- Overview: 5-Storage/Overview.md
- Disks: 5-Storage/Disks.md
- MinIO: 5-Storage/MinIO.md
- Gitlab:
- Gitlab: 6-Gitlab/Gitlab.md
- Help/Contact: Help.md

0 comments on commit c55115f

Please sign in to comment.