summaryrefslogtreecommitdiff
path: root/roles/ghrss/tasks/main.yml
blob: 04caaf86781b83f654b37b3b7b270cc248f5cd19 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
- name: git clone ghrss-crawler
  remote_user: horus
  git:
    repo: git@git.iamfabulous.de:ghrss
    dest: /home/horus/code/ghrss
    accept_hostkey: yes 
  
#- name: go mod init
#  remote_user: horus
#  ansible.builtin.shell: go mod init ghrss
#  args:
#    chdir: /home/horus/code/ghrss
  
- name: get go dependencies to build
  remote_user: horus
  ansible.builtin.shell: go mod tidy
  args:
    chdir: /home/horus/code/ghrss

- name: compile ghrss-crawler (make build)
  remote_user: horus
  ansible.builtin.shell: make build
  args:
    chdir: /home/horus/code/ghrss

- name: set cronjob for ghrss-crawler
  ansible.builtin.cron:
    name: "crawlt Github #1"
    minute: "50"
    hour: "12"
    user: "horus"
    job: "/home/horus/code/ghrss/ghrss --config=/home/horus/code/ghrss/ --ignore-robots-txt --delay 10"

- name: set cronjob for ghrss-crawler
  ansible.builtin.cron:
    name: "crawlt Github #2"
    minute: "50"
    hour: "23"
    user: "horus"
    job: "/home/horus/code/ghrss/ghrss --config=/home/horus/code/ghrss/ --ignore-robots-txt --delay 10"

- name: copy config.json
  remote_user: horus
  copy:
    src: config.json
    dest: /home/horus/code/ghrss/config.json