Let's pretend I have a R script called foo.R that outputs a CSV file. I'd like to schedule foo.R to run 1x per day. I found that I should create a YAML file and then schedule it via the Bitbucket GUI per this article.
My YAML file looks like this:
pipelines:
custom:
foo-pipeline: # The name displayed in the Bitbucket Cloud GUI
- step:
script:
- echo "Starting Bitbucket Pipeline!"
- sudo Rscript -e "/file/path/to/foo.R"
- echo "Bitbucket Pipeline complete!"That receives and error with this message -- sudo: Rscript: command not found.
I'm not sure how to figure this out and would love advice. Thanks!
Thanks to Gonchik and some investigation, I figured this out. The YAML looks like this --
image: rocker/tidyverse
pipelines:
custom:
foo-pipeline: # The name displayed in the Bitbucket Cloud GUI
- step:
script:
- Rscript "file/path/to/foo.R"
- git add "file/path/to/foo.csv"
- git commit -m "[Pipeline] Add foo CSV file."
- git push
Works great and automatically pushes the CSV file into the repo I'm working in.
Hi!
Have you determine the your Docker image with rscript?
https://confluence.atlassian.com/bitbucket/get-started-with-bitbucket-pipelines-792298921.html
https://confluence.atlassian.com/bitbucket/use-docker-images-as-build-environments-792298897.html
Cheers,
Gonchik Tsymzhitov
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
At first, I mistakenly thought I could use the Default but that's not the case since it doesn't include R. I'll try using the rocker/tidyverse one and see if that does the trick.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.