Spaces:
Sleeping
Sleeping
Nicky Nicolson
commited on
Commit
·
3568671
1
Parent(s):
78b4861
add test secret
Browse files- Dockerfile +2 -1
- downloadartifact.py +6 -0
Dockerfile
CHANGED
@@ -26,7 +26,8 @@ RUN --mount=type=secret,id=GREETING,mode=0444,required=true cat /run/secrets/GRE
|
|
26 |
COPY ./downloadartifact.py /code
|
27 |
RUN --mount=type=secret,id=GH_TOKEN,mode=0444,required=true ls -ltrah /run/secrets/GH_TOKEN
|
28 |
RUN --mount=type=secret,id=GH_TOKEN,mode=0444,required=true \
|
29 |
-
|
|
|
30 |
RUN ls -l /code
|
31 |
|
32 |
# Download ID is set as a space variable
|
|
|
26 |
COPY ./downloadartifact.py /code
|
27 |
RUN --mount=type=secret,id=GH_TOKEN,mode=0444,required=true ls -ltrah /run/secrets/GH_TOKEN
|
28 |
RUN --mount=type=secret,id=GH_TOKEN,mode=0444,required=true \
|
29 |
+
--mount=type=secret,id=GREETING,mode=0444,required=true \
|
30 |
+
python /code/downloadartifact.py ${IHDELTA_DB_ARTIFACT_URL} /run/secrets/GREETING /run/secrets/GH_TOKEN /code/ihdelta.db.zip
|
31 |
RUN ls -l /code
|
32 |
|
33 |
# Download ID is set as a space variable
|
downloadartifact.py
CHANGED
@@ -23,11 +23,17 @@ def getArtifact(artifactUrl, gh_tokenfile, outputfile):
|
|
23 |
|
24 |
def main():
|
25 |
parser = argparse.ArgumentParser(description='Download artifact from github')
|
|
|
26 |
parser.add_argument('url', help='url for the artifact building run')
|
27 |
parser.add_argument('gh_tokenfile', help='authentication token')
|
28 |
parser.add_argument('outputfile', help='where to store downloaded file')
|
29 |
|
30 |
args = parser.parse_args()
|
|
|
|
|
|
|
|
|
|
|
31 |
artifact_url = getArtifactUrl(args.url)
|
32 |
print(artifact_url)
|
33 |
getArtifact(artifact_url, args.gh_tokenfile, args.outputfile)
|
|
|
23 |
|
24 |
def main():
|
25 |
parser = argparse.ArgumentParser(description='Download artifact from github')
|
26 |
+
parser.add_argument('greetingfile', help='a test secret')
|
27 |
parser.add_argument('url', help='url for the artifact building run')
|
28 |
parser.add_argument('gh_tokenfile', help='authentication token')
|
29 |
parser.add_argument('outputfile', help='where to store downloaded file')
|
30 |
|
31 |
args = parser.parse_args()
|
32 |
+
print(args.greetingfile)
|
33 |
+
with open(args.greetingfile, 'r') as f:
|
34 |
+
greeting = f.read()
|
35 |
+
print('Read greeting secret: {}'.format(greeting))
|
36 |
+
|
37 |
artifact_url = getArtifactUrl(args.url)
|
38 |
print(artifact_url)
|
39 |
getArtifact(artifact_url, args.gh_tokenfile, args.outputfile)
|