Skip to content

Commit 2332932

Browse files
committed
feat(docs): reorg & restructure
1 parent 58ba9f4 commit 2332932

7 files changed

Lines changed: 144 additions & 139 deletions

File tree

README.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,22 @@ git add .
4747
git commit -a -m "feat(init): initial setup"
4848
```
4949

50-
4. Configure your CI/CD pipeline (see [Wiki](https://github.com/74k1/jamfGitSync/wiki/Pipeline-examples))
50+
4. Push this commit to your own repository. (wherever you'll want to have those scripts stored)
5151

52-
5. Now you can make changes to your scripts locally, push those changes to git and watch your CI/CD do the rest of the job.
52+
53+
### Next Steps
54+
55+
After you're done with the initial setup, your Pipelines _could_ look something like this (ofcourse this depends on your own setup, and these are just examples):
56+
57+
- [Jenkins](https://github.com/74k1/jamfGitSync/wiki/Jenkins-example)
58+
- [BitBucket](https://github.com/74k1/jamfGitSync/wiki/BitBucket-example)
59+
- [GitHub Workflows](https://github.com/74k1/jamfGitSync/wiki/GitHub-Workflows-example)
60+
- [CircleCI](https://github.com/74k1/jamfGitSync/wiki/CircleCI-example)
61+
62+
Now you can make changes to your scripts in your own repository, push those changes to git and watch your CI/CD do the rest of the job. :smile:
5363

5464
## Contribution
5565

56-
Feel free to submit PRs! I'm looking forward to your suggestions / improvements. :)
66+
All contributions are greatly appreciated! It'd make my day if you could read the Contribution Guidelines first.
67+
68+
I'm looking forward to your suggestions / improvements. :)

docs/Bitbucket-example.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[Setup your variables](https://support.atlassian.com/bitbucket-cloud/docs/variables-and-secrets/) so that:
2+
3+
- `$JAMF_PRO_URL` should be `https://yourcompany.jamfcloud.com`
4+
- `$CLIENT_ID` should be the generated Client ID from your Jamf Instance.
5+
- `$CLIENT_SECRET` should be the generated Client Secret from your Jamf Instance.
6+
7+
```yml
8+
image: atlassian/default-image:3
9+
10+
pipelines:
11+
default:
12+
- step:
13+
name: 'Update changes in Jamf Pro server'
14+
clone:
15+
depth: 2
16+
script:
17+
- apt-get update && apt-get install libxml2-utils xmlstarlet -y
18+
- ./jamfGitSync.sh --url "$JAMF_PRO_URL" --clientid "$CLIENT_ID" --clientsecret "$CLIENT_SECRET" --push-changes-to-jamf-pro --backup-updated
19+
artifacts:
20+
- backups/**
21+
```

