Skip to content

Commit f572d33

Browse files
authored
ITADMIN - Add instructions for manual backup (#24)
1 parent 06120a6 commit f572d33

File tree

5 files changed

+73
-7
lines changed

5 files changed

+73
-7
lines changed

.github/workflows/nightly.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,30 @@
1+
# This configuration is used for nightly builds
12
name: nightly
23

34
on:
45
schedule:
5-
- cron: 0 0 * * 1
6+
# Runs every Monday at 00:00
7+
- cron: 0 0 * * MON
68

79
jobs:
810
nightly:
911
timeout-minutes: 30
1012
runs-on: ubuntu-latest
1113

1214
steps:
15+
# Checkout the git repository
1316
- name: checkout
1417
uses: actions/checkout@v2
18+
with:
19+
ref: ${{ github.head_ref }}
20+
token: ${{ secrets.GPR_TOKEN }}
21+
fetch-depth: ''
22+
23+
# Execute some necessary git commands to get more repository informations
24+
- name: post-checkout
25+
run: git fetch --prune --unshallow
1526

27+
# Get the current project version from version.txt
1628
- name: get-project-version
1729
id: get_project_version
1830
uses: avides/actions-project-version-check@v1
@@ -21,6 +33,7 @@ jobs:
2133
file-to-check: version.txt
2234
only-return-version: true
2335

36+
# Build docker image
2437
- name: build-image
2538
env:
2639
PROJECT_VERSION: ${{ steps.get_project_version.outputs.version }}

.github/workflows/release.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
# This configuration is used for the deployment and publish to docker
12
name: release
23

34
on:
45
push:
56
branches:
7+
# Runs only on push to the master branch
68
- master
79

810
jobs:
@@ -13,9 +15,19 @@ jobs:
1315
runs-on: ubuntu-latest
1416

1517
steps:
18+
# Checkout the git repository
1619
- name: checkout
1720
uses: actions/checkout@v2
21+
with:
22+
ref: ${{ github.head_ref }}
23+
token: ${{ secrets.GPR_TOKEN }}
24+
fetch-depth: ''
25+
26+
# Execute some necessary git commands to get more repository informations
27+
- name: post-checkout
28+
run: git fetch --prune --unshallow
1829

30+
# Get the current project version from POM
1931
- name: get-project-version
2032
id: get_project_version
2133
uses: avides/actions-project-version-check@v1
@@ -24,6 +36,7 @@ jobs:
2436
file-to-check: version.txt
2537
only-return-version: true
2638

39+
# Build and publish docker image
2740
- name: push-image
2841
env:
2942
PROJECT_VERSION: ${{ steps.get_project_version.outputs.version }}
@@ -35,6 +48,7 @@ jobs:
3548
docker push ${{ secrets.DOCKER_REGISTRY }}/${GITHUB_REPOSITORY}:latest
3649
fi
3750
51+
# Get last commit message for GitHub Release tag
3852
- name: setup-github-release
3953
id: setup_github_release
4054
env:
@@ -45,6 +59,7 @@ jobs:
4559
echo ::set-output name=isprerelease::true
4660
fi
4761
62+
# Create and publish GitHub Release tag
4863
- name: github-release
4964
uses: actions/create-release@v1
5065
env:

.github/workflows/review.yml

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
# This configuration is used for the pull request review
12
name: review
23

34
on:
45
pull_request:
6+
# Runs only on pull request creation and on every new commit to the created pull request
57
types: [opened, synchronize]
68

79
jobs:
@@ -10,24 +12,33 @@ jobs:
1012
runs-on: ubuntu-latest
1113

1214
steps:
15+
# Cancels previous run for this branch that have a different commit id (SHA)
16+
- name: cancel-previous-run
17+
uses: styfle/[email protected]
18+
with:
19+
access_token: ${{ github.token }}
20+
21+
# Checkout the git repository
1322
- name: checkout
1423
uses: actions/checkout@v2
1524
with:
1625
ref: ${{ github.head_ref }}
1726
token: ${{ secrets.GPR_TOKEN }}
1827
fetch-depth: ''
1928

29+
# Execute some necessary git commands to get more repository informations
2030
- name: post-checkout
2131
run: git fetch --prune --unshallow
2232

33+
# Update GitHub Action configuration if necessary
2334
- name: action-configuration-autoupdate
24-
id: actions_action_configuration_autoupdate
2535
uses: avides/actions-action-configuration-autoupdate@v1
2636
with:
2737
token: ${{ secrets.GPR_TOKEN }}
2838
actions-configuration-files: plain-docker-application/nightly.yml,plain-docker-application/release.yml,plain-docker-application/review.yml
2939
source-repository: ${{ secrets.ACTIONS_CONFIG_AUTOUPDATE_REPO }}
3040

41+
# Push updated GitHub Actions configuration if necessary
3142
- uses: stefanzweifel/git-auto-commit-action@v4
3243
with:
3344
file_pattern: .github/workflows/*.yml
@@ -36,17 +47,34 @@ jobs:
3647
commit_author: ${{ secrets.ACTIONS_CONFIG_AUTOUPDATE_AUTHOR }}
3748
commit_message: Update GitHub Action configuration
3849

39-
- name: action-configuration-updated
40-
if: ${{ steps.actions_action_configuration_autoupdate.outputs.updated }}
41-
run: exit 1;
42-
50+
# Verify project version is updated
4351
- name: project-version-check
4452
id: project_version_check
4553
uses: avides/actions-project-version-check@v1
4654
with:
4755
token: ${{ secrets.GITHUB_TOKEN }}
4856
file-to-check: version.txt
4957

58+
# Check if documentation reminder comment is already given
59+
- name: find-documentation-reminder-comment
60+
uses: peter-evans/find-comment@v1
61+
id: find_documentation_reminder_comment
62+
with:
63+
issue-number: ${{ github.event.number }}
64+
body-includes: "Confluence/GitHub documentation added or updated?"
65+
66+
# Add documentation reminder comment if not given
67+
- name: documentation-reminder-comment
68+
uses: jungwinter/comment@v1
69+
id: create
70+
if: ${{ steps.find_documentation_reminder_comment.outputs.comment-id == 0 }}
71+
with:
72+
type: create
73+
body: 'Confluence/GitHub documentation added or updated?'
74+
issue_number: ${{ github.event.number }}
75+
token: ${{ secrets.GITHUB_TOKEN }}
76+
77+
# Build docker image
5078
- name: build-image
5179
env:
5280
PROJECT_VERSION: ${{ steps.project_version_check.outputs.version }}

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,16 @@ docker logs -f mysql-s3-backup
5959
docker exec -it mysql-s3-backup /bin/bash
6060
```
6161

62+
### Trigger backup manually
63+
Caution: Please avoid concurrent backup processes (e.g. via cron & manual backup)!
64+
65+
The following command must be executed inside the container.
66+
Therefore, you must log in inside the container or pass the command to the container.
67+
68+
```shell
69+
/root/backup.sh >> /var/log/backup-cron/cron.log
70+
```
71+
6272
## Metrics
6373

6474
This container delivers some metrics about the MySQL backups. The metrics are available to the HTTP endpoint "/metrics" on port 9300. Following metrics are collected:

version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.6.0
1+
2.7.0

0 commit comments

Comments
 (0)