Skip to content

Commit

Permalink
Merge pull request #11 from BD2KGenomics/feature/full_manifest
Browse files Browse the repository at this point in the history
User can now mount the folder containing the token file from anywhere…
  • Loading branch information
caaespin authored Feb 16, 2017
2 parents a850b26 + 9a936d1 commit d18ca91
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/main/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ RUN pip install \
ENV DCC_HOME /dcc
WORKDIR ${DCC_HOME}
RUN mkdir -p ${DCC_HOME}
#Making directory that contains
RUN mkdir ${DCC_HOME}/token
ADD bin ${DCC_HOME}/bin
ADD cert ${DCC_HOME}/cert
ADD lib ${DCC_HOME}/lib
Expand Down
7 changes: 6 additions & 1 deletion src/main/bin/redwood-download
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ function main {
#Seeing whether the access token is present as either a file or a by itself
accessToken=${ACCESS_TOKEN}
if [[ -z "$accessToken" ]]
then accessToken=$(cat data/${ACCESS_TOKEN_FILE})
then accessToken=$(cat token/${ACCESS_TOKEN_FILE})
if [[ -z "$accessToken" ]]
then echo "Error: Need to set environment variable ACCESS_TOKEN or ACCESS_TOKEN_FILE" && exit 1
else echo "Using ACCESS_TOKEN_FILE"
Expand Down Expand Up @@ -88,6 +88,11 @@ function main {
java ${ssl_opts} -Dmetadata.url=${metadata_server_url} -Dstorage.url=${storage_server_url} -DaccessToken=${accessToken} -jar ${DCC_HOME}/lib/icgc-storage-client-1.0.14-SNAPSHOT/lib/icgc-storage-client.jar download --output-dir ${download} --output-layout bundle --manifest data/temp.tsv --force

rm data/temp.tsv
#Change ownership of the files in data/ from root to the current user.
user=$(stat -c '%u:%g' data/)
if [[ ! -z "$user" ]]
then chown -R ${user} data/
fi
}


Expand Down
8 changes: 7 additions & 1 deletion src/main/bin/spinnaker-upload
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function main {
#Seeing whether the access token is present as either a file or a by itself
accessToken=${ACCESS_TOKEN}
if [[ -z "$accessToken" ]]
then accessToken=$(cat data/${ACCESS_TOKEN_FILE})
then accessToken=$(cat token/${ACCESS_TOKEN_FILE})
if [[ -z "$accessToken" ]]
then echo "Error: Need to set environment variable ACCESS_TOKEN or ACCESS_TOKEN_FILE" && exit 1
else echo "Using ACCESS_TOKEN_FILE"
Expand All @@ -85,6 +85,12 @@ function main {
--force-upload \
--storage-access-token ${accessToken} \
${tsv_file}
#Change ownership of the files in data/ from root to the current user.
cd ..
user=$(stat -c '%u:%g' data/)
if [[ ! -z "$user" ]]
then chown -R ${user} data/
fi
}

main "$@"

0 comments on commit d18ca91

Please sign in to comment.