docs/CircleCI-example.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
[Setup your variables](https://circleci.com/docs/env-vars/) so that:
2+
3+
- `$JAMF_PRO_URL` should be `https://yourcompany.jamfcloud.com`
4+
- `$CLIENT_ID` should be the generated Client ID from your Jamf Instance.
5+
- `$CLIENT_SECRET` should be the generated Client Secret from your Jamf Instance.
6+
7+
```yml
8+
version: 2.1
9+
10+
jobs:
11+
push-changes-to-jamf-pro:
12+
docker:
13+
- image: cimg/base:stable
14+
steps:
15+
- checkout
16+
- run:
17+
name: "Install Requirements"
18+
command: sudo apt-get update && sudo apt-get install jq -y
19+
- run:
20+
name: "Update changes in Jamf Pro Server 1"
21+
command: ./jamfGitSync.sh --url "$JAMF_PRO_URL" --clientid "$CLIENT_ID" --clientsecret "$CLIENT_SECRET" --push-changes-to-jamf-pro --backup-updated
22+
- store_artifacts:
23+
path: ./backups
24+
25+
workflows:
26+
jamfGitSync-workflow:
27+
jobs:
28+
- push-changes-to-jamf-pro
29+
```

docs/GitHub-Workflows-example.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
[Setup your variables](https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables) so that:
2+
3+
- `JAMF_PRO_URL` should be `https://yourcompany.jamfcloud.com`
4+
- `CLIENT_ID` should be the generated Client ID from your Jamf Instance.
5+
- `CLIENT_SECRET` should be the generated Client Secret from your Jamf Instance.
6+
7+
```yml
8+
name: jamfGitSync
9+
10+
on:
11+
push:
12+
branches: [ "main" ]
13+
pull_request:
14+
branches: [ "main" ]
15+
16+
workflow_dispatch:
17+
18+
jobs:
19+
push-changes-to-jamf-pro-1:
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
- uses: actions/checkout@v3
24+
with:
25+
fetch-depth: 2
26+
27+
- name: Install Requirements
28+
run: sudo apt-get update && sudo apt-get install jq -y
29+
30+
- name: Push Changes to Jamf Pro Server 1
31+
run: ./jamfGitSync.sh --url ${{ vars.JAMF_PRO_URL }} --clientid ${{ vars.CLIENT_ID }} --clientsecret ${{ secrets.CLIENT_SECRET }} --push-changes-to-jamf-pro --backup-updated
32+
33+
- name: Archive Backups
34+
uses: actions/upload-artifact@v3
35+
with:
36+
name: jamf-pro-backups
37+
path: backups
38+
```

docs/Home.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
11
Welcome to the jamfGitSync wiki!
22

3-
Check out Pipeline examples here:
4-
https://github.com/74k1/jamfGitSync/wiki/Pipeline-examples
3+
First of all, make sure you're all set with the requirements and the steps mentioned in the [README.md](https://github.com/74k1/jamfGitSync#usage).
4+
5+
If you've got additional usecases that arent listed here but would like to contribute, feel free to create an [ISSUE](https://github.com/74k1/jamfGitSync/issues). I'm looking forward to it!
6+
7+
Contribution Guidelines:
8+
- [Contributing](https://github.com/74k1/jamfGitSync/blob/main/CONTRIBUTING.md)
9+
10+
Wiki-Pages:
11+
- [Jenkins](https://github.com/74k1/jamfGitSync/wiki/Jenkins-example)
12+
- [BitBucket](https://github.com/74k1/jamfGitSync/wiki/BitBucket-example)
13+
- [GitHub Workflows](https://github.com/74k1/jamfGitSync/wiki/GitHub-Workflows-example)
14+
- [CircleCI](https://github.com/74k1/jamfGitSync/wiki/CircleCI-example)

docs/Jenkins-example.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
[Setup your variables](https://www.jenkins.io/doc/book/pipeline/jenkinsfile/) so that:
2+
3+
- `$CLIENT_SECRET` should be the generated Client Secret from your Jamf Instance.
4+
5+
Make sure to replace `YOUR_INSTANCE` with something like `https://yourcompany.jamfcloud.com` and `YOUR_CLIENT_ID` with your Client ID from Jamf.
6+
7+
```Groovy
8+
pipeline {
9+
agent any
10+
11+
options {
12+
buildDiscarder(logRotator(numToKeepStr: "10", artifactNumToKeepStr: "10"))
13+
timeout(time: 30, unit: "MINUTES")
14+
timestamps()
15+
}
16+
17+
stages {
18+
stage('Push Changes to Jamf Pro Server') {
19+
steps {
20+
// Execute the script with parameters
21+
sh './jamfScriptSync.sh --url YOUR_INSTANCE --clientid YOUR_CLIENT_ID --clientsecret ${JAMF_API_SECRET} --push-changes-to-jamf-pro --backup-updated'
22+
23+
// Archive backups
24+
archiveArtifacts artifacts: 'backups/**', fingerprint: true
25+
}
26+
}
27+
}
28+
}
29+
```

docs/Pipeline-examples.md

Lines changed: 0 additions & 134 deletions
This file was deleted.

0 commit comments

Comments
 (0)