Merge lp:~roadmr/canonical-identity-provider/git-compatibility into lp:canonical-identity-provider/release

Proposed by Daniel Manrique on 2019-08-30
Status: Merged
Approved by: Daniel Manrique on 2019-08-30
Approved revision: 1695
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: lp:~roadmr/canonical-identity-provider/git-compatibility
Merge into: lp:canonical-identity-provider/release
Diff against target: 64 lines (+16/-3)
2 files modified
.bzrignore (+1/-0)
Makefile (+15/-3)
To merge this branch: bzr merge lp:~roadmr/canonical-identity-provider/git-compatibility
Reviewer Review Type Date Requested Status
Guillermo Gonzalez Approve on 2019-08-30
Kristian Glass (community) 2019-08-30 Approve on 2019-08-30
Review via email: mp+372075@code.launchpad.net

Commit message

Make the project compatible with git.

With these changes the project should be hostable in a git repo and work as
intended.

- Add placeholder files so git doesn't eat empty directories
- Tweak .bzrignore so it can be symlinked to .gitignore, and add symlink
- Tweak Makefile so it works with either git or bzr

Makefile modifications are mainly to determine revno/commit id for the build label,
write versioninfo.py based on that information, and add po files, depending on which
VCS is in use.

To post a comment you must log in.
review: Approve
Guillermo Gonzalez (verterok) wrote :

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.bzrignore'
2--- .bzrignore 2017-11-14 14:47:31 +0000
3+++ .bzrignore 2019-08-30 16:00:12 +0000
4@@ -9,3 +9,4 @@
5 lib/versioninfo.py
6 settings.py
7 rsakeys/*
8+*.pyc
9
10=== added symlink '.gitignore'
11=== target is u'.bzrignore'
12=== modified file 'Makefile'
13--- Makefile 2019-04-30 19:14:58 +0000
14+++ Makefile 2019-08-30 16:00:12 +0000
15@@ -27,7 +27,7 @@
16 WHEELS_DIR = branches/wheels
17 STATIC_ROOT ?= $(shell grep -R STATIC_ROOT django_project/settings_base.py | awk '{print $$3}')
18 # Create archives in labelled directories (ie. r27/$(PROJECT_NAME).tbz2)
19-TARBALL_BUILD_LABEL ?= $(shell bzr version-info --custom --template="r{revno}\n")
20+TARBALL_BUILD_LABEL ?= $(shell if [ -d .git ]; then git rev-parse --short HEAD; else bzr version-info --custom --template="r{revno}\n"; fi)
21 TARBALL_FILE_NAME = $(PROJECT_NAME).tbz2
22 TARBALL_BUILDS_DIR ?= $(JUJU_REPO)/builds
23 TARBALL_BUILD_DIR = $(TARBALL_BUILDS_DIR)/$(TARBALL_BUILD_LABEL)
24@@ -72,7 +72,19 @@
25 build-tarball: install-wheels $(TARBALL_BUILD_PATH)
26
27 version:
28- bzr version-info --format=python > lib/versioninfo.py
29+ @if [ -d .git ]; then \
30+ SSO_VERSION=$(shell git rev-parse --short HEAD); \
31+ echo "version_info = {\
32+ 'build_date': '$(shell date +"%F %T %z")',\
33+ 'clean': None,\
34+ 'date': '$(shell date +"%F %T %z")',\
35+ 'revision_id': '$$SSO_VERSION', \
36+ 'revno': '$$SSO_VERSION', \
37+ }" \
38+ >lib/versioninfo.py; \
39+ else \
40+ bzr version-info --format=python > lib/versioninfo.py; \
41+ fi
42
43 ### Wheels ###
44
45@@ -205,7 +217,7 @@
46 cd -; \
47 mkdir -p "po/$$app"; \
48 cp "$(SRC_DIR)/$$app/locale/en/LC_MESSAGES/django.po" "po/$$app/$$app.pot"; \
49- bzr add "po/$$app"; \
50+ if [ -d .git ]; then git add "po/$$app"; else bzr add "po/$$app"; fi; \
51 done
52
53 # assumes an updated translations branch, which is brought by config-manager
54
55=== added file 'branches/.placeholder'
56=== added file 'docs/_static/.placeholder'
57=== added file 'docs/_templates/.placeholder'
58=== added file 'doctests/stories/openid/.placeholder'
59=== added file 'logs/.placeholder'
60=== added file 'po/oauth_backend/.placeholder'
61=== added file 'po/testing/.placeholder'
62=== added file 'po/tests/.placeholder'
63=== added file 'po/webservices/.placeholder'
64=== added file 'rsakeys/.placeholder'