-
Notifications
You must be signed in to change notification settings - Fork 2
30 lines (25 loc) · 1.54 KB
/
update_gl_version.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
name: "Update Graylog Version"
on:
schedule:
- cron: '0 0 * * *' # At midnight, daily
jobs:
Update-Docker-Compose-File:
runs-on: "ubuntu-latest"
steps:
- name: "Checkout repository"
uses: "actions/checkout@v4"
- name: "Check Current Version and update if needed"
shell: "bash"
run: |
lgl=$(curl -L --fail "https://hub.docker.com/v2/repositories/graylog/graylog/tags/?page_size=1000" | jq '.results | .[] | .name' -r | sed 's/latest//' | sort --version-sort | awk '!/beta/' | awk '!/alpha/' | awk '!/-rc/' | tail -n 1)
dcv=$(sed -n 's/image: "graylog\/graylog-enterprise://p' instruqt/common/configs/docker-compose-glservices.yml | tr -d '"' | tr -d " ")
if [[ "$lgl" != "$dcv" ]]; then echo "update plz"; else echo "updated already"; exit 0; fi
lgl=$(curl -L --fail "https://hub.docker.com/v2/repositories/graylog/graylog/tags/?page_size=1000" | jq '.results | .[] | .name' -r | sed 's/latest//' | sort --version-sort | awk '!/beta/' | awk '!/alpha/' | awk '!/-rc/' | tail -n 1)
sed -i "s+enterprise\:$dcv+enterprise\:$lgl+g" 650de6ce3ae400b8e8ccd115/configs/docker/mon-compose.yml
#will need to add logic here in future
sed -i "s+enterprise\:$dcv+enterprise\:$lgl+g" instruqt/common/configs/docker-compose-glservices.yml
git config user.name github-actions
git config user.email [email protected]
git add .
git commit -m "Git Actions Updated Docker Compose"
git push