Experimental windows build process changes

This commit is contained in:
Cameron Sparr 2016-02-22 15:16:46 -07:00
parent 54ee44839c
commit 0074696e67
3 changed files with 28 additions and 18 deletions

View File

@ -1,4 +1,4 @@
git.eclipse.org/gitroot/paho/org.eclipse.paho.mqtt.golang.git dbd8d5c40a582eb9adacde36b47932b3a3ad0034 git.eclipse.org/gitroot/paho/org.eclipse.paho.mqtt.golang.git 617c801af238c3af2d9e72c5d4a0f02edad03ce5
github.com/Shopify/sarama d37c73f2b2bce85f7fa16b6a550d26c5372892ef github.com/Shopify/sarama d37c73f2b2bce85f7fa16b6a550d26c5372892ef
github.com/Sirupsen/logrus f7f79f729e0fbe2fcc061db48a9ba0263f588252 github.com/Sirupsen/logrus f7f79f729e0fbe2fcc061db48a9ba0263f588252
github.com/StackExchange/wmi f3e2bae1e0cb5aef83e319133eabfee30013a4a5 github.com/StackExchange/wmi f3e2bae1e0cb5aef83e319133eabfee30013a4a5
@ -21,18 +21,18 @@ github.com/gorilla/context 1c83b3eabd45b6d76072b66b746c20815fb2872d
github.com/gorilla/mux 26a6070f849969ba72b72256e9f14cf519751690 github.com/gorilla/mux 26a6070f849969ba72b72256e9f14cf519751690
github.com/hailocab/go-hostpool e80d13ce29ede4452c43dea11e79b9bc8a15b478 github.com/hailocab/go-hostpool e80d13ce29ede4452c43dea11e79b9bc8a15b478
github.com/influxdata/config bae7cb98197d842374d3b8403905924094930f24 github.com/influxdata/config bae7cb98197d842374d3b8403905924094930f24
github.com/influxdata/influxdb a9552fdd91361819a792f337e5d9998859732a67 github.com/influxdata/influxdb ef571fc104dc24b77cd3710c156cd95e5cfd7aa5
github.com/influxdb/influxdb a9552fdd91361819a792f337e5d9998859732a67
github.com/jmespath/go-jmespath c01cf91b011868172fdcd9f41838e80c9d716264 github.com/jmespath/go-jmespath c01cf91b011868172fdcd9f41838e80c9d716264
github.com/klauspost/crc32 999f3125931f6557b991b2f8472172bdfa578d38 github.com/klauspost/crc32 999f3125931f6557b991b2f8472172bdfa578d38
github.com/lib/pq 8ad2b298cadd691a77015666a5372eae5dbfac8f github.com/lib/pq 8ad2b298cadd691a77015666a5372eae5dbfac8f
github.com/lxn/win 9a7734ea4db26bc593d52f6a8a957afdad39c5c1 github.com/lxn/win 9a7734ea4db26bc593d52f6a8a957afdad39c5c1
github.com/matttproud/golang_protobuf_extensions d0c3fe89de86839aecf2e0579c40ba3bb336a453 github.com/matttproud/golang_protobuf_extensions d0c3fe89de86839aecf2e0579c40ba3bb336a453
github.com/miekg/dns e0d84d97e59bcb6561eae269c4e94d25b66822cb
github.com/mreiferson/go-snappystream 028eae7ab5c4c9e2d1cb4c4ca1e53259bbe7e504 github.com/mreiferson/go-snappystream 028eae7ab5c4c9e2d1cb4c4ca1e53259bbe7e504
github.com/naoina/go-stringutil 6b638e95a32d0c1131db0e7fe83775cbea4a0d0b github.com/naoina/go-stringutil 6b638e95a32d0c1131db0e7fe83775cbea4a0d0b
github.com/naoina/toml 751171607256bb66e64c9f0220c00662420c38e9 github.com/naoina/toml 751171607256bb66e64c9f0220c00662420c38e9
github.com/nats-io/nats 6a83f1a633cfbfd90aa648ac99fb38c06a8b40df
github.com/nsqio/go-nsq 2118015c120962edc5d03325c680daf3163a8b5f github.com/nsqio/go-nsq 2118015c120962edc5d03325c680daf3163a8b5f
github.com/pborman/uuid dee7705ef7b324f27ceb85a121c61f2c2e8ce988
github.com/pmezard/go-difflib 792786c7400a136282c1664665ae0a8db921c6c2 github.com/pmezard/go-difflib 792786c7400a136282c1664665ae0a8db921c6c2
github.com/prometheus/client_golang 67994f177195311c3ea3d4407ed0175e34a4256f github.com/prometheus/client_golang 67994f177195311c3ea3d4407ed0175e34a4256f
github.com/prometheus/client_model fa8ad6fec33561be4280a8f0514318c79d7f6cb6 github.com/prometheus/client_model fa8ad6fec33561be4280a8f0514318c79d7f6cb6

View File

