Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
ebulk
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Roque
ebulk
Commits
7ce3755c
Commit
7ce3755c
authored
Jul 15, 2019
by
Roque
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new command to set data lake url
parent
3e8f03c5
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
3 deletions
+45
-3
ebulk
ebulk
+42
-2
ebulk-data/embulk-wendelin-dataset-tool/lib/embulk/wendelin_client.rb
...mbulk-wendelin-dataset-tool/lib/embulk/wendelin_client.rb
+1
-0
ebulk-data/help.md
ebulk-data/help.md
+2
-1
No files found.
ebulk
View file @
7ce3755c
#! /usr/bin/env bash
DOWN_URL
=
'https://softinst104003.lhost.vifib.net/erp5/'
ING_URL
=
'https://softinst104003.lhost.vifib.net/erp5/portal_ingestion_policies/wendelin_embulk'
DATA_LAKE_URL
=
'https://softinst104003.lhost.vifib.net/erp5/'
DOWN_URL
=
"
$DATA_LAKE_URL
/"
ING_URL
=
"
$DATA_LAKE_URL
/portal_ingestion_policies/wendelin_embulk"
EBULK_VERSION
=
"0.9.7"
EBULK_DATA_PATH
=
~/.ebulk
...
...
@@ -12,6 +14,7 @@ DISCARD_CHANGES_FILE_NAME="/.discard-changes"
LOG_DIR
=
"
$EBULK_DATA_PATH
/logs"
STATUS_FILE
=
"
$EBULK_DATA_PATH
/.status"
CREDENTIALS_FILE
=
"
$EBULK_DATA_PATH
/.credentials"
DATA_LAKE_URL_FILE
=
"
$EBULK_DATA_PATH
/.data-lake-url"
CONFIG_FILE
=
"
$EBULK_DATA_PATH
/.config"
DESCRIPTION_DATASET_PATH_PREFIX
=
"
$EBULK_DATA_PATH
/.dataset-description"
DESCRIPTION_DATASET_PENDING_PATH_PREFIX
=
"
$EBULK_DATA_PATH
/.dataset-description-pending"
...
...
@@ -40,6 +43,15 @@ RESUME="R"
DOWNLOAD
=
"D"
ASK
=
"A"
# load data lake url from file if exists
if
[
-f
"
$DATA_LAKE_URL_FILE
"
]
;
then
URL
=
$(
cat
"
$DATA_LAKE_URL_FILE
"
2>/dev/null
)
if
[[
"
$URL
"
!=
""
]]
;
then
DOWN_URL
=
"
$URL
/"
ING_URL
=
"
$URL
/portal_ingestion_policies/wendelin_embulk"
fi
fi
function
helpReadme
{
echo
-e
"[INFO] For help, please run '
${
GREEN
}
ebulk --help
${
NC
}
'"
echo
-e
"[INFO] For README, please run '
${
GREEN
}
ebulk --readme
${
NC
}
'"
...
...
@@ -194,6 +206,28 @@ function storeCredentials {
echo
"
$USER
;
$pwd
"
>
"
$CREDENTIALS_FILE
"
2>/dev/null
}
function
setDataLakeUrl
{
echo
echo
"Please, enter your data lake url:"
echo
echo
"URL:"
read
-e
URL
re
=
'(https?|ftp|file)://[-A-Za-z0-9\+&@#/%?=~_|!:,.;]*[-A-Za-z0-9\+&@#/%=~_|]'
if
!
[[
$URL
=
~
$re
]]
;
then
echo
echo
-e
"
${
ORANGE
}
[ERROR] Invalid url. Please make sure to enter a full url. e.g. https://my_data_lake.org/erp5"
echo
-e
"[INFO] Please enter a valid url.
${
NC
}
"
echo
>
&2
;
return
1
fi
echo
"
$URL
"
>
"
$DATA_LAKE_URL_FILE
"
2>/dev/null
}
function
defaultDataLakeUrl
{
echo
""
>
"
$DATA_LAKE_URL_FILE
"
2>/dev/null
DOWN_URL
=
"
$DATA_LAKE_URL
/"
ING_URL
=
"
$DATA_LAKE_URL
/portal_ingestion_policies/wendelin_embulk"
}
function
updateConfigFile
{
if
[
"
$STORAGE
"
!=
""
]
;
then
echo
...
...
@@ -584,6 +618,12 @@ while [ "$1" != "" ]; do
store-credentials
)
storeCredentials
exit
;;
set-data-lake-url
)
setDataLakeUrl
exit
;;
default-data-lake-url
)
defaultDataLakeUrl
exit
;;
configure
)
configure
exit
;;
...
...
ebulk-data/embulk-wendelin-dataset-tool/lib/embulk/wendelin_client.rb
View file @
7ce3755c
...
...
@@ -223,6 +223,7 @@ class WendelinClient
rescue
Exception
=>
e
puts
@logger
.
error
(
"HTTP ERROR: "
+
e
.
to_s
,
print
=
TRUE
)
@logger
.
error
(
"During request to "
+
uri
.
hostname
.
to_s
,
print
=
TRUE
)
@logger
.
error
(
e
.
backtrace
)
if
e
.
to_s
.
include?
"handshake_failure"
or
e
.
to_s
.
include?
"protocol_version"
@logger
.
error
(
"This issue could be due to a cipher or certificates problem, please check your frontend instance or try with a http url"
,
print
=
TRUE
)
...
...
ebulk-data/help.md
View file @
7ce3755c
...
...
@@ -17,6 +17,8 @@ commands:
-r, --readme Opens README file
-e, --examples Shows some tool usage examples
store-credentials Stores user and password for automatic authentication
set-data-lake-url Sets the data lake url where to ingest/download
default-data-lake-url Sets the data lake url to default
config Allows user to set tool automatic actions
argument:
...
...
@@ -38,4 +40,3 @@ options:
-a, --advanced Allows to edit the Embulk cofiguration file of the input storage
-dc, --discard-changes Discards local changes by checking the remote dataset
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment