Sync Code CloudThis extension allows you to automatically synchronize your source code files with AWS S3 or Google Cloud Storage (GCS) buckets. It is a great way to backup your code, sync code between your computers and laptops. Features
RequirementsYou need to have an AWS account or a Google Cloud account to use this extension. Extension SettingsCreate a .synccode.json file in the root of your project. Here are the options that you can set in .synccode.json file: projectName: Your project name. Make sure each of your projects has a different name, or otherwise they will overwrite each other. provider: The value can be either "AWS" or "GCP" depending on which cloud provider you are using. credentials: An array of paths to credentials. The extension will check every path until it finds an existing file. If none of the paths exist, it will throw an error. AWS credentials file should be in the following format:
Since Assume Role will be expired after a while, it is recommended to use a user credentials with the least previllage. You can create a new user in IAM and assign it the "AmazonS3FullAccess" policy. Then, create an access key for that user and use it in the credentials file. for GCP, you can use a service account key file. You can create a new service account in IAM and assign it the "Storage Admin" role. Then, create a key file for that service account and use it in the credentials file. bucketName: The name of the bucket where you want to store your code. region: The region where your bucket is located (required for AWS, optional for GCP). useGitBranchName: If you have a git project, you can set this to true to backup each branch separately. If you set this to false, it will backup all branches in the same folder. exclude: An array of files and folders that you want to exclude from the backup. Example of .synccode.json file for AWS:
Example of .synccode.json file for GCS:
CommandsThis extension provides the following commands to help you manage your code synchronization with cloud storage: SyncCodeCloud: Download and Replace Files from StorageThis command downloads the latest versions of your files from the specified storage bucket (AWS S3 or Google Cloud Storage) and replaces your local files with the downloaded versions. The command takes into account the exclude paths specified in the .synccode.json file. If the useGitBranchName setting is enabled, it will use the current Git branch name as a folder name in the storage bucket. Usage: Press Ctrl+Shift+P (or Cmd+Shift+P on Mac) to open the Command Palette, then type SyncCodeCloud: Sync Code between cloud and localThis command synchronizes your local files with the cloud storage. It automatically detects any changes between your local files and the latest versions in the storage bucket, then uploads new or modified local files to the cloud and downloads new or modified files from the cloud. Usage: Press Ctrl+Shift+P (or Cmd+Shift+P on Mac) to open the Command Palette, then type SyncCodeCloud: Upload All Files to StorageThis command uploads all files in your workspace to the specified storage bucket (AWS S3 or Google Cloud Storage), taking into account the exclude paths specified in the .synccode.json file. If the useGitBranchName setting is enabled, it will use the current Git branch name as a folder name in the storage bucket. Usage: Press Ctrl+Shift+P (or Cmd+Shift+P on Mac) to open the Command Palette, then type License: Please see the LICENSE.txt file in the root of this extension. Enjoy! Copyright © 2023 Soli Technology LLC. All rights reserved. |