Skip to content

Commit 9030006

Browse files
author
Stefano Torresi
authored
Merge pull request #129 from stefanotorresi/revert-obs-review-changes
Revert Source full url because it's a PITA.
2 parents e2a96a6 + df20882 commit 9030006

File tree

6 files changed

+29
-23
lines changed

6 files changed

+29
-23
lines changed

.ci/init_osc_creds.sh

Lines changed: 0 additions & 11 deletions
This file was deleted.

.ci/obs/_service

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<services>
2+
<service name="tar_scm" mode="disabled">
3+
<param name="url">git://github.com/ClusterLabs/ha_cluster_exporter.git</param>
4+
<param name="scm">git</param>
5+
<param name="revision">%%VERSION%%</param>
6+
<param name="exclude">.git</param>
7+
<param name="versionformat">@PARENT_TAG@</param>
8+
<param name="filename">prometheus-ha_cluster_exporter</param>
9+
</service>
10+
<service name="set_version" mode="disabled">
11+
<param name="version">%%VERSION%%</param>
12+
<param name="file">prometheus-ha_cluster_exporter.spec</param>
13+
</service>
14+
<service name="recompress" mode="disabled">
15+
<param name="file">*.tar</param>
16+
<param name="compression">gz</param>
17+
</service>
18+
<service name="go_modules" mode="disabled" />
19+
</services>

ha_cluster_exporter.spec renamed to .ci/obs/prometheus-ha_cluster_exporter.spec

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@
1515
# along with this program. If not, see <https://www.gnu.org/licenses/>.
1616
#
1717
Name: prometheus-ha_cluster_exporter
18-
# Version will be processed via Makefile
19-
Version: %%VERSION%%
18+
# Version will be processed via set_version source service
19+
Version: 0
2020
Release: 0
2121
License: Apache-2.0
2222
Summary: Prometheus exporter for Pacemaker HA clusters metrics
2323
Group: System/Monitoring
2424
Url: https://github.com/ClusterLabs/ha_cluster_exporter
25-
# The GitHub tarball will not actually be used during build: instead, we provide a local archive with the vendored dependencies inside.
26-
Source: https://github.com/ClusterLabs/ha_cluster_exporter/archive/%{version}.tar.gz
25+
Source: %{name}-%{version}.tar.gz
26+
Source1: vendor.tar.gz
2727
ExclusiveArch: aarch64 x86_64 ppc64le s390x
2828
BuildRoot: %{_tmppath}/%{name}-%{version}-build
2929
BuildRequires: go >= 1.11
@@ -41,7 +41,8 @@ Provides: %{name}-devel-static = %{version}
4141
Prometheus exporter for Pacemaker HA clusters metrics
4242

4343
%prep
44-
%setup -q -c # unpack project sources
44+
%setup -q # unpack project sources
45+
%setup -q -T -D -a 1 # unpack go dependencies in vendor.tar.gz, which was prepared by the source services
4546

4647
%define shortname ha_cluster_exporter
4748

.gitattributes

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
/.* export-ignore
2-
/ha_cluster_exporter.spec export-ignore

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ jobs:
3636
docker run --rm -t -v "$(pwd):/package" -v "$GOPATH/pkg/mod:/root/go/pkg/mod" -w /package \
3737
-e OBS_USER -e OBS_PASS -e OBS_PROJECT -e OBS_PACKAGE -e VERSION -e REPOSITORY=$TRAVIS_REPO_SLUG \
3838
shap/continuous_deliver \
39-
bash -c ".ci/init_osc_creds.sh && make obs-commit"
39+
bash -c "/scripts/init_osc_creds.sh && make obs-commit"

Makefile

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,10 @@ obs-workdir: build/obs
6666
build/obs:
6767
@mkdir -p build/obs/$(OBS_PACKAGE)
6868
osc checkout $(OBS_PROJECT)/$(OBS_PACKAGE) -o build/obs
69-
cp ha_cluster_exporter.spec build/obs/$(OBS_PACKAGE).spec
70-
sed -i 's/%%VERSION%%/$(VERSION)/' build/obs/$(OBS_PACKAGE).spec
71-
git archive --format=tar HEAD | tar -x -C build/obs/$(OBS_PACKAGE)
72-
cd build/obs/$(OBS_PACKAGE); go mod vendor
7369
rm build/obs/*.tar.gz
74-
tar -cvzf build/obs/$(VERSION).tar.gz -C build/obs/$(OBS_PACKAGE) .
70+
cp -rv .ci/obs/* build/obs/
71+
sed -i 's/%%VERSION%%/$(VERSION)/' build/obs/_service
72+
cd build/obs; osc service runall
7573
.ci/gh_release_to_obs_changeset.py $(REPOSITORY) -a $(AUTHOR) -t $(VERSION) -f build/obs/$(OBS_PACKAGE).changes || true
7674

7775
obs-commit: obs-workdir

0 commit comments

Comments
 (0)