I had been writing mostly about python, but recently I write especially about DevOps and how to automate things.
Pamięć 0.5
Get link
Facebook
X
Pinterest
Email
Other Apps
Opublikowałem nową wersję skryptu Pamięć. Dostępna jest nowa metoda "Zakładki alfabetyczne". Dodałem kilkadziesiąt nowych słów oraz przeprowadziłem refaktoryzację kodu. Zapraszam do korzystania.
Let's say that you have to log in via ssh into an instance, and you work with GitLab, so you want to keep the private key in GitLab somewhere. Is it secure? Let's see! Custom environment variables You can use custom environment variables. Here you can read more about them (Developers cannot change them, only Maintainers and Owners can). There are two types of variables: Variable (the runner creates an environment variable that uses the key for the name and the value for the value) File (the runner creates an environment variable that uses the key for the name. For the value, the runner writes the variable value to a temporary file and uses this path) It seems that we can use File type for our purpose. We can set up it via API or UI . So, let's do that! Go to project's Settings > CI/CD . There will be Variables section (btw, you can specify variables also per group and even for all projects (in admin panel)). Click Add Variable button and add a variable: Key: ...
If you have to maintain a massive project, you probably have many fixtures in conftest file. And there is a problem; this file grows and grows. So, at some point, you decide to split this huge file into smaller files. But, py.test has to know the fixtures are keeping in these files. So, what you can do? I see three patterns here for this: import these guys inside conftest.py file create more conftest.py files use pytest_plugins Import fixtures inside conftest file You can for example do this: 1 2 3 4 5 6 7 8 9 from tests.my_fixtures.fixs1 import ( fix11, fix12, fix13, fix14, fix15, ... ) from tests.my_fixtures.fixs2 import ( fix21, fix22, fix23, ) from tests.my_fixtures.fixs3 import ( fix31, fix32, fix33 ) But, there are some problems with this approach. You import them in an explicit way, so if you create a new fixture, you have to remember to add this guy in the import clause. So, this strategy is not the best solution. If you have many fi...
Wstęp Trochę mi zajęło zabranie się za napisanie tego posta, ale oto jest. Mam nadzieję, że Ci się przyda. Post pisany trochę po to by utrwalić wiedzę, trochę po to, aby pomóc innym, którzy chcą spróbować Vima i trochę po to, by mieć coś ciekawego na tym blogu. Zacznę od tego dlaczego nie inne edytory. Wypróbowałem naprawdę mnóstwo różnych IDE do Pythona, zaczynając od Eclipse , poprzez PyCharm , Komodo , erci5 , Sublime Text 2 i wiele wiele innych, na Wingware kończąc. Wszystko z czego korzystałem po pewnym czasie albo i na początku "muliło", miało mnóstwo opcji z których nie skorzystałem i pewnie nie skorzystam nigdy w życiu, zaśmiecało mi system, dużo ważyło, etc. A odpalenie kilku instancji programu, tak aby można było porobić coś jeszcze na komputerze? Zapomnij. Dlatego zacząłem szukać czegoś lekkiego, czegoś co będę mógł szybko odpalić z terminala i od razu pracować, czegoś co będę mógł w łatwy sposób odpalić na innej maszynie, czegoś co jest darmowe, czegoś co...
Comments
Post a Comment