Skip to content
mike o'brien edited this page May 25, 2016 · 5 revisions

This page is a glossary of Evergreen's supported task commands.

####shell.exec This command runs a shell script.

- command: shell.exec
  params:
    working_dir: src
    script: |
      echo "this is a 2nd command in the function!"
      ls

Parameters:

  • script: the script to run
  • working_dir: the directory to execute the shell script in
  • background: if set to true, does not wait for the script to exit before running the next commands
  • silent: if set to true, does not log any shell output during execution; useful to avoid leaking sensitive info
  • continue_on_err: if set to true, causes command to exit with success regardless of the script's exit code
  • system_log: if set to true, the script's output will be written to the task's system logs, instead of inline with logs from the test execution.

####git.get_project This command clones the tracked project repository into a given directory, and checks out the revision associated with the task. Also applies patches to the source after cloning it, if the task was created by a patch submission.

NOTE: this command currently only supports clone over SSH. Make sure your GitHub ssh keys are set up in your target distros.

- command: git.get_project
  params:
    directory: src

Parameters:

  • dir: the directory to clone into

####s3.put This command uploads a file to Amazon s3, for use in later tasks or distribution.

- command: s3.put
  params:
    aws_key: ${aws_key}
    aws_secret: ${aws_secret}
    local_file: src/mongodb-binaries.tgz
    remote_file: mongodb-mongo-master/${build_variant}/${revision}/binaries/mongo-${build_id}.${ext|tgz}
    bucket: mciuploads
    permissions: public-read
    content_type: ${content_type|application/x-gzip}
    display_name: Binaries

Parameters:

  • aws_key: your AWS key (use expansions to keep this a secret)
  • aws_secret: your AWS secret (use expansions to keep this a secret)
  • local_file: the local file to post
  • remote_file: the ec2 path to post the file to
  • bucket: the ec2 bucket to use
  • permissions: the ec2 permissions string to upload with
  • content_type: the MIME type of the file
  • display_name: the display string for the file in the Evergreen UI

####gotest.parse This command parses Go test results and sends them to the API server. It accepts files generated by saving the output of the go test -v command to a file.

E.g. In a preceding shell.exec command, run go test -v > result.suite

- command: gotest.parse_files
  params: 
    files: ["src/*.suite"]

Parameters:

  • files: a list of files (or blobs) to parse and upload

####attach.results This command parses results in Evergreen's JSON test result format and posts them to the API server.

The format is as follows:

{
    "results":[
    {
        "status":"pass",
            "test_file":"test_1",
            "exit_code":0,
            "elapsed":0.32200002670288086, //end-start
            "start":1398782500.359, //epoch_time
            "end":1398782500.681 //epoch_time
    },
    {
        "etc":"..."
    },
    ]
}
- command: attach.results
  params:
    file_location: src/report.json

Parameters:

  • file_location: a .json file to parse and upload

####attach.xunit_results This command parses results in the XUnit format and posts them to the API server.

- command: attach.xunit_results
  params:
    file: src/results.xml

Parameters:

  • file: a .xml file to parse and upload. A filepath glob can also be supplied to collect results from multiple files.
Clone this wiki locally