Skip to content

Instantly share code, notes, and snippets.

View wojtek-oledzki's full-sized avatar

Wojtek Oledzki wojtek-oledzki

View GitHub Profile
VERSION ?= $(shell git describe --tags --match "$(VERSION_BASE)*" || echo $(VERSION_BASE).0)
VERSION_BASE ?= $(shell cat "$(PWD)/.version")
## Create new version tag based on the nearest tag
version.bumpup:
@git fetch --tags
@git tag $$((git describe --abbrev=0 --tags --match "$(VERSION_BASE)*" || echo $(VERSION_BASE).-1) | perl -pe 's/^(v(\d+\.)*)(-?\d+)(.*)$$/$$1.($$3+1).$$4/e')
$(MAKE) version.pprint
@echo "Remember to push new tag to remote server."
@wojtek-oledzki
wojtek-oledzki / Makefile-ansible-aws
Last active August 7, 2018 23:15
Makefile target for "assume role" access with ansible
SOURCE_PROFILE ?= default
PROFILE ?= my-profile-with-role
ASSUME_ROLE ?= arn:aws:iam::123498765678:role/my_admin_role
## Assumes role and udpates ~/.aws/credentials
# Example: make assume_role
assume_role:
@aws sts assume-role \
--profile $(SOURCE_PROFILE) \
--output text \
{
"template": "hoborg",
"tags": [ "My Project" ],
"publicPrefix": "",
"widgets": [
{
"name": "My API ",
"role": "api_issa_proxy",
"size": "grid-1-1",
"template": "<div class='widget__body text-M' style='padding: 4px 10px'><span class=''>{{ name }}</span> : {{ role }} </div>"
@wojtek-oledzki
wojtek-oledzki / Makefile
Last active October 17, 2016 16:28
Makefile with help
.DEFAULT_GOAL := help
.PHONY: help
## This is demo target
# Example: make demo
demo:
echo "D E M O"
## Prints this help
help:

Keybase proof

I hereby claim:

  • I am wojtek-oledzki on github.
  • I am woledzki (https://keybase.io/woledzki) on keybase.
  • I have a public key ASAVuFxj1eteEUQE6RdfC_WZNhYIohXtclqscgw6VcCbhwo

To claim this, I am signing this object: