Jenkins pack delete all directories from folder except 1

Asked

Viewed 221 times

0

I have the directory structure like this

  • ${src.web.dir}/templates/assets_clients/
    • cliente1
    • cliente2
    • cliente3

I need to remove all internal folders including . svn minus the cliente3 folder and its files and directories (cliente3 is ${env.PASTA_ASSETS})

my xml build.

<target name="pack" depends="config">

    <echo message="Retirando pastas de Clientes..." />

    <delete includeEmptyDirs="true" >
        <fileset dir="${src.web.dir}/templates/assets_clientes/" >
            <include name="**/*" />
            <exclude name="." />
            <exclude name="${env.PASTA_ASSETS}" />
        </fileset>
    </delete>

    <zip destfile="${nome.arquivo}">
        ....
    </zip>
</target>
  • Question should be in English.

  • I don’t understand the reason but ok, it’s in Portuguese.

  • Because the language of the site is Português. If you want to ask questions in English, it should be in the Stack in English: https://stackoverflow.com

1 answer

0


The best way I could was this:

<delete includeEmptyDirs="true" >
        <fileset dir="${src.web.dir}/templates/assets_clientes" includes="**/*" defaultexcludes="false">
            <exclude name="**${env.PASTA_ASSETS}/**/*" />
        </fileset>
    </delete>

    <zip destfile="${nome.arquivo}">
     ...

But the . svn files continue... but my problem has been solved.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.