Skip to content

Commit 29a89e9

Browse files
By default, run GitOps every 24 hours (#73)
* By default, run GitOps every 24 hours Fleet already does this in Fleet's dogfood environment: We learned that IT admins expect Fleet-maintained apps to update themselves. Fleet-maintained apps update on every GitOps run. More context in Slack. * Updated daily schedule for GitLab. --------- Co-authored-by: Victor Lyuboslavsky <2685025+getvictor@users.noreply.github.com>
1 parent 13c7cf6 commit 29a89e9

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

.github/workflows/workflow.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ on:
66
- main
77
pull_request:
88
workflow_dispatch: # allows manual triggering
9+
schedule:
10+
- cron: '0 6 * * *' # Nightly 6AM UTC
911

1012
# Prevent concurrent runs of this workflow.
1113
concurrency:

.gitlab-ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ fleet-gitops:
77
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
88
variables:
99
FLEET_DRY_RUN_ONLY: false
10+
- if: $CI_PIPELINE_SOURCE == 'schedule' && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
11+
variables:
12+
FLEET_DRY_RUN_ONLY: false
1013
before_script:
1114
- apt-get -qq update
1215
- apt-get install -y jq=1.6-2.1

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,16 @@ This is the starter repository for using [Fleet](https://fleetdm.com) with a Git
3030

3131
5. Now, when anyone pushes a new commit to the default branch, the pipeline will run and update Fleet. For merge requests, the pipeline will do a dry run only.
3232

33+
6. (Optional) To ensure your Fleet configuration stays up to date even when there are no new commits, set up a scheduled pipeline:
34+
- In your GitLab project, go to the left sidebar and navigate to **Build > Pipeline schedules**. (In some GitLab versions, this may appear as **CI/CD > Schedules**.)
35+
- Click **Create a new pipeline schedule** (or **Schedule a new pipeline**).
36+
- Fill in the form:
37+
- **Description**: e.g., `Daily GitOps sync`
38+
- **Cron timezone**: e.g., `[UTC 0] UTC`
39+
- **Interval pattern**: e.g., Custom: `0 6 * * *` (runs nightly at 6AM UTC)
40+
- **Target branch or tag**: your default branch (e.g., `main`)
41+
- Click **Create pipeline schedule**.
42+
3343
## Configuration options
3444

3545
For all configuration options, go to the [YAML files reference](https://fleetdm.com/docs/using-fleet/gitops) in the Fleet docs.

0 commit comments

Comments
 (0)