Skip to content
Extraits de code Groupes Projets
Valider 15638435 rédigé par Bastien Le Querrec's avatar Bastien Le Querrec
Parcourir les fichiers

s3: ajoute un paramètre avec le dossier où sont situées les données

parent 7df1d4e9
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -74,10 +74,10 @@ pep8: ...@@ -74,10 +74,10 @@ pep8:
- unprivileged - unprivileged
needs: [install] needs: [install]
script: script:
- s3/download-from-s3.sh "${PREF}" "${S3_KEY}" "${S3_SECRET}" "${S3_HOST}" "${S3_BUCKET}" || true - s3/download-from-s3.sh "${PREF}" "${S3_KEY}" "${S3_SECRET}" "${S3_HOST}" "${S3_BUCKET}" data/ || true
- /etc/init.d/tor start - /etc/init.d/tor start
- make "${PREF}" - make "${PREF}"
- s3/upload-to-s3.sh "${PREF}" "${S3_KEY}" "${S3_SECRET}" "${S3_HOST}" "${S3_BUCKET}" || true - s3/upload-to-s3.sh "${PREF}" "${S3_KEY}" "${S3_SECRET}" "${S3_HOST}" "${S3_BUCKET}" data/ || true
cache: cache:
key: $CI_COMMIT_REF_SLUG key: $CI_COMMIT_REF_SLUG
paths: paths:
......
...@@ -6,6 +6,7 @@ s3_key="${1}" ...@@ -6,6 +6,7 @@ s3_key="${1}"
s3_secret="${2}" s3_secret="${2}"
s3_host="${3}" s3_host="${3}"
s3_bucket="${4}" s3_bucket="${4}"
dest="${5}"
root_path=$(dirname $(realpath "${BASH_SOURCE[0]}")) root_path=$(dirname $(realpath "${BASH_SOURCE[0]}"))
...@@ -111,12 +112,12 @@ pref973 ...@@ -111,12 +112,12 @@ pref973
pref974 pref974
pref976" pref976"
if test -z "$s3_key" || test -z "$s3_secret" || test -z "$s3_host" || test -z "$s3_bucket"; then if test -z "$s3_key" || test -z "$s3_secret" || test -z "$s3_host" || test -z "$s3_bucket" || test -z "$dest"; then
echo "Usage: ${0} <s3_key> <s3_secret> <s3_host> <s3_bucket>" echo "Usage: ${0} <s3_key> <s3_secret> <s3_host> <s3_bucket> <dest>"
exit 1 exit 1
fi fi
for i in $administrations; do for i in $administrations; do
${root_path}/download-from-s3.sh "${i}" "$s3_key" "$s3_secret" "$s3_host" "$s3_bucket" || true ${root_path}/download-from-s3.sh "${i}" "$s3_key" "$s3_secret" "$s3_host" "$s3_bucket" "$dest" || true
rm "${root_path}/../data/${i}.zip" || true rm "${dest}/${i}.zip" || true
done done
...@@ -7,14 +7,17 @@ s3_key="${2}" ...@@ -7,14 +7,17 @@ s3_key="${2}"
s3_secret="${3}" s3_secret="${3}"
s3_host="${4}" s3_host="${4}"
s3_bucket="${5}" s3_bucket="${5}"
dest="${6}"
if test -z "$pref" || test -z "$s3_key" || test -z "$s3_secret" || test -z "$s3_host" || test -z "$s3_bucket"; then if test -z "$pref" || test -z "$s3_key" || test -z "$s3_secret" || test -z "$s3_host" || test -z "$s3_bucket" || test -z "$dest"; then
echo "Usage: ${0} <pref> <s3_key> <s3_secret> <s3_host> <s3_bucket>" echo "Usage: ${0} <pref> <s3_key> <s3_secret> <s3_host> <s3_bucket> <dest>"
exit 1 exit 1
fi fi
mkdir -p "$(dirname $(realpath "${BASH_SOURCE[0]}"))/../data/" dest=$(realpath "${dest}")
cd "$(dirname $(realpath "${BASH_SOURCE[0]}"))/../data/"
mkdir -p "${dest}/"
cd "${dest}/"
file="${pref}.zip" file="${pref}.zip"
......
...@@ -6,6 +6,7 @@ s3_key="${1}" ...@@ -6,6 +6,7 @@ s3_key="${1}"
s3_secret="${2}" s3_secret="${2}"
s3_host="${3}" s3_host="${3}"
s3_bucket="${4}" s3_bucket="${4}"
data="${5}"
root_path=$(dirname $(realpath "${BASH_SOURCE[0]}")) root_path=$(dirname $(realpath "${BASH_SOURCE[0]}"))
...@@ -111,11 +112,11 @@ pref973 ...@@ -111,11 +112,11 @@ pref973
pref974 pref974
pref976" pref976"
if test -z "$s3_key" || test -z "$s3_secret" || test -z "$s3_host" || test -z "$s3_bucket"; then if test -z "$s3_key" || test -z "$s3_secret" || test -z "$s3_host" || test -z "$s3_bucket" || test -z "$data"; then
echo "Usage: ${0} <s3_key> <s3_secret> <s3_host> <s3_bucket>" echo "Usage: ${0} <s3_key> <s3_secret> <s3_host> <s3_bucket> <data>"
exit 1 exit 1
fi fi
for i in $administrations; do for i in $administrations; do
${root_path}/upload-to-s3.sh "${i}" "$s3_key" "$s3_secret" "$s3_host" "$s3_bucket" || true ${root_path}/upload-to-s3.sh "${i}" "$s3_key" "$s3_secret" "$s3_host" "$s3_bucket" "$data" || true
done done
...@@ -7,13 +7,16 @@ s3_key="${2}" ...@@ -7,13 +7,16 @@ s3_key="${2}"
s3_secret="${3}" s3_secret="${3}"
s3_host="${4}" s3_host="${4}"
s3_bucket="${5}" s3_bucket="${5}"
data="${6}"
if test -z "$pref" || test -z "$s3_key" || test -z "$s3_secret" || test -z "$s3_host" || test -z "$s3_bucket"; then if test -z "$pref" || test -z "$s3_key" || test -z "$s3_secret" || test -z "$s3_host" || test -z "$s3_bucket" || test -z "$data"; then
echo "Usage: ${0} <pref> <s3_key> <s3_secret> <s3_host> <s3_bucket>" echo "Usage: ${0} <pref> <s3_key> <s3_secret> <s3_host> <s3_bucket> <data>"
exit 1 exit 1
fi fi
cd "$(dirname $(realpath "${BASH_SOURCE[0]}"))/../data/${pref}/raa" data=$(realpath "${data}")
cd "${data}/${pref}/raa"
cd "../../" cd "../../"
file="${pref}.zip" file="${pref}.zip"
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter