Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
borg-binaries
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Borg Binary Builder
borg-binaries
Commits
9e0321be
Commit
9e0321be
authored
Oct 07, 2018
by
noplanman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Gitlab ci tests
parent
c2de5f9a
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
123 additions
and
39 deletions
+123
-39
.gitlab-ci.yml
.gitlab-ci.yml
+41
-0
.travis.yml
.travis.yml
+0
-16
Dockerfile
Dockerfile
+3
-3
README.md
README.md
+5
-5
build.sh
build.sh
+5
-3
ci/bintray.sh
ci/bintray.sh
+52
-0
extract.sh
extract.sh
+17
-12
No files found.
.gitlab-ci.yml
0 → 100644
View file @
9e0321be
variables
:
VERSION
:
$CI_COMMIT_TAG
stages
:
-
build
-
deploy
armv5
:
extends
:
.main
variables
:
{
ARCH
:
armel
,
NAME
:
"
borg-${VERSION}-armv5"
}
armv7
:
extends
:
.main
variables
:
{
ARCH
:
armv7hf
,
NAME
:
"
borg-${VERSION}-armv7"
}
arm64
:
extends
:
.main
variables
:
{
ARCH
:
aarch64
,
NAME
:
"
borg-${VERSION}-arm64"
}
.main
:
stage
:
build
only
:
[
tags
]
variables
:
{
NAME
:
"
borg-${VERSION}-${ARCH}"
}
script
:
-
./build.sh $ARCH $VERSION
-
./extract.sh $ARCH $VERSION $NAME
artifacts
:
expire_in
:
1 day
paths
:
[
$NAME
]
deploy artifacts to bintray
:
stage
:
deploy
only
:
[
tags
]
script
:
-
md5sum borg-${VERSION}-*
-
apk add curl
-
ci/bintray.sh
dependencies
:
-
armv5
-
armv7
-
arm64
.travis.yml
deleted
100644 → 0
View file @
c2de5f9a
sudo
:
required
language
:
bash
services
:
-
docker
before_install
:
-
docker -v
-
mkdir /tmp/borg-binaries
script
:
-
./build.sh $ARCH
-
./extract.sh $ARCH /tmp/borg-binaries/$NAME
after_script
:
-
md5sum /tmp/borg-binaries/*
env
:
-
ARCH="armel" NAME="armv5"
-
ARCH="armv7hf" NAME="armv7"
-
ARCH="aarch64" NAME="arm64"
Dockerfile
View file @
9e0321be
...
...
@@ -19,12 +19,12 @@ RUN set -ex; \
zlib1g-dev liblz4-dev
;
\
rm
-rf
/var/lib/apt/lists/
*
;
#
install borg + dependencies
#
fetch borg source code and update pip
RUN
set
-ex
;
\
git clone https://github.com/borgbackup/borg.git .
;
\
git checkout
${
BORG_VERSION
}
;
\
git clone
-b
${
BORG_VERSION
}
https://github.com/borgbackup/borg.git .
;
\
pip
install
--upgrade
pip
;
# install borg + dependencies
RUN
set
-ex
;
pip
install
-r
requirements.d/development.txt
;
RUN
set
-ex
;
pip
install
-r
requirements.d/fuse.txt
;
RUN
set
-ex
;
pip
install
-e
.
;
...
...
README.md
View file @
9e0321be
...
...
@@ -19,16 +19,16 @@ See the [list of available architectures] ([on GitHub][available-architectures-g
### Extract borg binary
`./extract.sh <arch> [<binary_save_location>]`
`./extract.sh <arch> [<
version>] [<
binary_save_location>]`
**Note:**
This will overwrite the file at
`binary_save_location`
if it already exists!
*Examples:*
-
Extract borg binary for
`aarch64`
to
`borg-aarch64`
in current folder
`./extract.sh aarch64 borg-aarch64`
-
Extract borg
`1.1.7`
binary for
`aarch64`
to
`borg-aarch64`
in current folder
`./extract.sh aarch64
1.1.7
borg-aarch64`
-
Extract borg binary for Raspberry Pi 3 to
`/homes/lemoi/borg`
`./extract.sh raspberrypi3 /homes/lemoi/borg`
-
Extract borg
`1.1.5`
binary for Raspberry Pi 3 to
`/homes/lemoi/borg`
`./extract.sh raspberrypi3
1.1.5
/homes/lemoi/borg`
## How this works
...
...
build.sh
View file @
9e0321be
#!/usr/bin/env
ba
sh
#!/usr/bin/env sh
# Usage: ./build.sh <arch> [<version>]
...
...
@@ -8,9 +8,11 @@
BORG_ARCH
=
${
1
}
BORG_VERSION
=
${
2
:-
1
.1.7
}
DOCKER_IMAGE
=
borg:
${
BORG_VERSION
}
-
${
BORG_ARCH
}
if
[
-z
"
${
BORG_ARCH
}
"
]
;
then
echo
"Usage: ./build.sh <arch> [<version>]"
;
echo
"
- No arch provided -
"
;
echo
"
No arch provided
"
;
exit
1
;
fi
...
...
@@ -22,4 +24,4 @@ docker run --rm --privileged multiarch/qemu-user-static:register --reset
docker build
\
--build-arg
"BORG_ARCH=
${
BORG_ARCH
}
"
\
--build-arg
"BORG_VERSION=
${
BORG_VERSION
}
"
\
-t
"
borg:
${
BORG_ARCH
}
"
.
-t
"
${
DOCKER_IMAGE
}
"
.
ci/bintray.sh
0 → 100755
View file @
9e0321be
#!/usr/bin/env sh
# Based on bintray.sh by Lukas Matt (@zauberstuhl)
# https://git.feneas.org/ganggo/ganggo/blob/master/ci/scripts/bintray.sh
# Note: Set via GitLab protected vars!
# BINTRAY_USER=$1
# BINTRAY_API_KEY=$2
# BINTRAY_REPO=$3
PKG_NAME
=
borg-binaries
API
=
https://api.bintray.com
CURL
=
"curl -u
${
BINTRAY_USER
}
:
${
BINTRAY_API_KEY
}
-H Content-Type:application/json -H Accept:application/json"
DATA
=
"{
\"
name
\"
:
\"
${
PKG_NAME
}
\"
,
\"
desc
\"
:
\"
BorgBackup binaries for various architectures
\"
,
\"
vcs_url
\"
:
\"
${
CI_PROJECT_URL
}
\"
,
\"
licenses
\"
: [
\"
WTFPL
\"
],
\"
issue_tracker_url
\"
:
\"
${
CI_PROJECT_URL
}
/issues
\"
,
\"
website_url
\"
:
\"
${
CI_PROJECT_URL
}
\"
,
\"
desc_url
\"
:
\"
${
CI_PROJECT_URL
}
\"
,
\"
labels
\"
: [
\"
borg
\"
,
\"
borgbackup
\"
,
\"
binaries
\"
],
\"
public_download_numbers
\"
: true,
\"
public_stats
\"
: true
}"
echo
"Creating package
${
PKG_NAME
}
..."
${
CURL
}
-X
POST
-d
"
${
DATA
}
"
"
${
API
}
/packages/
${
BINTRAY_REPO
}
"
for
BIN
in
$(
ls
borg-
${
VERSION
}
-
*
)
;
do
LOG
=
$(
mktemp
)
ARCH
=
$(
echo
"
${
BIN
}
"
|
cut
-d
/
-f4
|
cut
-d-
-f3
)
UPSTREAM
=
"borg-
${
VERSION
}
-
${
ARCH
}
"
STATUS_CODE
=
$(
${
CURL
}
--write-out
%
{
http_code
}
--silent
--output
"
${
LOG
}
"
\
-T
"
${
BIN
}
"
-H
X-Bintray-Package:
"
${
PKG_NAME
}
"
-H
X-Bintray-Version:
"
${
VERSION
}
"
\
"
${
API
}
/content/
${
BINTRAY_REPO
}
/
${
UPSTREAM
}
"
)
if
[
$STATUS_CODE
-eq
201
]
;
then
echo
"Publishing
${
UPSTREAM
}
..."
echo
$(
${
CURL
}
-X
POST
-d
"{
\"
discard
\"
:
\"
false
\"
}"
\
${
API
}
/content/
${
BINTRAY_REPO
}
/
${
PKG_NAME
}
/
${
VERSION
}
/publish
)
else
echo
"Cannot publish
${
UPSTREAM
}
!"
&&
cat
${
LOG
}
&&
exit
1
fi
rm
"
${
LOG
}
"
done
extract.sh
View file @
9e0321be
#!/usr/bin/env
ba
sh
#!/usr/bin/env sh
# Usage: ./extract.sh <arch> [<binary_save_location>]
# Usage: ./extract.sh <arch> [<
version>] [<
binary_save_location>]
BORG_ARCH
=
${
1
:-
aarch64
}
BORG_BINARY
=
${
2
:-
borg
-
${
BORG_ARCH
}}
BORG_ARCH
=
${
1
}
BORG_VERSION
=
${
2
:-
1
.1.7
}
BORG_BINARY
=
${
3
:-
borg
-
${
BORG_VERSION
}
-
${
BORG_ARCH
}}
#if [[ "$(docker images -q "borg:${BORG_ARCH}" 2> /dev/null)" == "" ]]; then
if
!
docker inspect
"borg:
${
BORG_ARCH
}
"
>
/dev/null 2>&1
;
then
echo
"Couldn't find the 'borg:
${
BORG_ARCH
}
' image!"
echo
"Create the image first, using './build.sh
${
BORG_ARCH
}
'"
exit
1
DOCKER_IMAGE
=
borg:
${
BORG_VERSION
}
-
${
BORG_ARCH
}
if
[
-z
"
${
BORG_ARCH
}
"
]
;
then
echo
"Usage: ./build.sh <arch> [<version>]"
;
echo
"No arch provided"
;
exit
1
;
fi
#docker run -v "${PWD}":"/opt/mount" --rm --entrypoint \
# cp "borg:${BORG_ARCH}" "/usr/bin/borg" "/opt/mount/${BORG_BINARY}"
if
!
docker inspect
"
${
DOCKER_IMAGE
}
"
>
/dev/null 2>&1
;
then
echo
"Couldn't find the '
${
DOCKER_IMAGE
}
' docker image!"
echo
"Create the image first, using './build.sh
${
BORG_ARCH
}
${
BORG_VERSION
}
'"
exit
1
fi
docker run
--rm
--entrypoint
cat
"
borg:
${
BORG_ARCH
}
"
/usr/bin/borg
>
"
${
BORG_BINARY
}
"
docker run
--rm
--entrypoint
cat
"
${
DOCKER_IMAGE
}
"
/usr/bin/borg
>
"
${
BORG_BINARY
}
"
chmod
+x
"
${
BORG_BINARY
}
"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment