Skip to content

Commit d44094c

Browse files
committed
Build using travis
1 parent fabb77f commit d44094c

File tree

7 files changed

+107
-78
lines changed

7 files changed

+107
-78
lines changed

.travis.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
language: go
2+
3+
go:
4+
- 1.8
5+
6+
rvm:
7+
- 2.2
8+
9+
before_install:
10+
- gem install asciidoctor
11+
# Get rpmbuild
12+
- sudo apt-get update -qq
13+
- sudo apt-get install -qq rpm
14+
15+
script:
16+
- make debug
17+
- make deps
18+
- make test
19+
- make build
20+
- make man
21+
22+
after_success:
23+
- make rpm
24+
- make debug
25+
# Delete build artifacts that are not deployed
26+
- rm xmlsect xmlsect.1
27+
28+
deploy:
29+
provider: releases
30+
api_key:
31+
secure: uiSHDUV+M04NrwpZS+q18+pbgFknZhGsKu0a5xuVCyGKVNaQK65hgW3cnSvNCfYetpP4e38i41e7H4eDVmFhHstNxrIanEnT6Nol/NinYZYMZjcSP03bMR63KdgkxN4nTma6G6uXCG/UcDx0HSPYueR4vjJKOi9dUz8bnHQntcl3rGEnY987N/a/Gt/pqsfynWlpFAxEXqaySX6x7BtjE42+nexRbVYyFH4PyaTYzmJSPognpp6EpCevAdRUs1+Z2Qboy3yoQCTJ4gmVFee4iT3NDCFTm77UJw9NdDSoCkBqgCocxObEAzAsuynP5KIin7luk+lE9nxHyJVS4YENPLSGDd+8kWlGUDoHDh6DLQHIb7wn0NB3DcZ2PhZ739NYlKRLf5d5G2DtYp29oAFCpWwuU5pg4MBLLWSUVpORsFh0Azj14rh31ThIte0e5zYtO570xl0W87C041csO+291YrDP3E9OzaUCn/LkLy7PFC3xtxzuUAfX03EB4cSRvu9WoeblCssuF5VYBDJopYVtH74yp3WWoOli3C8F/F08SNwUhxEjMVOlwJEx0ZOUJfZOsc322DBCRF/fgTN63/jv+xB4Wr7Szb3WZTh1Uv5jqk1M1Wg9usHamWLq1cVW6m7N2GAtHF09h8egvXYnIVutKjCayfC6lByo2oR/6PGzq8=
32+
file: ./RPMS/xmlsect-0.2.0-1.x86_64.rpm
33+
skip_cleanup: true
34+
on:
35+
repo: DavidGamba/xmlsect
36+
branch: master

Makefile

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,26 @@ BUILD_FLAGS=-ldflags="-X github.com/DavidGamba/xmlsect/semver.BuildMetadata=`git
1111
test:
1212
go test ./...
1313

14+
debug:
15+
pwd; \
16+
echo ${GOPATH}; \
17+
ls **;
18+
19+
deps:
20+
go get -u github.com/DavidGamba/go-getoptions; \
21+
go get -u github.com/santhosh-tekuri/dom; \
22+
go get -u github.com/santhosh-tekuri/xpath;
23+
24+
25+
doc:
26+
asciidoctor README.adoc
27+
28+
man:
29+
asciidoctor -b manpage xmlsect.adoc
30+
31+
open:
32+
open README.html
33+
1434
build:
1535
go build $(BUILD_FLAGS)
1636

@@ -22,9 +42,3 @@ rpm:
2242
--define '_rpmdir ./RPMS' \
2343
--define '_sourcedir ${PWD}' \
2444
--buildroot ${PWD}/buildroot
25-
26-
srpm:
27-
rpmbuild -bs rpm.spec \
28-
--define '_srcrpmdir ./SRPMS' \
29-
--define '_sourcedir ${PWD}' \
30-
--buildroot ${PWD}/buildroot

README.adoc

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
1-
= XML Sectrix (xmlsect) (1)
1+
= XML Sectrix (xmlsect)
22
David Gamba, DavidGamba at gmail.com
3-
:doctype: manpage
43

