@@ -14,6 +14,9 @@ jit-customer-scripts/
1414├── src/
1515│ └── scripts/
1616│ └── create_teams.py
17+ | └── self-hosted-runners
18+ │ └── setup-self-hosted-runner-centos.sh
19+ │ └── ...
1720├── src/
1821│ └── utils/
1922│ └── github_topic_to_json_file.py
@@ -35,6 +38,21 @@ jit-customer-scripts/
3538
3639- Python 3.x
3740- Git
41+ - make
42+
43+ To make sure you have all you can run this command:
44+
45+ #### Centos
46+
47+ ``` shell
48+ sudo yum install -y git make && git clone https://github.com/jitsecurity/jit-customer-scripts.git && cd jit-customer-scripts
49+ ```
50+
51+ #### Ubuntu
52+
53+ ``` shell
54+ sudo apt install -y git make && git clone https://github.com/jitsecurity/jit-customer-scripts.git && cd jit-customer-scripts
55+ ```
3856
3957## Generating API Keys
4058
@@ -85,6 +103,8 @@ Before running the script, you need to configure the necessary environment varia
85103
86104## Usage
87105
106+ ### Creating Teams from Github Topics
107+
88108To run the script and create teams and update assets, use the following command:
89109
90110``` shell
@@ -102,9 +122,10 @@ python src/scripts/create_teams.py teams.json
102122This command will fetch the repository names and topics from the GitHub API and generate the JSON file. And then it will
103123create the teams and update the assets.
104124
105- > We recommend using something like Github Actions and Github secrets to run this script on a schedule to make sure you are always synced.
125+ > We recommend using something like Github Actions and Github secrets to run this script on a schedule to make sure you
126+ > are always synced.
106127
107- ### Using External JSON File
128+ #### Using External JSON File
108129
109130You can also provide a JSON file containing team details using a command line argument directly. The JSON file should
110131have the following structure:
@@ -154,7 +175,7 @@ python scripts/create_teams.py path/to/teams.json
154175
155176Replace ` path/to/teams.json ` with the actual path to your JSON file.
156177
157- ## Excluding Topics
178+ #### Excluding Topics
158179
159180You can exclude certain topics from being considered when creating teams. \
160181To exclude topics, you could add them in the ` make configure ` command or update this env var in
@@ -166,7 +187,24 @@ For example, to exclude topics that contain the word "test", you can set the var
166187
167188This will exclude topics with names like "test", "test123", and "abc-testing".
168189
169- ## Development
190+ #### Development
170191
171192To override Jit's API endpoint, you can set the ` JIT_API_ENDPOINT ` environment variable. If the variable is not set, the
172193default value will be used.
194+
195+ ### Settings Up Self-Hosted Runners
196+
197+ To setup self-hosted runners, use the following command:
198+
199+ You need to take the self hosted runners token from the Github Actions page of your repository.
200+ ` https://github.com/<your-github-org-name>/jit/settings/actions/runners `
201+
202+ #### Running on CentOS
203+
204+ ``` shell
205+ make setup-self-hosted-runner-centos token=< your-token> github_organization=< your-github-org-name>
206+ ```
207+
208+ You will be prompted to answer some questions about your runner. \
209+ When you complete this step, restart your EC2 machine. \
210+ The runner will be automatically started on boot.
0 commit comments