Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
Theia stack
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
esa-common
che7
stacks
Theia stack
Commits
bc4adbd2
Commit
bc4adbd2
authored
3 years ago
by
edupin
Browse files
Options
Downloads
Patches
Plain Diff
Update maap S3 script
parent
0a2026c4
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
buildEclipseStack.sh
+1
-1
1 addition, 1 deletion
buildEclipseStack.sh
maap-s3.py
+25
-1
25 additions, 1 deletion
maap-s3.py
with
26 additions
and
2 deletions
buildEclipseStack.sh
+
1
−
1
View file @
bc4adbd2
#zip -r Project_template.zip Project_template
export
VERSION
=
0.
3
export
VERSION
=
0.
4
docker build
-t
kosted/bmap-stack:
$VERSION
.
docker run
--rm
kosted/bmap-stack:
$VERSION
pip freeze
docker push kosted/bmap-stack:
$VERSION
...
...
This diff is collapsed.
Click to expand it.
maap-s3.py
+
25
−
1
View file @
bc4adbd2
...
...
@@ -33,6 +33,7 @@ def display_help():
print
(
'
list folder/path List data in a subfolder
'
)
print
(
'
delete path/in/S3/file.tiff Delete an existing data on S3
'
)
print
(
'
refresh Refresh credentials and password
'
)
print
(
'
token email password Return a bearer token
'
)
print
(
'
resume Resume last interrupted multipart upload
'
)
sys
.
exit
(
2
)
...
...
@@ -114,6 +115,23 @@ def generate_token(email, password):
sys
.
exit
(
2
)
################################
# Generate token and return it #
###############################
def
get_token
(
email
,
password
):
#print("[INFO] Start retrieving token for authent")
#Set the bearer
url
=
"
https://iam.
"
+
MAAP_ENV_TYPE
.
lower
()
+
"
.esa-maap.org/oxauth/restv1/token
"
response
=
requests
.
post
(
url
,
data
=
{
'
client_id
'
:
CLIENT_ID
,
'
username
'
:
email
,
'
password
'
:
password
,
"
grant_type
"
:
"
password
"
,
"
scope
"
:
"
openid+profile
"
})
#Convert the string to json to fecth access_token
data
=
json
.
loads
(
response
.
text
)
token
=
data
[
'
access_token
'
]
print
(
token
)
return
token
#########################
# Check if file is older#
#########################
...
...
@@ -481,7 +499,7 @@ argv = sys.argv[1:]
result
=
0
try
:
if
len
(
argv
)
==
0
:
display_help
()
else
:
...
...
@@ -501,6 +519,12 @@ try:
display_help
()
else
:
delete
(
argv
[
1
])
elif
argv
[
0
]
==
'
token
'
:
# Delete a data
if
len
(
argv
)
!=
3
:
display_help
()
else
:
get_token
(
argv
[
1
],
argv
[
2
])
elif
argv
[
0
]
==
'
download
'
:
# Download a data
if
len
(
argv
)
!=
3
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment