Skip to content

Commit

Permalink
Fixed run issue with empty/missing teams folder. (#55)
Browse files Browse the repository at this point in the history
Also added documentation for setting `--delete-other-teams` to false until this is fixed in fleetctl.
  • Loading branch information
getvictor authored Oct 21, 2024
1 parent 9905484 commit c07fe54
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jobs:
with:
# Run GitOps in dry-run mode for pull requests.
dry-run-only: ${{ github.event_name == 'pull_request' && 'true' || 'false' }}
# delete-other-teams: false
# Add FLEET_URL and FLEET_API_TOKEN to the repository secrets.
# In addition, specify or add secrets for all the environment variables that are mentioned in the global/team YAML files.
env:
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ Rather than relying on multiple teams for tools like Intune or Jamf, build a uni

3. Add `FLEET_GLOBAL_ENROLL_SECRET` secret to your new repository's secrets. The enroll secret must be an alphanumeric string of at least 32 and at most 255 characters.
- If you have a Premium Fleet license, also add `FLEET_WORKSTATIONS_ENROLL_SECRET` and `FLEET_WORKSTATIONS_CANARY_ENROLL_SECRET`.
- If you do not have a Premium Fleet license, uncomment the following line in `.github/workflows/workflow.yml`:
```yaml
# delete-other-teams: false
```

4. Delete `.gitlab-ci.yml`, which is for GitLab CI/CD.

Expand Down
4 changes: 3 additions & 1 deletion gitops.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ fi

args=(-f "$FLEET_GLOBAL_FILE")
for team_file in "$FLEET_GITOPS_DIR"/teams/*.yml; do
args+=(-f "$team_file")
if [ -f "$team_file" ]; then
args+=(-f "$team_file")
fi
done
if [ "$FLEET_DELETE_OTHER_TEAMS" = true ]; then
args+=(--delete-other-teams)
Expand Down

0 comments on commit c07fe54

Please sign in to comment.