54
== NAME
65

7-
xmlsect - Quickly query an XML file using XPath 1.0.
6+
xmlsect - XML Sectrix: Quickly query an XML file using XPath 1.0.
87

98
This tool reads a whole XML file into memory, extracts its XML Namespaces using a regular expression and then loads all the _namespaces_ for you.
109

11-
When there is a default namespace, it automatically loads it under the namespace ID *_* (or *DEFAULT*).
12-
An example XPath would then look like `/_:a/_:b/_:c`.
10+
When there is a default namespace, it automatically loads it under the namespace ID *+_+* (or *DEFAULT*).
11+
An example XPath would then look like `+/_:a/_:b/_:c+`.
1312

1413
== SYNOPSIS
1514

@@ -23,12 +22,7 @@ An example XPath would then look like `/_:a/_:b/_:c`.
2322
go install github.com/DavidGamba/xmlsect
2423
----
2524

26-
* Using https://copr.fedorainfracloud.org/coprs/davidgamba[Copr]:
27-
+
28-
----
29-
dnf copr enable davidgamba/xmlsect
30-
dnf install xmlsect
31-
----
25+
* From the latest release: https://github.com/DavidGamba/xmlsect/releases
3226

3327
== Credits
3428

rpm.spec

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
Name: xmlsect
88
Summary: Quickly query an XML file using XPath 1.0.
9-
Version: 0.1.0
9+
Version: 0.2.0
1010
Release: 1
1111
License: MPL-2.0
1212
Group: Development/Tools
@@ -30,9 +30,6 @@ if [ ! -e %{_rpmdir} ]; then
3030
mkdir -p %{_rpmdir}
3131
fi
3232

33-
pwd
34-
ls
35-
3633
mkdir -p %{buildroot}/%{_bindir}
3734
mkdir -p %{buildroot}/%{_mandir}/man1
3835

xmlsect.1

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

xmlsect.adoc

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
= xmlsect(1)
2+
David Gamba, DavidGamba at gmail.com
3+
:doctype: manpage
4+
5+
== NAME
6+
7+
xmlsect - XML Sectrix: Quickly query an XML file using XPath 1.0.
8+
9+
This tool reads a whole XML file into memory, extracts its XML Namespaces using a regular expression and then loads all the _namespaces_ for you.
10+
11+
When there is a default namespace, it automatically loads it under the namespace ID *+_+* (or *DEFAULT*).
12+
An example XPath would then look like `+/_:a/_:b/_:c+`.
13+
14+
== SYNOPSIS
15+
16+
*xmlsect* _file_ [_xpath_] [_relative_xpath] [*--tree*]
17+
18+
== Installation
19+
20+
* Using Golang:
21+
+
22+
----
23+
go install github.com/DavidGamba/xmlsect
24+
----
25+
26+
* From the latest release: https://github.com/DavidGamba/xmlsect/releases
27+
28+
== Credits
29+
30+
This tool is using the awesome libraries created by Santhosh Kumar Tekuri, https://github.com/santhosh-tekuri/xpath[xpath] and https://github.com/santhosh-tekuri/dom[dom].
31+
32+
== SOURCE CODE
33+
34+
github: https://github.com/DavidGamba/xmlsect
35+
36+
== LICENSE
37+
38+
This file is part of xmlsect.
39+
40+
Copyright (C) 2017 David Gamba Rios
41+
42+
This Source Code Form is subject to the terms of the Mozilla Public
43+
License, v. 2.0. If a copy of the MPL was not distributed with this
44+
file, You can obtain one at http://mozilla.org/MPL/2.0/.

xmlsect.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ func main() {
192192
os.Exit(1)
193193
}
194194
if opt.Called("version") {
195-
version := semver.Version{Major: 0, Minor: 1, Patch: 0}
195+
version := semver.Version{Major: 0, Minor: 2, Patch: 0}
196196
fmt.Println(version)
197197
os.Exit(1)
198198
}

0 commit comments

Comments
 (0)