Skip to content
This repository has been archived by the owner on Mar 10, 2024. It is now read-only.

Execute task on ubuntu #122

Closed
buckleyGI opened this issue Nov 6, 2019 · 12 comments
Closed

Execute task on ubuntu #122

buckleyGI opened this issue Nov 6, 2019 · 12 comments

Comments

@buckleyGI
Copy link

I have the task working on windows an tried the linux/ubuntu so converting backward slashes to forward slashes. That should do it I think. I get the following error however.
It's searching through the files but gets stuck on linux. Is this a supported scenario and am I forgetting something?

##[error]Failed find: ENOENT: no such file or directory, stat '/home/vsts/work/1/s/Source/Components/Selligent.Components.Albatross.AssetsData/SelligentWebComponent

`pool:
vmImage: 'ubuntu-latest'

steps:

  • task: replacetokens@3
    inputs:
    targetFiles: '**/ParanaDigital.py'
    encoding: 'auto'
    writeBOM: true
    actionOnMissing: 'warn'
    keepToken: false
    tokenPrefix: '#{'
    tokenSuffix: '}#'`
@qetza
Copy link
Owner

qetza commented Nov 8, 2019

Hi @buckleyGI ,

The task is working on linux. Could you activate diagnostic logs at the pipeline level (check the checkbox at the bottom when you run the pipeline) and share your logs?

@alexeygt
Copy link

I confirm that the task does not work on Ubuntu 16.04 with subfolders using recursive pattern. It fails trying to "read" folder as a file.

@qetza
Copy link
Owner

qetza commented Nov 11, 2019

Thanks @alexeygt, i’ll take a look.

@alexeygt
Copy link

alexeygt commented Nov 12, 2019

I am using **/* as a pattern by the way. If I specify **\* then task does not crash but it does not do anything at all - don't find any files.

@buckleyGI
Copy link
Author

Hello @qetza The log will contain some sensitive information. I'll sanitize it but how do I get it to you securely? There is no option to send a private message on gihthub.

@qetza
Copy link
Owner

qetza commented Nov 12, 2019

Hi @buckleyGI,
I'll do some testing on my side with the recursive pattern on ubuntu and if i cannot reproduce the issue i'll share an email address with you so that you can share your logs.

@qetza
Copy link
Owner

qetza commented Nov 13, 2019

Hi @buckleyGI,
I've done some testing and couldn't reproduce the issue using Azure Pipelines ubuntu-16.04 image:

##[debug]Evaluating condition for step: 'replace tokens'
##[debug]Evaluating: succeeded()
##[debug]Evaluating succeeded:
##[debug]=> True
##[debug]Result: True
##[section]Starting: replace tokens
==============================================================================
Task         : Replace Tokens
Description  : Replace tokens in files
Version      : 3.2.1
Author       : Guillaume Rouchon
Help         : v3.2.1 - [More Information](https://github.com/qetza/vsts-replacetokens-task#readme)
==============================================================================
...
##[debug]rootDirectory=/home/vsts/work/1/s/issue-122
##[debug]check path : /home/vsts/work/1/s/issue-122
##[debug]tokenPrefix=#{
##[debug]tokenSuffix=}#
##[debug]encoding=auto
##[debug]keepToken=false
##[debug]actionOnMissing=warn
##[debug]writeBOM=true
##[debug]emptyValue=(empty)
##[debug]escapeType=auto
##[debug]escapeChar=null
##[debug]charsToEscape=null
##[debug]verbosity=detailed
##[debug]targetFiles=**/ParanaDigital.py
##[debug]pattern: #\{((?:(?!\}#).)*)\}#
pattern: #\{((?:(?!\}#).)*)\}#
##[debug]defaultRoot: '/home/vsts/work/1/s/issue-122'
##[debug]findOptions.allowBrokenSymbolicLinks: 'false'
##[debug]findOptions.followSpecifiedSymbolicLink: 'true'
##[debug]findOptions.followSymbolicLinks: 'true'
##[debug]matchOptions.debug: 'false'
##[debug]matchOptions.nobrace: 'true'
##[debug]matchOptions.noglobstar: 'false'
##[debug]matchOptions.dot: 'true'
##[debug]matchOptions.noext: 'false'
##[debug]matchOptions.nocase: 'false'
##[debug]matchOptions.nonull: 'false'
##[debug]matchOptions.matchBase: 'false'
##[debug]matchOptions.nocomment: 'false'
##[debug]matchOptions.nonegate: 'false'
##[debug]matchOptions.flipNegate: 'false'
##[debug]pattern: '**/ParanaDigital.py'
##[debug]findPath: '/home/vsts/work/1/s/issue-122'
##[debug]statOnly: 'false'
##[debug]findPath: '/home/vsts/work/1/s/issue-122'
##[debug]findOptions.allowBrokenSymbolicLinks: 'false'
##[debug]findOptions.followSpecifiedSymbolicLink: 'true'
##[debug]findOptions.followSymbolicLinks: 'true'
##[debug]  /home/vsts/work/1/s/issue-122 (directory)
##[debug]  /home/vsts/work/1/s/issue-122/sub01 (directory)
##[debug]  /home/vsts/work/1/s/issue-122/sub01/appsettings.json (file)
##[debug]  /home/vsts/work/1/s/issue-122/sub01/sub11 (directory)
##[debug]  /home/vsts/work/1/s/issue-122/sub01/sub11/ParanaDigital.py (file)
##[debug]  /home/vsts/work/1/s/issue-122/sub01/sub11/appsettings.json (file)
##[debug]6 results
##[debug]found 6 paths
##[debug]applying include pattern
##[debug]adjustedPattern: '/home/vsts/work/1/s/issue-122/**/ParanaDigital.py'
##[debug]1 matches
##[debug]1 final results
replacing tokens in: /home/vsts/work/1/s/issue-122/sub01/sub11/ParanaDigital.py
##[debug]using encoding: ascii
using encoding: ascii
##[debug]MyValue=myvalue
##[debug]MyValue: myvalue
MyValue: myvalue
##[section]Finishing: replace tokens

Could you send me your sanitized logs to qetzaco at gmail dote com?

Also if you are using yaml files, could you try defining the task with - task: qetza.replacetokens.replacetokens-task.replacetokens@3

@alexeygt
Copy link

Now I see the problem. I'm trying to target any files in the folder with any extension. In your case you target specific files like *.py.
I believe if you try pattern like that: **/* then you'll reproduce the issue.

@qetza
Copy link
Owner

qetza commented Nov 17, 2019

@alexeygt,
I just released a fix in release 3.2.2 for the issue with pattern returning directory, they are now ignored :)

@buckleyGI
Copy link
Author

Thanks @qetza !

@alexeygt
Copy link

Awesome! Thanks a lot!

@qetza
Copy link
Owner

qetza commented Nov 22, 2019

@buckleyGI, do you still have your issue or does the latest vesion fixwed it?

@qetza qetza closed this as completed Jan 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants