Skip to content

Commit

Permalink
Add data update cron job
Browse files Browse the repository at this point in the history
  • Loading branch information
arkid15r committed Sep 17, 2024
1 parent c5b7468 commit bf0cb2b
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .github/ansible/staging/update-data.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- name: Run Nest Staging Data Update
hosts: nest_staging
tasks:
- name: Start services
shell:
cmd: 'make update-data'
18 changes: 18 additions & 0 deletions .github/workflows/update-data.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Update data

on:
schedule:
- cron: '0 1 * * *'
workflow_dispatch:

env:
FORCE_COLOR: 1

jobs:
update-data:
name: Run data update
runs-on: ubuntu-latest
steps:
- name: Run make update-data
working-directory: .github/ansible
run: ansible-playbook -i inventory.yaml staging/update-data.yaml
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ github-sync-related-repositories:
github-enrich-issues:
@CMD="poetry run python manage.py github_enrich_issues" $(MAKE) exec-backend-command

index:
index-data:
@CMD="poetry run python manage.py algolia_reindex" $(MAKE) exec-backend-command

load-data:
Expand Down Expand Up @@ -59,7 +59,7 @@ setup:
shell:
@CMD="/bin/bash" $(MAKE) exec-backend-command

sync: \
sync-data: \
github-sync-owasp-organization \
owasp-scrape-site-data \
github-sync-related-repositories \
Expand All @@ -70,4 +70,4 @@ test:
@docker build -f backend/Dockerfile.test backend -t nest-backend-test 2>/dev/null
@docker run -e DJANGO_CONFIGURATION=Test nest-backend-test poetry run pytest

update: sync index
update-data: sync-data index-data

0 comments on commit bf0cb2b

Please sign in to comment.