mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-06-09 06:04:12 +00:00
Merge pull request #744 from aptly-dev/nightly-builds
Move release build to Travis CI
This commit is contained in:
+30
-11
@@ -32,6 +32,8 @@ matrix:
|
|||||||
env:
|
env:
|
||||||
- RUN_LONG_TESTS=yes
|
- RUN_LONG_TESTS=yes
|
||||||
- DEPLOY_BINARIES=yes
|
- DEPLOY_BINARIES=yes
|
||||||
|
- APTLY_USER=aptly
|
||||||
|
- secure: "ejVss+Ansvk9f237iXVd87KA8N/SkfJkEdr/KCw9WRkVw3M9WyYtFnqpakIUPFT8RsSc7MW+RU4OM90DsbE9dbDIL0oW+t6QH/IfGjNG2HjDiGEWN/tMLeAQTtzPaVqlItJBo0ILMF2K6NrgkYBYU+tZ8gk5w7CuARvAk82d00o="
|
||||||
- go: master
|
- go: master
|
||||||
env: RUN_LONG_TESTS=no
|
env: RUN_LONG_TESTS=no
|
||||||
|
|
||||||
@@ -58,16 +60,33 @@ notifications:
|
|||||||
on_start: false # default: false
|
on_start: false # default: false
|
||||||
|
|
||||||
before_deploy:
|
before_deploy:
|
||||||
- make build
|
- make release
|
||||||
- export FILE_TO_UPLOAD=$(ls build/aptly-*)
|
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
provider: releases
|
- provider: releases
|
||||||
api_key:
|
api_key:
|
||||||
- secure: "MMk5S1Im6RrVudZasjtlCJa/rvRp4oavrR86WI2kQszs1iZIcdGyVhHiOGfWTwMjA/3iPdbAdu/WrjxCwI14GC5ws+rs8ICO6JIZktjtAwlfwlrV+nsrCiYx1EThghq43VEcykgz2UAJoJj/egv+UCEpe8yDTsvJ6we5HiXdTw0="
|
- secure: "MMk5S1Im6RrVudZasjtlCJa/rvRp4oavrR86WI2kQszs1iZIcdGyVhHiOGfWTwMjA/3iPdbAdu/WrjxCwI14GC5ws+rs8ICO6JIZktjtAwlfwlrV+nsrCiYx1EThghq43VEcykgz2UAJoJj/egv+UCEpe8yDTsvJ6we5HiXdTw0="
|
||||||
file_glob: true
|
file_glob: true
|
||||||
file: "${FILE_TO_UPLOAD}"
|
file: build/*
|
||||||
skip_cleanup: true
|
skip_cleanup: true
|
||||||
on:
|
on:
|
||||||
tags: true
|
tags: true
|
||||||
condition: "$DEPLOY_BINARIES = yes"
|
condition: "$DEPLOY_BINARIES = yes"
|
||||||
|
- provider: s3
|
||||||
|
access_key_id:
|
||||||
|
secure: "I2etn22HHsQjJNhr6zdM/P4VLCYwEA/6HEf2eGvwey93oLeog+KnDCUI7lwGAHYuwzyDGQbZZ6YdoNc3b0kxaRWT0W+ke78TAdJhTZ+xbqGfEWv1er0zklJLOsimYF097rDJw8g3Oh/Gjwt5TTp0GJ5l3IhJ6zepNsKCMuwQpJM="
|
||||||
|
secret_access_key:
|
||||||
|
secure: "inRWX7FuyhkhKzGknSd2/mjZaNFZm/zHMejM99OF6PiGLNtyt/esdA0ToYL8B8Icl0/SISlLlEr/DDa4OGENKueFVeHrKH7OK0jVbWp9Yvw4hCXSlw9VmlkHDMQrC4gybS2Hf7el8N4AFVqyeUE7LqiP3WruHRdbE9XgOnTkLkg="
|
||||||
|
bucket: aptly-nightly
|
||||||
|
skip_cleanup: true
|
||||||
|
acl: public-read
|
||||||
|
local_dir: build
|
||||||
|
on:
|
||||||
|
branch: master
|
||||||
|
condition: "$DEPLOY_BINARIES = yes"
|
||||||
|
- provider: script
|
||||||
|
script: bash upload-artifacts.sh nightly
|
||||||
|
skip_cleanup: true
|
||||||
|
on:
|
||||||
|
branch: master
|
||||||
|
condition: "$DEPLOY_BINARIES = yes"
|
||||||
|
|||||||
@@ -36,11 +36,6 @@ endif
|
|||||||
install:
|
install:
|
||||||
go install -v -ldflags "-X main.Version=$(VERSION)"
|
go install -v -ldflags "-X main.Version=$(VERSION)"
|
||||||
|
|
||||||
build:
|
|
||||||
rm -rf build
|
|
||||||
mkdir -p build
|
|
||||||
go build -v -ldflags "-X main.Version=$(VERSION)" -o "build/aptly-$(VERSION)"
|
|
||||||
|
|
||||||
system/env: system/requirements.txt
|
system/env: system/requirements.txt
|
||||||
ifeq ($(RUN_LONG_TESTS), yes)
|
ifeq ($(RUN_LONG_TESTS), yes)
|
||||||
rm -rf system/env
|
rm -rf system/env
|
||||||
@@ -66,14 +61,20 @@ mem.png: mem.dat mem.gp
|
|||||||
gnuplot mem.gp
|
gnuplot mem.gp
|
||||||
open mem.png
|
open mem.png
|
||||||
|
|
||||||
goxc:
|
goxc: dev
|
||||||
rm -rf root/
|
rm -rf root/
|
||||||
mkdir -p root/usr/share/man/man1/ root/etc/bash_completion.d/ root/usr/share/zsh/vendor-completions/
|
mkdir -p root/usr/share/man/man1/ root/etc/bash_completion.d/ root/usr/share/zsh/vendor-completions/
|
||||||
cp man/aptly.1 root/usr/share/man/man1
|
cp man/aptly.1 root/usr/share/man/man1
|
||||||
cp completion.d/aptly root/etc/bash_completion.d/
|
cp completion.d/aptly root/etc/bash_completion.d/
|
||||||
cp completion.d/_aptly root/usr/share/zsh/vendor-completions/
|
cp completion.d/_aptly root/usr/share/zsh/vendor-completions/
|
||||||
gzip root/usr/share/man/man1/aptly.1
|
gzip root/usr/share/man/man1/aptly.1
|
||||||
goxc -pv=$(VERSION) -max-processors=4 $(GOXC_OPTS)
|
goxc -pv=$(VERSION) -max-processors=2 $(GOXC_OPTS)
|
||||||
|
|
||||||
|
release: GOXC_OPTS=-tasks-=bintray,go-vet,go-test,rmbin
|
||||||
|
release: goxc
|
||||||
|
rm -rf build/
|
||||||
|
mkdir -p build/
|
||||||
|
mv xc-out/$(VERSION)/aptly_$(VERSION)_* build/
|
||||||
|
|
||||||
man:
|
man:
|
||||||
make -C man
|
make -C man
|
||||||
@@ -81,4 +82,4 @@ man:
|
|||||||
version:
|
version:
|
||||||
@echo $(VERSION)
|
@echo $(VERSION)
|
||||||
|
|
||||||
.PHONY: man version build
|
.PHONY: man version release goxc
|
||||||
|
|||||||
+1
-1
@@ -6,7 +6,7 @@ Documentation=https://www.aptly.info/doc/api/
|
|||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
ExecStart=/usr/bin/aptly serve api -no-lock -listen=127.0.0.1:8081
|
ExecStart=/usr/bin/aptly api serve -no-lock -listen=127.0.0.1:8081
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|||||||
@@ -0,0 +1,35 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
builds=build/
|
||||||
|
packages=${builds}*.deb
|
||||||
|
folder=`mktemp -u tmp.XXXXXXXXXXXXXXX`
|
||||||
|
aptly_user="$APTLY_USER"
|
||||||
|
aptly_password="$APTLY_PASSWORD"
|
||||||
|
aptly_api="https://internal.aptly.info"
|
||||||
|
|
||||||
|
for file in $packages; do
|
||||||
|
echo "Uploading $file..."
|
||||||
|
curl -sS -X POST -F "file=@$file" -u $aptly_user:$aptly_password ${aptly_api}/api/files/$folder
|
||||||
|
echo
|
||||||
|
done
|
||||||
|
|
||||||
|
if [[ "$1" = "nightly" ]]; then
|
||||||
|
aptly_repository=aptly-nightly
|
||||||
|
aptly_published=s3:repo.aptly.info:./nightly
|
||||||
|
|
||||||
|
echo "Adding packages to $aptly_repository..."
|
||||||
|
curl -sS -X POST -u $aptly_user:$aptly_password ${aptly_api}/api/repos/$aptly_repository/file/$folder
|
||||||
|
echo
|
||||||
|
|
||||||
|
echo "Updating published repo..."
|
||||||
|
curl -sS -X PUT -H 'Content-Type: application/json' --data \
|
||||||
|
'{"AcquireByHash": true, "Signing": {"Batch": true, "Keyring": "aptly.repo/aptly.pub",
|
||||||
|
"secretKeyring": "aptly.repo/aptly.sec", "PassphraseFile": "aptly.repo/passphrase"}}' \
|
||||||
|
-u $aptly_user:$aptly_password ${aptly_api}/api/publish/$aptly_published
|
||||||
|
echo
|
||||||
|
fi
|
||||||
|
|
||||||
|
curl -sS -X DELETE -u $aptly_user:$aptly_password ${aptly_api}/api/files/$folder
|
||||||
|
echo
|
||||||
Reference in New Issue
Block a user