-
Notifications
You must be signed in to change notification settings - Fork 45
/
Makefile
81 lines (63 loc) · 2.04 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
.PHONY: release release_patch release_minor release_major
NEXT_PATCH=$(shell docker-compose run --rm gem bash -c "bundle exec bump show-next patch")
NEXT_MINOR=$(shell docker-compose run --rm gem bash -c "bundle exec bump show-next minor")
NEXT_MAJOR=$(shell docker-compose run --rm gem bash -c "bundle exec bump show-next major")
TAG_FULL_VERSION=v${VERSION}
CURRENT_LOCAL_GEM_NAME := $(shell ls | sort -r | grep 'uffizzi-cli-.*\.gem' | head -1)
release_gem:
mkdir -p ${HOME}/.gem
touch ${HOME}/.gem/credentials
chmod 0600 ${HOME}/.gem/credentials
printf -- "---\n:rubygems_api_key: ${RUBYGEMS_API_KEY}\n" > ${HOME}/.gem/credentials
gem build *.gemspec
gem push *.gem
release_patch: export VERSION=${NEXT_PATCH}
release_patch:
make release
release_minor: export VERSION=${NEXT_MINOR}
release_minor:
make release
release_major: export VERSION=${NEXT_MAJOR}
release_major:
make release
release:
git checkout develop
@echo 'Set a new version'
docker-compose run --rm gem bash -c "bundle exec bump set ${VERSION}"
docker-compose run --rm gem bash -c "bundle install"
git commit -am "Change version to ${VERSION}"
@echo 'Update remote origin'
git push origin develop
git checkout main
git pull origin --rebase main
git merge --no-ff --no-edit develop
git push origin main
@echo 'Create a new tag'
git tag ${TAG_FULL_VERSION}
git push origin ${TAG_FULL_VERSION}
shell:
docker-compose run --rm gem bash
test:
docker-compose run --rm gem bash -c "bundle exec rake test"
lint:
docker-compose run --rm gem bash -c "bundle exec rubocop -A"
run_single_test:
docker-compose run --rm gem bash -c 'bundle exec rake test TEST=$(TEST_PATH) TESTOPTS="--name=${TEST_NAME}"'
gem_build:
gem build uffizzi.gemspec
gem_install:
gem install $(CURRENT_LOCAL_GEM_NAME)
gem_build_install:
make gem_build
make gem_install
gem_uninstall:
gem uninstall uffizzi-cli
gem_reinstall:
ls -la | grep uffizzi-cli- | rm -f
make gem_uninstall
make gem_build_install
brew_add_tap:
brew tap UffizziCloud/tap
brew_tap_install:
brew install uffizzicloud/tap/uffizzi
.PHONY: test