Skip to content

Commit 7659db8

Browse files
authored
Master gh 580 b dbip download workflow (#644)
* added dbip_download github workflow * change to run every day on midnight for QA * necesary changes to be able build dbip_country.rs on master * -p for generating ip_country/src * todo in dbip_download.yaml * condition for new branch generated-source * fixing condition for generated-source branch * fix generated-source branch name in condition * increse standard timeout milis const * manual trigger and debugging flags to runs * use variable to store git ls-remote command
1 parent 68c2ddb commit 7659db8

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

.github/workflows/dbip_download.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
name: Download DBIP data and generate dbip_country.rs
22

33
on:
4-
schedule:
5-
- cron: "0 0 * * *" # Runs at midnight on the 3rd of every month
4+
workflow_dispatch:
5+
# schedule:
6+
# - cron: "0 0 * * *" # Runs at midnight on the 3rd of every month
67

78
env:
89
TEMP_DIR: '/tmp'
@@ -25,6 +26,7 @@ jobs:
2526

2627
- name: Download DBIP data in MMDB format
2728
run: |
29+
set -xv
2830
export YEAR_MONTH=$(date +%Y-%m)
2931
echo "TEMP_DIR=$(mktemp -d)" >> $GITHUB_ENV
3032
echo "YEAR_MONTH=$YEAR_MONTH" >> $GITHUB_ENV
@@ -36,15 +38,18 @@ jobs:
3638
3739
- name: Generate Rust source file
3840
run: |
41+
set -xv
3942
cd dbipexperiment/ip_country
4043
cargo run < "dbip-data/dbip-country-lite.mmdb" > "$TEMP_DIR"/dbip_country.rs
4144
ls "$TEMP_DIR"
4245
4346
- name: Commit and push generated file
4447
run: |
48+
set -xv
4549
git config user.name "github-actions[bot]"
4650
git config user.email "github-actions[bot]@users.noreply.github.com"
47-
if [[ "$(git ls-remote --heads 2>/dev/null | grep generated-source)" == "" ]]
51+
BRANCH=$(git ls-remote --heads 2>/dev/null | grep generated-source)
52+
if [[ "$BRANCH" == "" ]]
4853
then
4954
git checkout -B generated-source
5055
git rm -rf .

0 commit comments

Comments
 (0)