Initialization of the CDK project

Hi there.
I have question about initialization of the CDK project.
I use Jenkins for deploying environment. After cloning code into Jenkins workspace from repository it contains files like this:
555555
then I run command: cdktf get for getting providers
after that command: pipenv run ./main.py
I got error: Traceback (most recent call last):
File “./main.py”, line 3, in
from constructs import Construct
ModuleNotFoundError: No module named 'constructs’

Jenkins workspace does not have nesessary libraries. When I created this project on my local desktop I ran command -> cdktf init --template=“python” --local
this command installs the cdktf library so that it can be used in the project,
I can not start initialization into Jenkins workspace
I got error: ERROR: Cannot initialize a project in a non-empty directory

Is it posible to initialize all nesessary libraries into Jenkins environment by using an existing code?

There are two options for this:

  1. Run cdktf get locally and commit the imports folder.
  2. Run cdktf get on jenkins before running the code.

I would also recommend running cdktf synth rather than pipenv run ./main.py. There is functionality that is missed when not using the cli.

Thanks for your support! :raising_hand_man:

1 Like