#everything-as-a-code

Ansible vs Bash for Quick Automation

Published at March 7, 2019 ·  1 min read

I don’t want to argue on this topic. I really believe that it’s better to use Ansible if possible even for some ‘home’ automation. But looking on my scripts for some development automation (setup VMs, clone sources, install some software) I realized that there’s a mix of Ansible playbooks, Bash and Python scripts. It becomes to be hard for maintaining from one side, but it works as expected for me from another side....


Install Docker Using Ansible With One Command

Published at March 6, 2019 ·  1 min read

It’s boring to install Docker and Docker Compose on any host I need. Maybe Kubernetes is the right weight to di such things but Docker fits all my needs at the moment, so I use it for some development scenarios. I’ve got a simple docker_bootstrap.sh script to install Ansible if it’s not installed yet and setup Docker on the same host: #!/bin/bash pip install ansible ansible-galaxy install nickjj.docker ansible-playbook ./site.yml -t docker I use Ansible from pip because it’s not supposed to be installed on a production environment....


Clone Your GitHub Repos

Published at March 3, 2019 ·  1 min read

Since GitHub allows to store unlimited private repositories, I moved everything there. It’s really great to have such sources storage for free. Once I pushed everything to GitHub, I need to sync my repositories over all environments I have. I wrote a simple Python script below to clone all my GitHub repositories: My use case could not fit everyone, but you can adjust my script to cover your use cases. Everything I need is:...


Right Way to Setup Jenkins in Docker

Published at February 21, 2019 ·  1 min read

I was for this solution for months. Almost any guide I’ve found was about using an official Docker image with few plugins installed. It works pretty well if you agree with a manual initial configuration like configure admin user and password. It doesn’t work at all if you deploy Jenkins in an automated way. Here is a Dockerfile to get installed and ready to use Jenkins: FROM jenkins/jenkins:lts # https://github.com/jenkinsci/docker/blob/master/README.md # Jenkins configuration ENV JAVA_OPTS="-Djenkins....


Deploy Hugo Sites With Jenkins

Published at February 17, 2019 ·  2 min read

I’ll describe how I do my Hugo-based blog updates with Jenkins, but it’s pretty similar to any other static site generator. Pre-requirements Jenkins installation is out of the scope of this post. Also, you need to have installed and configured Publish Over SSH plugin. Also, I use Jenkins Job Builder (JJB) to configure Jenkins jobs from yaml file. I’ll describe my blog-jobs.yaml config for my blog below. Jenkins configuration Views If you have a lot of jobs or just want to group them by project, it makes sense to create a view:...


Choosing CI server for local needs

Published at February 15, 2019 ·  2 min read

Implementing everything-as-a-code initiative, I need some CI server up and running on my desktop. I don’t want to use cron directly or implement something myself because of I don’t have enough time for it. That’s mean, I can’t use Drone, Circle CI, or Travis CI because of pricing. I tried Buildbot and GoCD and they look pretty good but not mature enough. I really like GitLab CI but it requires a lot of resources and looks like too powerful for my simple tasks....


Build VM for Devstack

Published at February 6, 2019 ·  2 min read

I posted already about diskimage-builder and Docker integration. This is a follow-up post about it and Everything-as-a-code approach. Since it takes more time than expected (honestly, I didn’t to any estimations but it seems that it could be done faster), I’ll post you some tips I use for my development environment automation even if it’s not a production-ready solution, but it already could be used if somebody needs it. Almost any work with upstream OpenStack starts with VM setup with Devstack and required configuration....


Code Search for Your Repos

Published at January 25, 2019 ·  1 min read

Once you have more than one repository with sources you starting to search across all of them. You can use IDE and/or your favorite text editor to search across an open project. Usually, I use ‘grep’ to search in my ‘~/src’ directory. It works pretty well when you have a few repos. But once you’ve got tens of them, it’s it’s time to find something convenient than ‘grep’. This way is good only if you prefer GUI rather than CLI....


Benefits of the Automation

Published at January 23, 2019 ·  1 min read

