mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-06-02 04:50:49 +00:00
Merge branch 'master' into feature_skip_existing_packages_latest
This commit is contained in:
+7
-1
@@ -33,8 +33,14 @@
|
|||||||
"downloadspage": "bintray.md"
|
"downloadspage": "bintray.md"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"ResourcesInclude": "README.rst,LICENSE,AUTHORS,man/aptly.1",
|
||||||
"Arch": "386 amd64",
|
"Arch": "386 amd64",
|
||||||
"Os": "linux darwin freebsd",
|
"Os": "linux darwin freebsd",
|
||||||
"MainDirsExclude": "man,vendor",
|
"MainDirsExclude": "_man,vendor",
|
||||||
|
"BuildSettings": {
|
||||||
|
"LdFlagsXVars": {
|
||||||
|
"Version": "main.Version"
|
||||||
|
}
|
||||||
|
},
|
||||||
"ConfigVersion": "0.9"
|
"ConfigVersion": "0.9"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ before_install:
|
|||||||
- mkdir -p $GOPATH/src/github.com/smira
|
- mkdir -p $GOPATH/src/github.com/smira
|
||||||
- ln -s $TRAVIS_BUILD_DIR $GOPATH/src/github.com/smira || true
|
- ln -s $TRAVIS_BUILD_DIR $GOPATH/src/github.com/smira || true
|
||||||
- cd $GOPATH/src/github.com/smira/aptly
|
- cd $GOPATH/src/github.com/smira/aptly
|
||||||
|
- make version
|
||||||
install:
|
install:
|
||||||
- make prepare
|
- make prepare
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
GOVERSION=$(shell go version | awk '{print $$3;}')
|
GOVERSION=$(shell go version | awk '{print $$3;}')
|
||||||
|
VERSION=$(shell git describe --tags | sed 's@^v@@' | sed 's@-@+@g')
|
||||||
PACKAGES=context database deb files http query swift s3 utils
|
PACKAGES=context database deb files http query swift s3 utils
|
||||||
ALL_PACKAGES=api aptly context cmd console database deb files http query swift s3 utils
|
|
||||||
PYTHON?=python
|
PYTHON?=python
|
||||||
TESTS?=
|
TESTS?=
|
||||||
BINPATH?=$(GOPATH)/bin
|
BINPATH?=$(GOPATH)/bin
|
||||||
@@ -39,12 +39,12 @@ check:
|
|||||||
gometalinter --vendor --vendored-linters --config=linter.json ./...
|
gometalinter --vendor --vendored-linters --config=linter.json ./...
|
||||||
|
|
||||||
install:
|
install:
|
||||||
go install -v
|
go install -v -ldflags "-X main.Version=$(VERSION)"
|
||||||
|
|
||||||
system-test: install
|
system-test: install
|
||||||
if [ ! -e ~/aptly-fixture-db ]; then git clone https://github.com/aptly-dev/aptly-fixture-db.git ~/aptly-fixture-db/; fi
|
if [ ! -e ~/aptly-fixture-db ]; then git clone https://github.com/aptly-dev/aptly-fixture-db.git ~/aptly-fixture-db/; fi
|
||||||
if [ ! -e ~/aptly-fixture-pool ]; then git clone https://github.com/aptly-dev/aptly-fixture-pool.git ~/aptly-fixture-pool/; fi
|
if [ ! -e ~/aptly-fixture-pool ]; then git clone https://github.com/aptly-dev/aptly-fixture-pool.git ~/aptly-fixture-pool/; fi
|
||||||
PATH=$(BINPATH)/:$(PATH) $(PYTHON) system/run.py --long $(TESTS)
|
APTLY_VERSION=$(VERSION) PATH=$(BINPATH)/:$(PATH) $(PYTHON) system/run.py --long $(TESTS)
|
||||||
|
|
||||||
travis: $(TRAVIS_TARGET) check system-test
|
travis: $(TRAVIS_TARGET) check system-test
|
||||||
|
|
||||||
@@ -66,7 +66,6 @@ src-package:
|
|||||||
(cd aptly-$(VERSION)/bash_completion.d && wget https://raw.github.com/aptly-dev/aptly-bash-completion/$(VERSION)/aptly)
|
(cd aptly-$(VERSION)/bash_completion.d && wget https://raw.github.com/aptly-dev/aptly-bash-completion/$(VERSION)/aptly)
|
||||||
tar cyf aptly-$(VERSION)-src.tar.bz2 aptly-$(VERSION)
|
tar cyf aptly-$(VERSION)-src.tar.bz2 aptly-$(VERSION)
|
||||||
rm -rf aptly-$(VERSION)
|
rm -rf aptly-$(VERSION)
|
||||||
curl -T aptly-$(VERSION)-src.tar.bz2 -usmira:$(BINTRAY_KEY) https://api.bintray.com/content/smira/aptly/aptly/$(VERSION)/$(VERSION)/aptly-$(VERSION)-src.tar.bz2
|
|
||||||
|
|
||||||
goxc:
|
goxc:
|
||||||
rm -rf root/
|
rm -rf root/
|
||||||
@@ -79,4 +78,7 @@ goxc:
|
|||||||
man:
|
man:
|
||||||
make -C man
|
make -C man
|
||||||
|
|
||||||
.PHONY: coverage.out man
|
version:
|
||||||
|
@echo $(VERSION)
|
||||||
|
|
||||||
|
.PHONY: coverage.out man version
|
||||||
|
|||||||
+1
-1
@@ -69,7 +69,7 @@ If you have Go environment set up, you can build aptly from source by running (g
|
|||||||
mkdir -p $GOPATH/src/github.com/smira/aptly
|
mkdir -p $GOPATH/src/github.com/smira/aptly
|
||||||
git clone https://github.com/smira/aptly $GOPATH/src/github.com/smira/aptly
|
git clone https://github.com/smira/aptly $GOPATH/src/github.com/smira/aptly
|
||||||
cd $GOPATH/src/github.com/smira/aptly
|
cd $GOPATH/src/github.com/smira/aptly
|
||||||
go install .
|
make install
|
||||||
|
|
||||||
Binary would be installed to ```$GOPATH/bin/aptly``.
|
Binary would be installed to ```$GOPATH/bin/aptly``.
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
package aptly
|
package aptly
|
||||||
|
|
||||||
// Version of aptly
|
// Version of aptly (filled in at link time)
|
||||||
const Version = "0.9.8~dev"
|
var Version string
|
||||||
|
|
||||||
// EnableDebug triggers some debugging features
|
// EnableDebug triggers some debugging features
|
||||||
const EnableDebug = false
|
const EnableDebug = false
|
||||||
|
|||||||
@@ -96,6 +96,9 @@ func (s *VersionSuite) TestCompareVersions(c *C) {
|
|||||||
|
|
||||||
c.Check(CompareVersions("1.0~beta1~svn1245", "1.0~beta1"), Equals, -1)
|
c.Check(CompareVersions("1.0~beta1~svn1245", "1.0~beta1"), Equals, -1)
|
||||||
c.Check(CompareVersions("1.0~beta1", "1.0"), Equals, -1)
|
c.Check(CompareVersions("1.0~beta1", "1.0"), Equals, -1)
|
||||||
|
|
||||||
|
c.Check(CompareVersions("1.0-133-avc", "1.1"), Equals, -1)
|
||||||
|
c.Check(CompareVersions("1.0-133-avc", "1.0"), Equals, 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *VersionSuite) TestParseDependency(c *C) {
|
func (s *VersionSuite) TestParseDependency(c *C) {
|
||||||
|
|||||||
@@ -3,9 +3,19 @@ package main
|
|||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
|
"github.com/smira/aptly/aptly"
|
||||||
"github.com/smira/aptly/cmd"
|
"github.com/smira/aptly/cmd"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Version variable, filled in at link time
|
||||||
|
var Version string
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
if Version == "" {
|
||||||
|
Version = "unknown"
|
||||||
|
}
|
||||||
|
|
||||||
|
aptly.Version = Version
|
||||||
|
|
||||||
os.Exit(cmd.Run(cmd.RootCommand(), os.Args[1:], true))
|
os.Exit(cmd.Run(cmd.RootCommand(), os.Args[1:], true))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -98,6 +98,12 @@ def run(include_long_tests=False, capture_results=False, tests=None, filters=Non
|
|||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
if 'APTLY_VERSION' not in os.environ:
|
||||||
|
try:
|
||||||
|
os.environ['APTLY_VERSION'] = os.popen("make version").read().strip()
|
||||||
|
except BaseException, e:
|
||||||
|
print "Failed to capture current version: ", e
|
||||||
|
|
||||||
os.chdir(os.path.realpath(os.path.dirname(sys.argv[0])))
|
os.chdir(os.path.realpath(os.path.dirname(sys.argv[0])))
|
||||||
random.seed()
|
random.seed()
|
||||||
include_long_tests = False
|
include_long_tests = False
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
aptly version: 0.9.8~dev
|
aptly version: ${APTLY_VERSION}
|
||||||
|
|||||||
@@ -9,5 +9,6 @@ class VersionTest(BaseTest):
|
|||||||
"""
|
"""
|
||||||
version should match
|
version should match
|
||||||
"""
|
"""
|
||||||
|
gold_processor = BaseTest.expand_environ
|
||||||
|
|
||||||
runCmd = "aptly version"
|
runCmd = "aptly version"
|
||||||
|
|||||||
@@ -21,6 +21,6 @@ End command output: ------------------------------
|
|||||||
4) [Running]: version
|
4) [Running]: version
|
||||||
|
|
||||||
Begin command output: ----------------------------
|
Begin command output: ----------------------------
|
||||||
aptly version: 0.9.8~dev
|
aptly version: ${APTLY_VERSION}
|
||||||
|
|
||||||
End command output: ------------------------------
|
End command output: ------------------------------
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ class RunTask1Test(BaseTest):
|
|||||||
"""
|
"""
|
||||||
task run: simple commands, 1-word command
|
task run: simple commands, 1-word command
|
||||||
"""
|
"""
|
||||||
|
gold_processor = BaseTest.expand_environ
|
||||||
|
|
||||||
runCmd = "aptly task run repo list, repo create local, repo drop local, version"
|
runCmd = "aptly task run repo list, repo create local, repo drop local, version"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
import requests_unixsocket
|
import requests_unixsocket
|
||||||
import time
|
|
||||||
import urllib
|
import urllib
|
||||||
|
import os
|
||||||
import os.path
|
import os.path
|
||||||
|
|
||||||
from lib import BaseTest
|
from lib import BaseTest
|
||||||
|
|
||||||
|
|
||||||
class SystemdAPIHandoverTest(BaseTest):
|
class SystemdAPIHandoverTest(BaseTest):
|
||||||
aptly_server = None
|
aptly_server = None
|
||||||
socket_path = "/tmp/_aptly_systemdapihandovertest.sock"
|
socket_path = "/tmp/_aptly_systemdapihandovertest.sock"
|
||||||
@@ -37,9 +38,9 @@ class SystemdAPIHandoverTest(BaseTest):
|
|||||||
Verify we can listen on a unix domain socket.
|
Verify we can listen on a unix domain socket.
|
||||||
"""
|
"""
|
||||||
def check(self):
|
def check(self):
|
||||||
if self.aptly_server == None:
|
if self.aptly_server is None:
|
||||||
print("Skipping test as we failed to setup a listener.")
|
print("Skipping test as we failed to setup a listener.")
|
||||||
return
|
return
|
||||||
session = requests_unixsocket.Session()
|
session = requests_unixsocket.Session()
|
||||||
r = session.get('http+unix://%s/api/version' % urllib.quote(self.socket_path, safe=''))
|
r = session.get('http+unix://%s/api/version' % urllib.quote(self.socket_path, safe=''))
|
||||||
self.check_equal(r.json(), {'Version': '0.9.8~dev'})
|
self.check_equal(r.json(), {'Version': os.environ['APTLY_VERSION']})
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
import requests_unixsocket
|
import requests_unixsocket
|
||||||
import time
|
import time
|
||||||
|
import os
|
||||||
import urllib
|
import urllib
|
||||||
|
|
||||||
from lib import BaseTest
|
from lib import BaseTest
|
||||||
|
|
||||||
|
|
||||||
class UnixSocketAPITest(BaseTest):
|
class UnixSocketAPITest(BaseTest):
|
||||||
aptly_server = None
|
aptly_server = None
|
||||||
socket_path = "/tmp/_aptly_test.sock"
|
socket_path = "/tmp/_aptly_test.sock"
|
||||||
@@ -33,4 +35,4 @@ class UnixSocketAPITest(BaseTest):
|
|||||||
r = session.get('http+unix://%s/api/version' % urllib.quote(UnixSocketAPITest.socket_path, safe=''))
|
r = session.get('http+unix://%s/api/version' % urllib.quote(UnixSocketAPITest.socket_path, safe=''))
|
||||||
# Just needs to come back, we actually don't care much about the code.
|
# Just needs to come back, we actually don't care much about the code.
|
||||||
# Only needs to verify that the socket is actually responding.
|
# Only needs to verify that the socket is actually responding.
|
||||||
self.check_equal(r.json(), {'Version': '0.9.8~dev'})
|
self.check_equal(r.json(), {'Version': os.environ['APTLY_VERSION']})
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
from api_lib import APITest
|
from api_lib import APITest
|
||||||
|
import os
|
||||||
|
|
||||||
|
|
||||||
class VersionAPITest(APITest):
|
class VersionAPITest(APITest):
|
||||||
@@ -7,4 +8,4 @@ class VersionAPITest(APITest):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
def check(self):
|
def check(self):
|
||||||
self.check_equal(self.get("/api/version").json(), {'Version': '0.9.8~dev'})
|
self.check_equal(self.get("/api/version").json(), {'Version': os.environ['APTLY_VERSION']})
|
||||||
|
|||||||
Reference in New Issue
Block a user