How do I synch a file from the agent to the server and then make it an artifact?

On my agent I have a directory from a build


It has __variables and source directories.  I use a script and manually copy a file called compile.txt to that same directory during one of my stages.  I want to make compile.txt an artifact that I can download from the server.  Do I need to make two rules, one to sync the file from the agent to the server, and then another to make it an artifact?

I've been pulling my hair out trying to figure out these rules.

What is the workspace rule I need to add to copy c:\CI_AWS\Ws\XXXX\compile.txt to the server, and then what is the artifact rule so I can see this file in my build history?

Hi Mike,

You can use the following workspace rule to copy the file compile.txt from the folder XXXX under the agent workspace to the folder YYYY under the server workspace.

/YYYY < /XXXX/compile.txt

The artifact rule would then be:

text | YYYY\compile.txt

Hi Mike,

I just reread your post and you are obviously using XXXX to refer to the build id part of the workspace folder and your compile.txt file is in the root of this folder. The workspace rule to copy this file from the root of the agent workspace to the root of the server workspace would be :

/ < /compile.txt

The artifact rule would be:

text | compile.txt

Note that the folder C:\CI_AWS\Ws\323 on your agent is the workspace folder for the build with id 323 and can be referred to using $Workspace$ in actions etc. The workspace rules are rooted at this folder so / in the workspace rules maps to C:\CI_AWS\Ws\323 on the agent when running build 323. 
1 Like

Worked perfectly. Thanks!

1 Like

How can I tell FB8, that is running on the agent (by the agent)
What is the current Agent WS folder path, so FB8 could then copy files to the agent WS?

My goal is the same:

  1. Server --> Run Agent
  2. Agent --> Run FB8 (same as “script” in Mike’s case above me)
  3. FB8 generates an output file on some local path
  4. I want FB8 to copy output file(s) to the Agent WS, so later #5 & #6 can happen.
  5. Workspace rules to copy output files to server
  6. Artifact rules to register the output files as artifacts.

So my only problem is with #4
I can configure a variable on CCI and pass it to FB8
I’m trying to find a built in CCI Variable that holds the agent’s WS path,
But nothing of relevant use seems to be accessible from the

In Continua, $WORKSPACE$ denotes the build workspace folder on the agent.

In the Continua CI FinalBuilder action, you can pass this value to an FB variable in the Variables tab, e.g


Have a read of this blog post - - it has some suggestions for configuring projects so that they run the same whether FB is running under Continua CI (or other CI servers) or stand alone.