I have a bunch of microservices and they all need to go through the same basic steps of format code, build, test and deploy.
I'm trying to create a custom pipe for formatting all the code as a starting point.
The thing I'm getting stuck on is how do you get the src code mounted in the Pipe that you are trying to use? Is there a way to mount a volume when creating a Pipe?
Sorry if that's not very clear, I am a little new to all this.
So in my python-formatting-pipe repo I have:
Dockerfile
FROM python
.6-slim
WORKDIR /app/
COPY pipe.py requirements.txt ./
RUN pip install -r requirements.txt
ENTRYPOINT ["python3", "pipe.py"]
pipe.py
src_dir = pipe.get_variable("DIRECTORY")
subprocess.check_call(["autoflake", "-r", f"{src_dir}", "--in-place", "--remove-all-unused-imports", "--exclude=__init__.py"])and in a separate repo I have a bitbucket pipeline that calls
- pipe: python-formatting-pipe
variables:
DIRECTORY: "."