Skip to content

Commit 19e0b14

Browse files
authored
chore: [SC-53125] add github PAT setup instructions (#33)
* chore: [SC-53125] add github PAT setup instructions * chore: fix typos, rearrange sections
1 parent f3e5609 commit 19e0b14

1 file changed

Lines changed: 47 additions & 40 deletions

File tree

content/en/process/dev-workstation-setup.md

Lines changed: 47 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,6 @@ This page describes how to setup a Mac OS X workstation to work on Narrative's p
99

1010
## Common System Tools
1111

12-
### git
13-
14-
```shell
15-
brew install git
16-
```
17-
To address vulnerabilities like [this](https://github.blog/open-source/git/git-security-vulnerabilities-announced-6/)
18-
you need to ensure that built-in `/usr/bin/git` **is not being used** neither in CLI nor in any IDE you use to commit changes.
19-
20-
You can catch divergence in CLI.
21-
```shell
22-
git --version
23-
git version 2.50.1
24-
25-
/usr/bin/git --version
26-
git version 2.39.3 (Apple Git-145)
27-
```
28-
And for an IDE, it is necessary to set (or ensure that it was automatically configured) `/opt/homebrew/bin/git` location.
29-
3012
### Xcode
3113

3214
The Apple development tools takes quite a while (1hr) to download and it will be required later in the installation, so make sure you start the download first, then continue the installation instructions while it is downloading.
@@ -309,44 +291,48 @@ Once it is installed,
309291
310292
### Git
311293
312-
[Git](https://git-scm.com/) is a distributed version control system
313-
314-
NOTE: Xcode is required at this step, wait until XCode to run this. If it is not finished, you can run the other steps and come back to this one once it's finished.
294+
We use [Git](https://git-scm.com/) and GitHub.
315295
296+
NOTE: Xcode is required at this step; wait until XCode is installed to run this. If it is not finished, you can run the
297+
other steps and come back to this one once it's finished.
316298
317-
Install
299+
Install:
318300
```bash
319301
sudo xcodebuild -license accept
320302
brew install git
321303
```
322304
323-
Configure
324-
325-
The minimum configuration would look like
305+
The minimum configuration would look like:
326306
327307
```bash
328308
git config --global user.name "Your Name"
329309
git config --global user.email you@narrative.io
330310
```
331311
332-
Generate Github SSH Key
312+
Generate Github SSH Key:
333313
334314
```bash
335315
ssh-keygen
336316
```
337317
338318
Then manually upload `~/.ssh/id_rsa.pub` to [github](http://www.github.com) (Settings -> SSH and GPG Keys)
339319
340-
Install hub
320+
To ensure we can address vulnerabilities like [this](https://github.blog/open-source/git/git-security-vulnerabilities-announced-6/)
321+
in a timely way by running `brew upgrade git`, you need to ensure that built-in `/usr/bin/git` **is not being used**
322+
in any CLI or IDE you use to commit changes.
341323
342-
[Hub](https://hub.github.com/) provides github-related shortcuts
324+
You can check if your CLI is using the right version by running:
343325
344-
```bash
345-
brew install hub
346-
echo 'alias git=hub' > ~/.zshrc.d/hub
347-
source ~/.zshrc.d/hub
326+
```shell
327+
git --version
328+
git version 2.50.1
329+
330+
/usr/bin/git --version
331+
git version 2.39.3 (Apple Git-145)
348332
```
349333
334+
For IDEs, it is necessary to set (or ensure that it was automatically configured) `/opt/homebrew/bin/git` location.
335+
350336
## AWS Tools
351337
352338
### AWS Command-Line Tools
@@ -443,6 +429,35 @@ Install
443429
</base-code-block>
444430
</base-code-group>
445431
432+
#### GitHub Packages Credentials
433+
434+
Our shared build plugin (`common-build`) is published to GitHub Packages. To resolve it locally, you need to create a Personal Access Token (PAT) and configure sbt to use it.
435+
436+
**1. Create a Personal Access Token (PAT)**
437+
438+
Go to [Settings → Developer Settings → Personal Access Tokens](https://github.com/settings/tokens) and create a classic PAT with `read:packages` permissions.
439+
440+
**2. Store the PAT in your keychain**
441+
442+
```bash
443+
read -s TOKEN && echo \
444+
&& security add-generic-password -a $(whoami) -s github_packages_token -w "$TOKEN" -U \
445+
&& unset TOKEN
446+
```
447+
448+
**3. Configure sbt to use the token**
449+
450+
```bash
451+
mkdir -p ~/.sbt/1.0 && cat > ~/.sbt/1.0/github.sbt <<'EOF'
452+
import scala.sys.process._
453+
454+
credentials += {
455+
val cmd = List("security", "find-generic-password", "-s", "github_packages_token", "-w")
456+
val token = cmd.!!.trim
457+
Credentials("GitHub Package Registry", "maven.pkg.github.com", "_", token)
458+
}
459+
EOF
460+
```
446461

447462
### IntelliJ CE
448463

@@ -457,14 +472,6 @@ On first launch:
457472

458473

459474

460-
### Thrift
461-
462-
We use [Thrift](https://thrift.apache.org/) + Parquet as a serialization mechanism for some of the backend jobs.
463-
464-
```bash
465-
brew install thrift
466-
```
467-
468475
## Frontend Application Dev
469476

470477
Each project has its own setup instructions and may require installing additional tools, but this section serves as a general guide to install

0 commit comments

Comments
 (0)