FTP-Deploy-Action icon indicating copy to clipboard operation
FTP-Deploy-Action copied to clipboard

Is there any way to create state file manually ?

Open Rahul7raj opened this issue 1 year ago • 4 comments

First version of my app is already deployed on server. now I want to deploy only updated files. so is there any way to create state file manually or through command ?

Rahul7raj avatar Jun 25 '24 16:06 Rahul7raj

By default this action only uploads changed files to the server, unless you have set dangerous-clean-slate to true, so it shouldn't be necessary to create the state file manually or use a command

Trainax avatar Jun 27 '24 09:06 Trainax

well, in our case, by default it is trying to update all files on first run. we even tried with explicitly stating dangerous-clean-slate to false (even though false is the default value). we have raised and issue to have option for first run.

Sterlites avatar Aug 19 '24 10:08 Sterlites

I've managed to get current state contents by using PowerShell to list directories and files. Every file detail includes its full name ($_.FullName), its size ($_.Length) and its SHA-256 hash ({ Get-FileHash -Algorithm SHA256 $_ }.Hash):

{
    "description": "DO NOT DELETE THIS FILE. This file is used to keep track of which files have been synced in the most recent deployment. If you delete this file a resync will need to be done (which can take a while) - read more: https://github.com/SamKirkland/FTP-Deploy-Action",
    "version": "1.0.0",
    "generatedTime": 1725909769351,
    "data": [
        {
            "type": "folder",
            "name": "subdomains"
        },
        {
            "type": "folder",
            "name": "subdomains/my-site"
        },
        {
            "type": "file",
            "hash": "49de76e8a055e96a892597482c386828fc181996942959393cf8279cc8026211",
            "name": "subdomains/my-site/index.html",
            "size": 3537
        }
    ]
}

I've not yet tested a new deploy on it because I'm exploring the way to get repository tag containing version number to be set as the version value in state file.

LS-CR avatar Sep 10 '24 06:09 LS-CR

I've written a small script for this: https://gist.github.com/mifka01/4b4f1175c5f58ca8c437770371652367 It's not tested enought tho.

mifka01 avatar Mar 05 '25 10:03 mifka01