-
Notifications
You must be signed in to change notification settings - Fork 17
82 lines (79 loc) · 2.45 KB
/
ckan.yml
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
---
name: 5 - Run CKAN Command
on:
workflow_dispatch:
inputs:
environ:
description: 'Environment:'
required: true
type: choice
options:
- development
- staging
- prod
app:
description: 'App to run on:'
required: true
type: string
default: 'catalog-admin'
command:
description: 'Command to run:'
required: true
type: choice
options:
- 'ckan geodatagov check-stuck-jobs'
- 'ckan geodatagov db-solr-sync --dryrun'
- 'ckan geodatagov db-solr-sync --cleanup_solr'
- 'ckan geodatagov db-solr-sync --update_solr'
- 'ckan geodatagov db-solr-sync --cleanup_solr --update_solr'
- 'ckan harvester run'
- 'ckan geodatagov sitemap-to-s3'
- 'ckan geodatagov tracking-update'
- 'ckan report generate'
memory:
description: 'RAM to allocate:'
required: true
type: string
default: '2G'
disk:
description: 'Disk space to allocate:'
required: true
type: string
default: '1500M'
monitor:
description: 'Monitor log output?'
required: true
type: boolean
default: true
jobs:
ckan-command:
name: ${{inputs.command}}
runs-on: ubuntu-latest
environment: ${{inputs.environ}}
steps:
- name: Store Instance Name
run: |
INSTANCE_NAME="$(echo ckan-auto-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT})"
echo "INSTANCE_NAME=${INSTANCE_NAME}" | tee -a $GITHUB_ENV
- name: checkout
uses: actions/checkout@v4
- name: run task
uses: cloud-gov/cg-cli-tools@main
with:
command: >
cf run-task ${{ inputs.app }} --command "${{ inputs.command }}"
--name $INSTANCE_NAME -k ${{ inputs.disk }} -m ${{ inputs.memory }}
cf_org: gsa-datagov
cf_space: ${{ inputs.environ }}
cf_username: ${{secrets.CF_SERVICE_USER}}
cf_password: ${{secrets.CF_SERVICE_AUTH}}
- name: monitor task output
if: ${{ inputs.monitor }}
uses: cloud-gov/cg-cli-tools@main
with:
command: >
tools/monitor_cf_logs.sh ${{ inputs.app }} $INSTANCE_NAME
cf_org: gsa-datagov
cf_space: ${{ inputs.environ }}
cf_username: ${{secrets.CF_SERVICE_USER}}
cf_password: ${{secrets.CF_SERVICE_AUTH}}