memiiso/pyliquibase

Try to change download of Java libraries jar files on package installation itself

Closed this issue · 9 comments

We have control of GitHub access, can't download it.
So please I suggest to change the code the way downloading of Java jar files while installing the package itself (pip install pyliquibase), not on run of pyliquibase cmd.
Will be easy to handle, on one time installation of dependencies.

Could you please respond to this ticket

@mmadhuhasa it should be possible.

as a workaround while installing the package itself you can also run pyliquibase to trigger the download.

pip pyliquibase
# follwoing command should do the  downloading of Java jar files
pyliquibase --defaultsFile=changelogs/liquibase.properties status

I still facing issue on run cmd in docker,

RUN pyliquibase --defaultsFile=changelogs/liquibase.properties status

0.579 2023-10-03 12:16:38,969 WARNING Downloading Liquibase version: 4.21.1

0.580 2023-10-03 12:16:38,970 INFO - Downloading https://github.com/liquibase/liquibase/releases/download/v4.21.1/liquibase-4.21.1.zip to /usr/src/app/test venv/lib/python3.9/site 1.189 2023-10-03 12:16:39,579 - ERROR - Failed to download https://github.com/liquibase/liquibase/releases/download/v4.21.1/liquibase-4.21.1.zip

1.189 Traceback (most recent call last):

1.189 File "/usr/local/lib/python3.9/urllib/request.py", line 1346, in do open

1.190 self. send request (method, url, body, headers, encode chunked 1.190 File "/usr/local/lib/python3.9/http/client.py", line 1331, in send request

)

1.190 self.endheaders (body, encode chunked-encode chunked)

1.190 File "/usr/local/lib/python3.9/http/client.py", line 1280, in endheaders 1.191 self. send output (message body, encode chunked-encode chunked)

1.191 File "/usr/local/lib/python3.9/http/client.py", line 1040. In send output

1.191 self.send(msg)

1.191 File "/usr/local/lib/python3.9/http/client.py", line 980, in send 1.191 self.connect()

1.191 File "/usr/local/lib/python3.9/http/client.py", line 1454, in connect 1.192 self.sock-self. context.wrap socket (self.sock,

1.192 File "/usr/local/lib/python3.9/ss1.py", line 501, in wrap socket 1.192 return self.sslsocket class. create(

1.192 File "/usr/local/lib/python3.5/ss1.py", line 1074, in create 1.192 self.do handshake ()

1.192 File "/usr/local/lib/python3 . 9/ss1.py", line 1343, in do handshake 1.192 self._sslobj.do handshake ()

1.192 ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)

Where this cmd works, can able to download project,
RUN wget https://github.com/liquibase/liquibase.git

But below cmd is shows similar SSL errors,
RUN wget https://github.com/liquibase/liquibase/releases/download/v4.21.1/liquibase-4.21.1.zip

Could you please help us with this issue

@mmadhuhasa

one option is to install liquibase with Dockerfile

# Install liquibase
RUN apt-get install -y wget unzip && \
    apt-get clean;
RUN wget -q https://github.com/liquibase/liquibase/releases/download/v4.21.1/liquibase-4.21.1.zip
RUN unzip liquibase-4.21.1.zip -d /opt/liquibase
RUN wget https://github.com/liquibase/liquibase-databricks/releases/download/v1.0.1/liquibase-databricks-1.0.1.jar \
    -P /opt/liquibase/lib/

then use it as

# user provided liquibase directory
liquibase = Pyliquibase(defaultsFile="changelogs/liquibase.properties", liquibaseDir="/opt/liquibase")
liquibase.status()

Thanks for the response, we will apply your solution and check,

And one clarification,
/opt/liquibase instead this path, we can use other path also like /var/liquibase
Is that right ?

Correct, any path should work.

Consolidation,
Requested to download dependent liquibase jar files on installation of package ( pip install pyliquibase ),
As mentioned in comment #61 (comment)

But suggested response is to download and copy the jar files manually and map to it, mentioned on comment

#61 (comment)

Above solution is working, thanks for the support