Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DISCOS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
INAF
DISCOS
Commits
38708a6a
Commit
38708a6a
authored
4 months ago
by
Giuseppe Carboni
Browse files
Options
Downloads
Patches
Plain Diff
Removed unnecessary script for CI
parent
6fe21d90
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
.github/utils/upload_to_gdrive.py
+0
-31
0 additions, 31 deletions
.github/utils/upload_to_gdrive.py
with
0 additions
and
31 deletions
.github/utils/upload_to_gdrive.py
deleted
100755 → 0
+
0
−
31
View file @
6fe21d90
#!/usr/bin/env python
from
google.oauth2.credentials
import
Credentials
from
google.auth.transport.requests
import
Request
from
googleapiclient.discovery
import
build
from
googleapiclient.http
import
MediaFileUpload
import
os
TOKEN_FILE
=
'
token.json
'
VM_FILE_PATH
=
'
/home/runner/discos_manager.ova
'
SCOPES
=
[
'
https://www.googleapis.com/auth/drive
'
,
'
https://www.googleapis.com/auth/drive.file
'
]
# Authenticate with the token and eventually update it
creds
=
Credentials
.
from_authorized_user_file
(
TOKEN_FILE
,
SCOPES
)
if
creds
.
expired
and
creds
.
refresh_token
:
creds
.
refresh
(
Request
())
# Prepare the files to be uploaded
service
=
build
(
'
drive
'
,
'
v3
'
,
credentials
=
creds
)
vm_media
=
MediaFileUpload
(
VM_FILE_PATH
,
resumable
=
True
)
service
.
files
().
update
(
fileId
=
os
.
environ
.
get
(
'
DEPLOYED_VM_GDRIVE_ID
'
),
media_body
=
vm_media
,
fields
=
'
id
'
).
execute
()
# Finally update the token file
with
open
(
TOKEN_FILE
,
'
w
'
)
as
tokenfile
:
tokenfile
.
write
(
creds
.
to_json
())
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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