gcloud copy-files

254 views
Skip to first unread message

Deepak Singh

unread,
May 2, 2016, 10:57:31 PM5/2/16
to google-a...@googlegroups.com

for the following command

gcloud compute copy-files c:/localfile.js loggeduser@instance-name:/resources/js --zone us-central-1

pscp: unable to open /resources/js: no such file or directory

What should be the correct remote destination path to upload a file to vm on war relevent path /resources/js 


--
Tech

Zeehad (Cloud Platform Support)

unread,
May 4, 2016, 3:16:14 PM5/4/16
to Google App Engine
Hello Deepak,

You'll need to use the absolute path to the destination folder on the instance. For example

gcloud compute copy-files c:/localfile.js loggeduser@instance-name:/myAwesomeApp/src/main/webapp/resources/js --zone us-central-1

You can also use relative path to the loggeduser's home directory. Assuming the home directory is /home/loggeduser and the project is at the root directory, the command for the above example will be

gcloud compute copy-files c:/localfile.js loggeduser@instance-name:../../myAwesomeApp/src/main/webapp/resources/js --zone us-central-1

It's also important to make sure that 'loggeduser' has necessary permissions, otherwise you may receive 'permission denied' errors.

I hope that helps. Cheers!

Deepak Singh

unread,
May 5, 2016, 11:59:18 AM5/5/16
to google-a...@googlegroups.com
Hi Zeehad,

We are unable to think replacement of 'myAwesomeApp' in the command as we are not deploying our app through the name.
Here is what we do - 

Our app is JAVA based GAE app.
On the app engiene command line - appcfg stage
which gives me following folder structure

_static_/resources/js
resources/js 
WEB-INF/
app.yaml
.....
.....
......

For deployment to flex env-

gcloud preview app deploy C:/folder/app.yaml 


Now let us know what would be the deployed app folder structure on the flex instance.


Regards
Tech
 

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-appengi...@googlegroups.com.
To post to this group, send email to google-a...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/5cb12664-e5d0-4c19-965b-9fdfe4dbb0e4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Deepak Singh

Zeehad (Cloud Platform Support)

unread,
May 6, 2016, 4:00:18 PM5/6/16
to Google App Engine
Since this is a user-managed instance of app engine flex environment, using 'gcloud compute copy-files' may not be the best way due to the following reasons
  • The application and its folder structure resides inside a docker container in the instance. It's possible to copy the file into the instance using gcloud but not directly into the container.
  • You can choose to copy the local file to a folder (e.g. tmp) of the instance. However, you'll then need to SSH into the instance, list the containers using 'docker ps' and then copy the file into the container containing your app using 'docker cp'.
  • Also, any other / new instances of the app will not have any files that has been copied this way since the image doesn't contain it.
The ideal way of accomplishing this will be building a Custom Runtime for the flex environment and later add new files using the Dockerfile.

Cheers!
Reply all
Reply to author
Forward
0 new messages