How to write a Bamboo build script to call to a REST endpoint

481 Views Asked by At

I have this endpoint

@RequestMapping(value = "/refresh")
public DataSource getMostRecentData() {
    return s3DataStoreService.getMostRecentSource();
}

And I would like to know if it's possible to write a bamboo script that hits this endpoint, as part of the build task to build the project. I'm new to Bamboo so I would appreciate even a start on how to do this. Thank you.

1

There are 1 best solutions below

0
On

You can use the "script" task and use curl or something similar to make the REST call. You can also have a custom script on a remote server and execute it from Bamboo. If you have your plan in PlanSpec.java file, you can have method , which goes something like this :

private ScriptTask executeREST() {
        return new ScriptTask()
                .description("execute my rest endpoint")
                .inlineBody("curl call to your endpoint");
    }