S
S
SideWest2019-04-14 20:17:17
Python
SideWest, 2019-04-14 20:17:17

Python.GitHub.Autoupdate script, any ideas?

I learn Python, make code, push it to my GitHube account, and then run it on another device via

git clone

But the question arose, is it possible to automate the function?
That is, when you run the code, it will itself delete the current file with the code, upload a new file from the github and run it?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Sergey Gornostaev, 2019-04-14
@sergey-gornostaev

Few of the users can enjoy such arbitrariness. Package your code , use setuptools to define an installation procedure, package it in wheel , and publish to PyPI . Then you can install it with the command pip install <имя пакета>, and update it with the command pip install -U <имя пакета>.

G
Georg Gaal, 2019-04-15
@gecube

Another option:
make a minimal CD process.
What does it look like?
1. Deploy the repository to GitLab
2. Install gitlab-runner on the target machine
3. And connect to the repository
4. Create a .gitlab-ci.yml file in the repository and describe the steps to update the code in it.
If the server is accessible from the outside, then you can skip step 2 and in the script, which is described in step 4, simply connect via ssh to the server and do all the necessary actions.
Well, either, as advised above, use watchers that will monitor the code in the repository and, when updated, update the code automatically on the target machine

S
Sergey Sokolov, 2017-02-20
@RatiboR1978

document.write((function(n){
  var html='', i=0;
  while(i++<n) html+=i.toString().repeat(i)+"<br>";
  return html;
})(9));

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question