Commit 84020ff4bffcf3c6147af674f3029c87c2800718

Authored by Sergio Oliveira
1 parent a621653f

Scripts to update obs package and bumpinp down version

.gitignore
... ... @@ -22,3 +22,6 @@ coverage_report/
22 22  
23 23 # Whoosh Index
24 24 tests/whoosh_index/
  25 +
  26 +# Open Build System
  27 +.obs/
... ...
colab.spec
1 1 %define name colab
2   -%define version 2.0a3
3   -%define unmangled_version 2.0a3
4   -%define release 3
  2 +%define version 1.9
  3 +%define unmangled_version 1.9
5 4 %define buildvenv /var/tmp/%{name}-%{version}
6 5  
7 6 Summary: Collaboration platform for communities
... ... @@ -46,9 +45,6 @@ find %{buildvenv} -type d -empty -delete
46 45 mkdir -p %{buildroot}/etc/colab
47 46 mkdir -p %{buildroot}/usr/lib
48 47  
49   -mkdir -p %{buildroot}/usr/share/nginx/
50   -ln -s /var/lib/colab-assets %{buildroot}/usr/share/nginx/colab
51   -
52 48 # install virtualenv
53 49 rm -rf %{buildroot}/usr/lib/colab
54 50 cp -r %{buildvenv} %{buildroot}/usr/lib/colab
... ... @@ -81,7 +77,6 @@ rm -rf %{buildvenv}
81 77 %{_bindir}/*
82 78 /etc/cron.d/colab
83 79 /lib/systemd/system/colab.service
84   -/usr/share/nginx/colab
85 80  
86 81 %post
87 82 groupadd colab || true
... ... @@ -89,8 +84,6 @@ if ! id colab; then
89 84 useradd --system --gid colab --home-dir /usr/lib/colab --no-create-home colab
90 85 fi
91 86  
92   -usermod --append --groups mailman colab
93   -
94 87 mkdir -p /etc/colab
95 88  
96 89 if [ ! -f /etc/colab/settings.yaml ]; then
... ... @@ -102,12 +95,12 @@ TEMPLATE_DEBUG: true
102 95  
103 96 ## System admins
104 97 ADMINS: &admin
105   --
106   - - John Foo
107   - - john@example.com
108   --
109   - - Mary Bar
110   - - mary@example.com
  98 + -
  99 + - John Foo
  100 + - john@example.com
  101 + -
  102 + - Mary Bar
  103 + - mary@example.com
111 104  
112 105 MANAGERS: *admin
113 106  
... ... @@ -120,15 +113,15 @@ EMAIL_SUBJECT_PREFIX: '[colab]'
120 113  
121 114 SECRET_KEY: '$SECRET_KEY'
122 115  
123   -SITE_URL: 'http://localhost:8000'
  116 +SITE_URL: 'http://localhost:8001/'
124 117 BROWSERID_AUDIENCES:
125   -- http://localhost:8000
  118 + - http://localhost:8001
126 119 # - http://example.com
127 120 # - https://example.org
128 121 # - http://example.net
129 122  
130 123 ALLOWED_HOSTS:
131   -- localhost
  124 + - localhost
132 125 # - example.com
133 126 # - example.org
134 127 # - example.net
... ... @@ -136,12 +129,8 @@ ALLOWED_HOSTS:
136 129 ## Disable indexing
137 130 ROBOTS_NOINDEX: false
138 131  
139   -#PROXIED_APPS:
140   -# gitlab:
141   -# upstream: 'http://localhost:8080/gitlab/'
142   -
143   -## Enabled BROWSER_ID protocol
144   -# BROWSERID_ENABLED: True
  132 +## Disable browser id authentication
  133 +# BROWSERID_ENABLED: true
145 134 EOF
146 135 chown root:colab /etc/colab/settings.yaml
147 136 chmod 0640 /etc/colab/settings.yaml
... ... @@ -152,18 +141,17 @@ mkdir -p /etc/colab/settings.d
152 141 if [ ! -f /etc/colab/settings.d/00-database.yaml ]; then
153 142 cat > /etc/colab/settings.d/00-database.yaml <<EOF
154 143 DATABASES:
155   -default:
156   - ENGINE: django.db.backends.postgresql_psycopg2
157   - NAME: colab
158   - USER: colab
159   - HOST: localhost
160   - PORT: 5432
  144 + default:
  145 + ENGINE: django.db.backends.postgresql_psycopg2
  146 + NAME: colab
  147 + USER: colab
  148 + HOST: localhost
  149 + PORT: 5432
161 150 EOF
162 151 chown root:colab /etc/colab/settings.d/00-database.yaml
163 152 chmod 0640 /etc/colab/settings.d/00-database.yaml
164 153 fi
165 154  
166   -
167 155 # only applies if there is a local PostgreSQL server
168 156 if [ -x /usr/bin/postgres ]; then
169 157  
... ... @@ -188,10 +176,9 @@ fi
188 176 mkdir -p /var/lib/colab-assets
189 177 chown colab:colab /var/lib/colab-assets
190 178  
191   -mkdir -p /var/lock/colab
192   -chown colab:colab /var/lock/colab
  179 +mkdir -p /usr/share/nginx/
193 180  
194   -if [ -f /etc/colab/settings.yaml ]; then
195   - yes yes | colab-admin collectstatic
196   -fi
  181 +ln -s /var/lib/colab-assets /usr/share/nginx/colab
  182 +
  183 +yes yes | colab-admin collectstatic
197 184  
... ...
setup.py
... ... @@ -65,7 +65,7 @@ EXCLUDE_FROM_PACKAGES = []
65 65  
66 66 setup(
67 67 name='colab',
68   - version='2.0a3',
  68 + version='1.9',
69 69 url='https://github.com/colab-community/colab',
70 70 author='Sergio Oliveira',
71 71 author_email='sergio@tracy.com.br',
... ...
update_obs.sh 0 → 100755
... ... @@ -0,0 +1,47 @@
  1 +#!/bin/bash
  2 +
  3 +which -s osc || { echo "osc must be installed"; exit 1; }
  4 +
  5 +VERSION=`python setup.py --version`
  6 +
  7 +pull_obs () {
  8 + if [ -d .obs ]
  9 + then
  10 + osc update .obs/
  11 + else
  12 + osc checkout isv:spb:colab/colab --output-dir=".obs/"
  13 + fi
  14 +}
  15 +
  16 +update_sdist () {
  17 + rm -fR dist/
  18 + python setup.py sdist
  19 +}
  20 +
  21 +
  22 +add_to_obs () {
  23 + osc revert .obs/
  24 + osc rm -f .obs/colab-*.tar.gz
  25 +
  26 + cp dist/colab-*.tar.gz .obs/
  27 + cp colab.spec .obs/
  28 +
  29 + osc add .obs/colab-$VERSION.tar.gz
  30 +}
  31 +
  32 +
  33 +update_spec_versions () {
  34 + sed -i '' -E "s/(\%define (unmangled_)?version).*/\1 $VERSION/;" colab.spec
  35 +}
  36 +
  37 +
  38 +push_to_obs () {
  39 + echo
  40 +}
  41 +
  42 +update_sdist
  43 +update_spec_versions
  44 +
  45 +pull_obs
  46 +add_to_obs
  47 +push_to_obs
... ...