0
votes

I have developed a PHP site in Eclipse on localhost and have just transferred it to a GCP Compute Engine instance. To do this I've had to upload the site to a Storage Bucket and then on the SSH Shell for the instance in GCP used gsutil to transfer the files.

Now, as far as editting goes, is there a way for me to connect eclipse to the GCP instance and edit via Eclipse?

I don't want to have to, for every tweak, upload to the storage bucket and then copy file across to the instance. This would be most tedious.

I have created a firewall rule on the network to allow all traffic from my public IP to the Compute Engine instance (until I can lock it down once I've got the connection)

Thanks

2

2 Answers

1
votes

This article describes a procedure to editing remote files in Eclipse:

http://www.chrisdanford.com/blog/2010/05/19/edit-files-directly-over-sftp-in-eclipse-remote-system-explorer/

Quoting that article:

From Eclipse: Help -> Install New Software. “Work with: -All available sites-“. In the search box type “remote system”. Check “Remote System Explorer End-User Runtime”, click Next to proceed with the install. After the wizard completed, click Window -> Open Perspective -> Remote System Explorer. Right-click in Remote Systems, choose New Connection, type in your details. After you connect, expand “Sftp Files” and you’ll be able to open remote files in the editor.

1
votes

You can forward ports over SSH using the gcloud sdk

gcloud compute ssh example-instance \ --project my-project \ --zone us-central1-a \ -- -L 2222:localhost:8888

Once you have this setup you can connect direct in Eclipse

See details:

https://cloud.google.com/solutions/connecting-securely#Port%20forwarding%20over%20SSH