Hello Community,
I'm having a problem with bitbucket pipelines, I need to build and deploy a docker image to my kubernetes cluster at DigitalOcean, but I can't get success with that because the pipe atlassian/kubectl-run:1.1.2 is not working properly. I read the documentation of this pipe and followed the exemples described, but I can't get success with that because the pipe throws an error in line 100 of pipe.py. Considering that I do not use python in my application, and the error showing in the logs don't tell me what is wrong I can't get the deploy working and I don't know why... I need some help with this.
My pipeline config (edited of course):
image: atlassian/default-image:2
pipelines:
default:
- step:
name: Build fresh image and push to Amazon ECR
script:
# build the image
- docker build -t my-app --build-arg APP_ENV=$APP_ENV .
# use the pipe to push the image to AWS ECR
- pipe: atlassian/aws-ecr-push-image:1.1.0
variables:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION
IMAGE_NAME: my-app
- step:
name: Deployment in mokyun-kubernetes-nyc3-digitalocean
deployment: production
script:
- pipe: atlassian/kubectl-run:1.1.2
variables:
KUBE_CONFIG: $MOKYUN_KUBERNETES
KUBECTL_COMMAND: 'apply'
RESOURCE_PATH: '.kube-deployment/'
(I think the yaml will break because of code block, in original file, it's a valid yaml)
In the config, I have two steps, one for build and test the docker image and push to Amazon ECR, and another for deploying in DigitalOcean's Kubernetes Cluster. The docker image builds and push normally as expected, but the step to deploy on kubernetes do not work. The error occurs after pipe clone the atlassian/kubectl-run:1.1.2 and try to run pipe.py.
Here the log of the error:
Status: Downloaded newer image for bitbucketpipelines/kubectl-run:1.1.2
Traceback (most recent call last):
File "/pipe.py", line 121, in <module>
pipe.run()
File "/pipe.py", line 107, in run
self.configure()
File "/pipe.py", line 100, in configure
with open('config', 'w+') as kube_config:
IsADirectoryError: [Errno 21] Is a directory: 'config'
Searching for files matching artifact pattern .bitbucket/pipelines/generated/pipeline/pipes/**
Searching for test report files in directories named [test-results, failsafe-reports, test-reports, surefire-reports] down to a depth of 4
Finished scanning for test reports. Found 0 test report files.
Merged test suites, total number tests is 0, with 0 failures and 0 errors.
I read the pipe source at bitbucket, but I can't tell what is wrong here, I need some help with this!