Hello to all,
My problem is that I need to use Powershell with an specific modul that don't have compatibility with Linux os. Also, I can't use Windows os to build my own Pipelines.
Then I'm thinking into create a API Services and consume that through Bash. Can I consume API from docker for Bitbucket Pipeline?
@Halyna Berezovska can you help me?
Thanks! :)
@sergibarca hello!
Okay, let's go in details.
Am I right that you need to use an API?
What exactly you want to do?
You can actually defaine firstly your api as service definition (see here how to define a service in definitions block https://support.atlassian.com/bitbucket-cloud/docs/databases-and-service-containers/ )
definitions:
services:
my-awesome-api:
image: my-dockerhub/my-repository
mongo:
image:mongo
And then you can use it in step:
step:
image : ...
...
script:
- # execute bash command here
services:
- my-awesome-api
As bash command you actually can also execute some powershell commands using in your step
image: mcr.microsoft.com/powershell, and put in script lines like
pwsh -Command {your command}
but it may be limited somehow and this depends on what you're trying to do in powershell.
Perhaps in bash it would be easier for you, but this depends on what you need exactly.
How are you supposed to use API? If you just need to check urls, you can write bash script, it will be much easier, for example, using curl utility , e.g. like
curl <your_api_url>:<port>/v1/users/
Let's talk about your case.
Regards, Galyna
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.