jfrog-azure-devops-extension icon indicating copy to clipboard operation
jfrog-azure-devops-extension copied to clipboard

syncDeletesRemote is not adding required switch

Open mgzenitech opened this issue 3 years ago • 2 comments

yaml:

  - task: JFrogGenericArtifacts@1
    inputs:
      command: Upload
      connection: ...
      specSource: taskConfiguration
      fileSpec: |
        {
          "files": [
            {
              "pattern": ".../(*)",
              "target": ".../{1}",
              "flat": "false"
            }
          ]
        }
      threads: 8
      preserveSymlinks: True
      syncDeletesRemote: True
    displayName: ...

log from agent:

Executing JFrog CLI Command: /opt/hostedtoolcache/jf/2.12.1/x64/jf rt u --dry-run=false --symlinks=true --server-id="Frontend_Frontend_generic_1645097805746" --spec="/home/vsts/work/1/s/genericSpec1645097805881.json" --fail-no-op=true --insecure-tls=false --threads=8 --retries=3

mgzenitech avatar Feb 17 '22 11:02 mgzenitech

Hi @mgzenitech, Thanks for reaching out. To pass the sync deletes path you should also use the 'syncDeletesPathRemote' string params. In case you are using the UI, that is the "Sync path:" field. Screen Shot 2022-02-17 at 17 36 43

Let us know if it helped. Anyway, we will have a second look at the above flow and see if it can be improved.

sverdlov93 avatar Feb 17 '22 16:02 sverdlov93

Hi @sverdlov93 ! Oh, ok thanks for the info. However job always deletes everything if I not add slash (/) to the end of syncDeletesPathRemote. If I add slash however nothing is deleted... Is this known issue? or should I use glob pattern here?

syncDeletesPathRemote: ${{ parameters.Options.RepositoryName }}/${{ parameters.RemotePath }}/**/*

For example does not delete anything:

  - task: JFrogGenericArtifacts@1
    inputs:
      command: Upload
      connection: ...
      specSource: taskConfiguration
      fileSpec: |
        {
          "files": [
            {
              "pattern": "${{ parameters.LocalPath }}/(*)",
              "target": "${{ parameters.Options.RepositoryName }}/${{ parameters.RemotePath }}/{1}",
              "flat": "false"
            }
          ]
        }
      threads: 8
      preserveSymlinks: True
      syncDeletesRemote: True
      syncDeletesPathRemote: ${{ parameters.Options.RepositoryName }}/${{ parameters.RemotePath }}/
    displayName: ...

log:

Executing JFrog CLI Command: /opt/hostedtoolcache/jf/2.12.1/x64/jf rt u --dry-run=false --symlinks=true --sync-deletes="npm-bin-uncontrolled/ats/ats-react-ui/external/20220218.2-develop/" --server-id="ats-react-ui_20220218.2-develop_generic_1645182236371" --spec="/home/vsts/work/1/s/genericSpec1645182236510.json" --fail-no-op=true --insecure-tls=false --threads=8 --retries=3
11:03:56 [Info] [Thread 7] Uploading artifact: services/external/build/static/js/main.bebdeaa1.js.map
11:03:56 [Info] [Thread 0] Uploading artifact: services/external/build/static/js/main.bebdeaa1.js.LICENSE.txt
11:03:56 [Info] [Thread 1] Uploading artifact: services/external/build/static/js/main.bebdeaa1.js
11:03:56 [Info] [Thread 2] Uploading artifact: services/external/build/static/js/110.3751af36.chunk.js.map
11:03:56 [Info] [Thread 3] Uploading artifact: services/external/build/static/js/110.3751af36.chunk.js
11:03:56 [Info] [Thread 4] Uploading artifact: services/external/build/static/css/main.073c9b0a.css.map
11:03:56 [Info] [Thread 5] Uploading artifact: services/external/build/static/css/main.073c9b0a.css
11:03:56 [Info] [Thread 6] Uploading artifact: services/external/build/robots.txt
11:03:56 [Info] [Thread 2] Uploading artifact: services/external/build/manifest.json
11:03:56 [Info] [Thread 7] Uploading artifact: services/external/build/logo512.png
11:03:56 [Info] [Thread 1] Uploading artifact: services/external/build/logo192.png
11:03:56 [Info] [Thread 3] Uploading artifact: services/external/build/index.html
11:03:56 [Info] [Thread 0] Uploading artifact: services/external/build/favicon.ico
11:03:56 [Info] [Thread 5] Uploading artifact: services/external/build/asset-manifest.json
11:03:57 [Info] Searching artifacts...
11:03:57 [Info] Found 0 artifacts.
{
  "status": "success",
  "totals": {
    "success": 14,
    "failure": 0
  }
}