@ -76,7 +76,7 @@ supported_builds = {
supported_packages = { supported_packages = {
"darwin": [ "tar", "zip" ], "darwin": [ "tar", "zip" ],
"linux": [ "deb", "rpm", "tar", "zip" ], "linux": [ "deb", "rpm", "tar", "zip" ],
"windows": [ "tar", "zip" ], "windows": [ "zip" ],
} }
supported_tags = { supported_tags = {
# "linux": { # "linux": {
@ -351,8 +351,12 @@ def create_package_fs(build_root):
create_dir(os.path.join(build_root, d)) create_dir(os.path.join(build_root, d))
os.chmod(os.path.join(build_root, d), 0o755) os.chmod(os.path.join(build_root, d), 0o755)
def package_scripts(build_root): def package_scripts(build_root, windows=False):
print("\t- Copying scripts and sample configuration to build directory") print("\t- Copying scripts and sample configuration to build directory")
if windows:
shutil.copyfile(DEFAULT_CONFIG, os.path.join(build_root, "telegraf.conf"))
os.chmod(os.path.join(build_root, "telegraf.conf"), 0o644)
else:
shutil.copyfile(INIT_SCRIPT, os.path.join(build_root, SCRIPT_DIR[1:], INIT_SCRIPT.split('/')[1])) shutil.copyfile(INIT_SCRIPT, os.path.join(build_root, SCRIPT_DIR[1:], INIT_SCRIPT.split('/')[1]))
os.chmod(os.path.join(build_root, SCRIPT_DIR[1:], INIT_SCRIPT.split('/')[1]), 0o644) os.chmod(os.path.join(build_root, SCRIPT_DIR[1:], INIT_SCRIPT.split('/')[1]), 0o644)
shutil.copyfile(SYSTEMD_SCRIPT, os.path.join(build_root, SCRIPT_DIR[1:], SYSTEMD_SCRIPT.split('/')[1])) shutil.copyfile(SYSTEMD_SCRIPT, os.path.join(build_root, SCRIPT_DIR[1:], SYSTEMD_SCRIPT.split('/')[1]))
@ -366,6 +370,7 @@ def go_get():
print("Retrieving Go dependencies...") print("Retrieving Go dependencies...")
run("go get github.com/sparrc/gdm") run("go get github.com/sparrc/gdm")
run("gdm restore") run("gdm restore")
run("gdm restore -f Godeps_windows")
def generate_md5_from_file(path): def generate_md5_from_file(path):
m = hashlib.md5() m = hashlib.md5()
@ -395,6 +400,9 @@ def build_packages(build_output, version, pkg_arch, nightly=False, rc=None, iter
build_root = os.path.join(tmp_build_dir, p, a) build_root = os.path.join(tmp_build_dir, p, a)
# Create directory tree to mimic file system of package # Create directory tree to mimic file system of package
create_dir(build_root) create_dir(build_root)
if p == 'windows':
package_scripts(build_root, windows=True)
else:
create_package_fs(build_root) create_package_fs(build_root)
# Copy in packaging and miscellaneous scripts # Copy in packaging and miscellaneous scripts
package_scripts(build_root) package_scripts(build_root)
@ -403,7 +411,7 @@ def build_packages(build_output, version, pkg_arch, nightly=False, rc=None, iter
if p == 'windows': if p == 'windows':
b = b + '.exe' b = b + '.exe'
fr = os.path.join(current_location, b) fr = os.path.join(current_location, b)
to = os.path.join(build_root, INSTALL_ROOT_DIR[1:], b) to = os.path.join(build_root, b)
print("\t- [{}][{}] - Moving from '{}' to '{}'".format(p, a, fr, to)) print("\t- [{}][{}] - Moving from '{}' to '{}'".format(p, a, fr, to))
copy_file(fr, to) copy_file(fr, to)
# Package the directory structure # Package the directory structure
@ -445,6 +453,7 @@ def build_packages(build_output, version, pkg_arch, nightly=False, rc=None, iter
if package_type == "rpm": if package_type == "rpm":
fpm_command += "--depends coreutils " fpm_command += "--depends coreutils "
fpm_command += "--depends lsof" fpm_command += "--depends lsof"
print(fpm_command)
out = run(fpm_command, shell=True) out = run(fpm_command, shell=True)
matches = re.search(':path=>"(.*)"', out) matches = re.search(':path=>"(.*)"', out)
outfile = None outfile = None

View File

@ -76,5 +76,6 @@ if [ $? -eq 0 ]; then
tag=$(git describe --exact-match HEAD) tag=$(git describe --exact-match HEAD)
echo $tag echo $tag
exit_if_fail ./scripts/build.py --package --version=$tag --platform=linux --arch=all --upload exit_if_fail ./scripts/build.py --package --version=$tag --platform=linux --arch=all --upload
exit_if_fail ./scripts/build.py --package --version=$tag --platform=windows --arch=all --upload
mv build $CIRCLE_ARTIFACTS mv build $CIRCLE_ARTIFACTS
fi fi