Nobody will argue that Automation is great. I hope it’s obvious for everybody. Even simple automation which saves you a few minutes every day helps a lot to not do some boring routing things. Since I created some simple scripts to publish new blog posts, create containers or virtual machines for required environments, it saves me a lot of time to do something interesting or read about new technologies which I can or even cannot bring to my current projects....


Not a DNS Server for Libvirt

Published at January 18, 2019 ·  2 min read

Sometimes I’m too lazy to repeat the same task so I do some automation to make my life easier. Unfortunately, I don’t have enough time to do it well each time. That’s why I prefer ‘good enough’ way. I implement something good enough for me and refactor it once I have time. I use virtual machines on my desktop a lot. Usually, I have several of them up and running. I don’t like to remember an IP address for each of them, that’s why I prefer to use hostnames....


Diskimage-builder in Docker

Published at January 17, 2019 ·  1 min read

diskimage-builder is a tool for automatically building customized operating-system images for use in clouds and other environments. Unfortunately, I can’t do everything in Docker so I have to use VMs a lot. diskimage-builder helps me a lot to build basic VM images with pre-installed packages, my SSH key, etc. Since I try to have my development environment as clean, as possible I do not install additional packages on my desktop. Any Python package I install in the virtualenv....


Everything as a Code

Published at January 16, 2019 ·  2 min read

Infrastructure as a code… I hear about it during at least last 5-7 years. There are a lot of activities in each company (I hope) to introduce configuration management like Ansible, Puppet, Chef, etc to achieve Continuous Integration and Continuous Deployment(Delivery) aka CI/CD. I saw a lot of successful implementations for CI/CD for small and mid-size projects. It’s harder to introduce full automation on big projects but it’s absolutely doable....


Remote console via SSH with own bashrc

Published at August 9, 2017 ·  1 min read

I think, most of us have customized bash or zsh environment. I’m too lazy to switch from bash to zsh, so I use bash on my laptop. There are some benefits: bash is still the more popular shell, so it exists on mostly Linux-based servers. That’s why I try to use my .bashrc wherever it’s possible. But on a remote server, sometimes you don’t have the own user account. That’s why I’ve added a very simple alias for ssh command to mine [....


Tags

.net .net-framework .net-framework-3.5 agile ajax ajax-control-toolkit ampq ansible apache asp.net asp.net-mvc automation axum babel bash benchmark blog blog-engine bootstrap buildout c# cache centos chrome ci cinder ckan cli cloud code-review codeplex community config debugger deface dependencies development-environment devices devstack devtime disks django dlr dns docker dockerimage dos easy_install elmah encoding environment-variables error event events everything-as-a-code exception exceptions fabrik firefox flask foreach forms fstab gae gcc gerrit git github go google google-app-engine grep hack hacked hardware headless horizon hound html hugo iaas ienumerable iis internet iptables iron-python ironic iscsi java-script javascript jenkins jquery js jsx k8s kharkivpy kiss kombu kubernetes kvm kyiv lettuce libvirt linux lio loci logging loopback losetup lvm mac-os macos mercurial microsoft microsoft-sync-framework mobile mono ms-office msbuild networking news nginx npm npx offtopic oop open-source open-xml opensource openstack openvswitch os packages paraller-development patterns-practices performance php pika pip plugins pnp podcast popup postgresql profiler project protocols proxy pycamp pycharm pycon pykyiv pylint pypi python python-3 qcow quantum qumy rabbitmq rar react reactjs refactoring rfc rhel search-engine security selenium server shell silverlight socket software-engineering source-control sourcegear-vault sources sql sql-server sql-server-express sqlalchemy ssh static-site sublimetext svg tests tgt tipfy todo tornado typescript uapycon ui uneta unit-tests upgrades usability vim virtualenv visual-studio vitrage vm vue.js vuejs web-development web-server web-service web_root webpack webroot windows windows-live word-press x32 x64 xcode xml xss xvfb интернет-магазин книги

Recent posts

Go 1.18: new features

Всё будет Kubernetes

2022 Relaunch

Everyday Blogging

I don't want this CI


Archives

2022 (3)
2019 (73)
2018 (2)
2017 (3)
2016 (2)
2015 (3)
2014 (5)
2013 (17)
2012 (22)
2011 (36)
2010 (25)
2009 (35)
2008 (32)
2007 (2)