And if not using a slash deletes everything:

  - task: JFrogGenericArtifacts@1
    inputs:
      command: Upload
      connection: ...
      specSource: taskConfiguration
      fileSpec: |
        {
          "files": [
            {
              "pattern": "${{ parameters.LocalPath }}/(*)",
              "target": "${{ parameters.Options.RepositoryName }}/${{ parameters.RemotePath }}/{1}",
              "flat": "false"
            }
          ]
        }
      threads: 8
      preserveSymlinks: True
      syncDeletesRemote: True
      syncDeletesPathRemote: ${{ parameters.Options.RepositoryName }}/${{ parameters.RemotePath }}
    displayName: ...

log:

Executing JFrog CLI Command: /opt/hostedtoolcache/jf/2.12.1/x64/jf rt u --dry-run=false --symlinks=true --sync-deletes="npm-bin-uncontrolled/ats/ats-react-ui/external/20220218.3-develop" --server-id="ats-react-ui_20220218.3-develop_generic_1645184561595" --spec="/home/vsts/work/1/s/genericSpec1645184561713.json" --fail-no-op=true --insecure-tls=false --threads=8 --retries=3
11:42:41 [Info] [Thread 7] Uploading artifact: services/external/build/static/js/main.bebdeaa1.js.map
11:42:41 [Info] [Thread 6] Uploading artifact: services/external/build/robots.txt
11:42:41 [Info] [Thread 0] Uploading artifact: services/external/build/static/js/main.bebdeaa1.js.LICENSE.txt
11:42:41 [Info] [Thread 1] Uploading artifact: services/external/build/static/js/main.bebdeaa1.js
11:42:41 [Info] [Thread 2] Uploading artifact: services/external/build/static/js/110.3751af36.chunk.js.map
11:42:41 [Info] [Thread 3] Uploading artifact: services/external/build/static/js/110.3751af36.chunk.js
11:42:41 [Info] [Thread 4] Uploading artifact: services/external/build/static/css/main.073c9b0a.css.map
11:42:41 [Info] [Thread 5] Uploading artifact: services/external/build/static/css/main.073c9b0a.css
11:42:41 [Info] [Thread 2] Uploading artifact: services/external/build/manifest.json
11:42:41 [Info] [Thread 1] Uploading artifact: services/external/build/logo512.png
11:42:41 [Info] [Thread 7] Uploading artifact: services/external/build/logo192.png
11:42:41 [Info] [Thread 6] Uploading artifact: services/external/build/index.html
11:42:41 [Info] [Thread 4] Uploading artifact: services/external/build/favicon.ico
11:42:41 [Info] [Thread 0] Uploading artifact: services/external/build/asset-manifest.json
11:42:42 [Info] Searching artifacts...
11:42:42 [Info] Found 1 artifact.
11:42:42 [Info] [Thread 2] Deleting npm-bin-uncontrolled/ats/ats-react-ui/external/20220218.3-develop/
{
  "status": "success",
  "totals": {
    "success": 14,
    "failure": 0
  }
}

mgzenitech avatar Feb 18 '22 11:02 mgzenitech