Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien Bouquillon committed Oct 18, 2021
1 parent b1e6c76 commit e30c114
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 133 deletions.
77 changes: 0 additions & 77 deletions .gitlab-ci.yml

This file was deleted.

26 changes: 11 additions & 15 deletions .k8s/__tests__/__snapshots__/indexing-dev.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,20 @@ data:
echo \\"-- Download datasets\\"
if command -v apt-get &> /dev/null
then
apt-get update -y
fi
# install sqlite3 if not exists
if ! command -v sqlite3 &> /dev/null
then
echo \\"sqlite3 could not be found\\"
apt-get update -y
apt-get install -y sqlite3
fi
Expand All @@ -89,7 +96,6 @@ data:
then
echo \\"wget could not be found\\"
apt-get update -y
apt-get install -y wget
fi
Expand All @@ -99,7 +105,6 @@ data:
then
echo \\"unzip could not be found\\"
apt-get update -y
apt-get install -y unzip
fi
Expand Down Expand Up @@ -142,26 +147,17 @@ data:
-O \\"\${DATA_DIR}/WEEZ.csv\\"
sleep 100000
pwd
ls -la
ls -la data
echo \\"-- Import CSV datasets to sqlite\\"
sqlite3 -echo db.sqlite \\".read import.sql\\"
sqlite3 -echo \\"\${DATA_DIR}/db.sqlite\\" \\".read import.sql\\"
echo \\"-- Export sqlite data to CSV\\"
sqlite3 -header -csv db.sqlite \\".read export.sql\\" > \\"\${DATA_DIR}/output.csv\\"
sqlite3 -header -csv \\"\${DATA_DIR}/db.sqlite\\" \\".read export.sql\\" >
\\"\${DATA_DIR}/output.csv\\"
import.sql: |-
--- sqlite3 -echo db.sqlite \\".read import.sql\\"
---
Expand Down
26 changes: 11 additions & 15 deletions .k8s/__tests__/__snapshots__/indexing-preprod.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,20 @@ data:
echo \\"-- Download datasets\\"
if command -v apt-get &> /dev/null
then
apt-get update -y
fi
# install sqlite3 if not exists
if ! command -v sqlite3 &> /dev/null
then
echo \\"sqlite3 could not be found\\"
apt-get update -y
apt-get install -y sqlite3
fi
Expand All @@ -87,7 +94,6 @@ data:
then
echo \\"wget could not be found\\"
apt-get update -y
apt-get install -y wget
fi
Expand All @@ -97,7 +103,6 @@ data:
then
echo \\"unzip could not be found\\"
apt-get update -y
apt-get install -y unzip
fi
Expand Down Expand Up @@ -140,26 +145,17 @@ data:
-O \\"\${DATA_DIR}/WEEZ.csv\\"
sleep 100000
pwd
ls -la
ls -la data
echo \\"-- Import CSV datasets to sqlite\\"
sqlite3 -echo db.sqlite \\".read import.sql\\"
sqlite3 -echo \\"\${DATA_DIR}/db.sqlite\\" \\".read import.sql\\"
echo \\"-- Export sqlite data to CSV\\"
sqlite3 -header -csv db.sqlite \\".read export.sql\\" > \\"\${DATA_DIR}/output.csv\\"
sqlite3 -header -csv \\"\${DATA_DIR}/db.sqlite\\" \\".read export.sql\\" >
\\"\${DATA_DIR}/output.csv\\"
import.sql: |-
--- sqlite3 -echo db.sqlite \\".read import.sql\\"
---
Expand Down
26 changes: 11 additions & 15 deletions .k8s/__tests__/__snapshots__/indexing-prod.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,20 @@ data:
echo \\"-- Download datasets\\"
if command -v apt-get &> /dev/null
then
apt-get update -y
fi
# install sqlite3 if not exists
if ! command -v sqlite3 &> /dev/null
then
echo \\"sqlite3 could not be found\\"
apt-get update -y
apt-get install -y sqlite3
fi
Expand All @@ -87,7 +94,6 @@ data:
then
echo \\"wget could not be found\\"
apt-get update -y
apt-get install -y wget
fi
Expand All @@ -97,7 +103,6 @@ data:
then
echo \\"unzip could not be found\\"
apt-get update -y
apt-get install -y unzip
fi
Expand Down Expand Up @@ -140,26 +145,17 @@ data:
-O \\"\${DATA_DIR}/WEEZ.csv\\"
sleep 100000
pwd
ls -la
ls -la data
echo \\"-- Import CSV datasets to sqlite\\"
sqlite3 -echo db.sqlite \\".read import.sql\\"
sqlite3 -echo \\"\${DATA_DIR}/db.sqlite\\" \\".read import.sql\\"
echo \\"-- Export sqlite data to CSV\\"
sqlite3 -header -csv db.sqlite \\".read export.sql\\" > \\"\${DATA_DIR}/output.csv\\"
sqlite3 -header -csv \\"\${DATA_DIR}/db.sqlite\\" \\".read export.sql\\" >
\\"\${DATA_DIR}/output.csv\\"
import.sql: |-
--- sqlite3 -echo db.sqlite \\".read import.sql\\"
---
Expand Down
19 changes: 8 additions & 11 deletions sqlite.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,28 @@ cd "$(dirname "$0")" || exit

echo "-- Download datasets"


if command -v apt-get &> /dev/null
then
apt-get update -y
fi

# install sqlite3 if not exists
if ! command -v sqlite3 &> /dev/null
then
echo "sqlite3 could not be found"
apt-get update -y
apt-get install -y sqlite3
fi
# install wget if not exists
if ! command -v wget &> /dev/null
then
echo "wget could not be found"
apt-get update -y
apt-get install -y wget
fi
# install unzip if not exists
if ! command -v unzip &> /dev/null
then
echo "unzip could not be found"
apt-get update -y
apt-get install -y unzip
fi

Expand Down Expand Up @@ -60,16 +63,10 @@ unzip "${DATA_DIR}/StockUniteLegale_utf8.zip" -d "${DATA_DIR}"
# WEEZ data
wget --progress=bar:force:noscroll -q --show-progress https://www.data.gouv.fr/fr/datasets/r/a785345a-6e8c-4961-ae0a-bc00878e4f2e -O "${DATA_DIR}/WEEZ.csv"

sleep 100000

pwd
ls -la
ls -la data

echo "-- Import CSV datasets to sqlite"

sqlite3 -echo db.sqlite ".read import.sql"
sqlite3 -echo "${DATA_DIR}/db.sqlite" ".read import.sql"

echo "-- Export sqlite data to CSV"

sqlite3 -header -csv db.sqlite ".read export.sql" > "${DATA_DIR}/output.csv"
sqlite3 -header -csv "${DATA_DIR}/db.sqlite" ".read export.sql" > "${DATA_DIR}/output.csv"

0 comments on commit e30c114

Please sign in to comment.