Developer forum

Forum » Dynamicweb 10 » Can I use the CLI to deploy files to dw cloud?

Can I use the CLI to deploy files to dw cloud?

Justin Sjouw Dynamicweb Employee
Justin Sjouw
Reply

I'm reading the CLI documentation, but am not quite sure if I can now use this to upload files from a local environemnt (or at least an external environment in a pipeline for example) to a dw cloud environment.

The following section gives me the idea that I can, provided ofcourse that I have configured the correct environments:

To deploy from development to staging you can therefore:

  • Set environment to development
  • Use dw files to export your design to somewhere local
  • Set environment to staging
  • Use dw files to export from your local folder to the Designs-folder on staging

But this line in the specification of the export flag, gives me the idea that I cant (as it specifically mentions "on your local machine":

-e --export It will export <dirPath> into <outPath> on your local machine, unzipped by default

Thanks,

Justin


Replies

 
Frederik Nielsen Dynamicweb Employee
Frederik Nielsen
Reply
This post has been marked as an answer

Hi Justin,

The documentation is lacking in this regard, especially with proper examples, it will be updated to explain the process properly.

From what I can tell you have 2 scenarios, one where you want to upload some files from your local machine to a dw cloud environment, in that case it could be as simple as this;

> dw files -ir ./Templates Templates

The other scenario where you want to take some files from one solution to another, the process is to download the files from the first solution to a local destination, then uploading those to the destination solution - we can do this 2 different ways, first would be setting the environment to your development solution and downloading the files;

> dw env development
> dw files -efr Templates .

After this, we can now change the environment to stagning and upload the files;

> dw env staging
dw files -ir ./Templates Templates

 

The other option is to skip using environments at all (in the case of using a pipeline) we can define the host and apikey directly in the commands, so it could look like this;

> dw files -efr Templates . --host <exportSolutionHost> --apiKey <exportSolutionApiKey>

> dw files -ir ./Templates Templates --host <importSolutionHost> --apiKey <importSolutionApiKey>

 

I hope this makes sense. 

 

 

//Frederik

Votes for this answer: 1

 

You must be logged in to post in the forum