Skip to content

Instantly share code, notes, and snippets.

View jonashackt's full-sized avatar
:octocat:
TDD & CI for IaC FTW!

Jonas Hecht jonashackt

:octocat:
TDD & CI for IaC FTW!
View GitHub Profile
@jonashackt
jonashackt / molecule.yml
Created November 30, 2018 13:50
Molecule: define host_vars or group_vars in provisioner/inventory that are really used by Molecule´s platform
# Roles which require host/groups to have certain variables set
# see (scroll down!) https://molecule.readthedocs.io/en/latest/configuration.html#provisioner & https://github.com/ansible/molecule/issues/1037
# like:
provisioner:
name: ansible
...
inventory:
host_vars:
docker-debian-stretch:
gitlab_domain: "localhost"
@jonashackt
jonashackt / DownloadMavenNexusDockerfile
Last active April 19, 2024 13:19
Download Maven artifact from Nexus with current version in Dockerfile
# SHORT VERSION, if artifactId and groupId are hard-coded
FROM maven:3-jdk-11
# Add sources including pom.xml to Docker build context and use as workdir for later Maven execution
ADD . /build
WORKDIR /build
# Download Maven artifact from Nexus with current version
# And do it all inside ONE 'RUN' statement, see https://stackoverflow.com/a/37860420/4964553
# Otherwise you can't define vars like ARTIFACT_VERSION for later steps in following 'RUN' commands!
@jonashackt
jonashackt / kubernetes-cheatsheet.md
Last active March 13, 2024 13:36
Kubernetes cheat sheet
@jonashackt
jonashackt / GitLabCIGitRepoCloneDockerfile
Created September 23, 2019 11:06
Clone a GitLab git repository inside a Dockerfile/build run inside GitLab CI
# Add the following key to the 'Deploy Keys' section in Settings/Repository of your GitLab repository
# Dockerfile:
FROM centos:7
ARG SSH_KEY_GITLAB_DEPLOY_KEY
RUN \
### ssh configuration, see https://docs.gitlab.com/ee/ci/ssh_keys/#ssh-keys-when-using-the-docker-executor
# run ssh-agent inside build environment
eval $(ssh-agent -s); \
@jonashackt
jonashackt / gitlab-ci-local.bash
Last active December 20, 2023 10:46
GitLab CI local development
# The central problem right now, is that gitlab-runner exec was deprecated with GitLab 10 - and then undeprecated later,
# because of missing alternatives - see https://gitlab.com/gitlab-org/gitlab-runner/issues/2797
# So this guide is somehow only a work documentation on how I tried to use this feature
### OPTION 1: Install gitlab-runner directly on your system
# See
# http://bryce.fisher-fleig.org/blog/faster-ci-debugging-with-gitlabci/index.html
# Install GitLab Runner locally
@jonashackt
jonashackt / bash.sh
Created August 24, 2017 13:38
List all Virtual Box ostypes for guest_os_type in Packer template
# on terminal
VBoxManage list ostypes
@jonashackt
jonashackt / reveal.js-markdown-pandoc-github.md
Last active October 7, 2023 20:21
Reveal.js presentation Markdown Pandoc GitHub Pages

Reveal.js presentation with Markdown

Workflow

  1. Create GitHub repo & write Markdown into README.md (all the time, as you do research)

  2. Create gh-pages Branch & Markdown for presentation

  3. Use Pandoc to convert Markdown into Reveal.js HTML (locally)

@jonashackt
jonashackt / sdkman-cheatsheet.sh
Last active January 6, 2023 15:20
SDKMan cheatsheet
# Use another Java version as currently active
sdk list java
================================================================================
Available Java Versions
================================================================================
Vendor | Use | Version | Dist | Status | Identifier
--------------------------------------------------------------------------------
AdoptOpenJDK | | 15.0.1.j9 | adpt | | 15.0.1.j9-adpt
| | 15.0.1.hs | adpt | installed | 15.0.1.hs-adpt
| | 14.0.2.j9 | adpt | | 14.0.2.j9-adpt
@jonashackt
jonashackt / playbook.yml
Last active October 15, 2022 14:42
Start SpringBoot .jar via ansible on Windows box
---
- hosts: "{{host}}"
tasks:
- name: Create directory C:\yourPath
win_file: path="C:\\yourPath" state=directory
- name: Install nssm (non-sucking service manager) with chocolatey
win_chocolatey: name=nssm
@jonashackt
jonashackt / terminal.bash
Created November 30, 2015 16:54
Maven increment Version according to Numberingconventions of pom and update it in project.version inside pom
mvn build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion} versions:commit