-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
82 lines (63 loc) · 2.43 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
82
#*******************************************************************************
# Copyright (C) 2015, CERN
# # This software is distributed under the terms of the GNU General Public
# # License version 3 (GPL Version 3), copied verbatim in the file "LICENSE".
# # In applying this license, CERN does not waive the privileges and immunities
# # granted to it by virtue of its status as Intergovernmental Organization
# # or submit itself to any jurisdiction.
# #
# #
# #*******************************************************************************
SPECFILE=python-cern-sso.spec
REPOURL=git+ssh://git@gitlab.cern.ch:7999
# DB gitlab group
REPOPREFIX=/db
REPONAME=cern-sso-python
# Get all the package infos from the spec file
PKGVERSION=$(shell awk '/Version:/ { print $$2 }' ${SPECFILE})
PKGRELEASE=$(shell awk '/Release:/ { print $$2 }' ${SPECFILE} | sed -e 's/\%{?dist}//')
PKGNAME=$(shell awk '/Name:/ { print $$2 }' ${SPECFILE})
PKGID=$(PKGNAME)-$(PKGVERSION)
TARFILE=$(PKGID).tar.gz
sources:
rm -rf /tmp/$(PKGID)
mkdir /tmp/$(PKGID)
cp -rv * /tmp/$(PKGID)/ > /dev/null 2>&1
pwd ; ls -l
cd /tmp ; tar --exclude .svn --exclude .git --exclude .gitkeep -czf $(TARFILE) $(PKGID)
mv /tmp/$(TARFILE) .
rm -rf /tmp/$(PKGID)
all: sources
clean:
rm $(TARFILE)
srpm: all
rpmbuild -bs --define '_sourcedir $(PWD)' ${SPECFILE}
rpm: all
rpmbuild -ba --define '_sourcedir $(PWD)' ${SPECFILE}
scratch:
koji build db6 --nowait --scratch ${REPOURL}${REPOPREFIX}/${REPONAME}.git#${PKGVERSION}
koji build db7 --nowait --scratch ${REPOURL}${REPOPREFIX}/${REPONAME}.git#${PKGVERSION}
build:
koji build db6 --nowait ${REPOURL}${REPOPREFIX}/${REPONAME}.git#${PKGVERSION}
koji build db7 --wait ${REPOURL}${REPOPREFIX}/${REPONAME}.git#${PKGVERSION}
tag-qa:
koji tag-build db6-qa $(PKGID)-$(PKGRELEASE).el6
koji tag-build db7-qa $(PKGID)-$(PKGRELEASE).el7.cern
tag-stable:
koji tag-build db6-stable $(PKGID)-$(PKGRELEASE).el6
koji tag-build db7-stable $(PKGID)-$(PKGRELEASE).el7.cern
lint:
find . -iname "*.py" | xargs flake8
.PHONY: lint
deploy:
pytest
git push origin :refs/tags/$(shell python setup.py --version 2>&1)
git tag -f $(shell python setup.py --version 2>&1)
git push --tags
.PHONY: deploy
docker-image:
docker build -t astjerna/sso-legacy .
docker-run:
docker run --volume $(shell pwd):/home/work --rm -it astjerna/sso-legacy python -m pytest
docker-shell:
docker run --volume $(shell pwd):/home/work --rm -it astjerna/sso-legacy bash