-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jason Mobarak
committed
Jun 11, 2018
1 parent
2fe5fd2
commit af610b3
Showing
9 changed files
with
177 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/usr/bin/env bash | ||
git describe --tags --always --dirty |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Copyright (C) 2018 Swift Navigation Inc. | ||
# Contact: Swift Navigation <[email protected]> | ||
# | ||
# This source is subject to the license found in the file 'LICENSE' which must | ||
# be be distributed together with this source. All other rights reserved. | ||
# | ||
# THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, | ||
# EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED | ||
# WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. | ||
|
||
set -euo pipefail | ||
IFS=$'\n\t' | ||
|
||
while [[ $# -gt 0 ]]; do | ||
case $1 in | ||
|
||
--arch=x86) ARCH="X86"; shift ;; | ||
--arch=arm) ARCH="ARM"; shift ;; | ||
--arch=arm,x86) ARCH="ARM\\;X86"; shift ;; | ||
--arch=x86,arm) ARCH="ARM\\;X86"; shift ;; | ||
|
||
--variant=vanilla) VARIANT="vanilla"; shift ;; | ||
--variant=obfuscator) VARIANT="obfuscator"; shift ;; | ||
|
||
--verbose) VERBOSE="-v"; shift ;; | ||
--no-tty) NO_TTY=--no-tty; shift ;; | ||
|
||
*) shift ;; | ||
esac | ||
done | ||
|
||
if [[ -z "${ARCH:-}" ]]; then | ||
echo "Error: must specify --arch=<arm|x86|arm,x86|x86,arm>" | ||
exit 1 | ||
fi | ||
|
||
if [[ -z "${VARIANT:-}" ]]; then | ||
echo "Error: must a variant to --variant=<vanilla|obfuscator>" | ||
exit 1 | ||
fi | ||
|
||
BUILD_VERSION="$(./describe_repo.bash)" | ||
ARCH="$(echo ${ARCH} | sed 's@\\;@-@g')" | ||
|
||
CCACHE_ARCHIVE="ccache-${VARIANT}-${ARCH}-${BUILD_VERSION}.tbz2" | ||
|
||
./s3_download.bash ${CCACHE_ARCHIVE} | ||
|
||
docker run ${INTERACTIVE[@]:-} --rm \ | ||
-v "$PWD:/this_dir" \ | ||
-v $VARIANT-llvm-ccache:/work/ccache \ | ||
"$DOCKER_NAMETAG-$VARIANT" \ | ||
/bin/bash -c "tar -xjf ${CCACHE_ARCHIVE} -C /work/ccache ." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Copyright (C) 2018 Swift Navigation Inc. | ||
# Contact: Swift Navigation <[email protected]> | ||
# | ||
# This source is subject to the license found in the file 'LICENSE' which must | ||
# be be distributed together with this source. All other rights reserved. | ||
# | ||
# THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, | ||
# EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED | ||
# WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. | ||
|
||
set -euo pipefail | ||
IFS=$'\n\t' | ||
|
||
[[ -z "${DEBUG:-}" ]] || set -x | ||
|
||
DOCKER_NAMETAG=$(cat docker_nametag) | ||
|
||
while [[ $# -gt 0 ]]; do | ||
case $1 in | ||
|
||
--arch=x86) ARCH="X86"; shift ;; | ||
--arch=arm) ARCH="ARM"; shift ;; | ||
--arch=arm,x86) ARCH="ARM\\;X86"; shift ;; | ||
--arch=x86,arm) ARCH="ARM\\;X86"; shift ;; | ||
|
||
--variant=vanilla) VARIANT="vanilla"; shift ;; | ||
--variant=obfuscator) VARIANT="obfuscator"; shift ;; | ||
|
||
--verbose) VERBOSE="-v"; shift ;; | ||
--no-tty) NO_TTY=--no-tty; shift ;; | ||
|
||
*) shift ;; | ||
esac | ||
done | ||
|
||
if [[ -z "${ARCH:-}" ]]; then | ||
echo "Error: must specify --arch=<arm|x86|arm,x86|x86,arm>" | ||
exit 1 | ||
fi | ||
|
||
if [[ -z "${VARIANT:-}" ]]; then | ||
echo "Error: must a variant to build --variant=<vanilla|obfuscator>" | ||
exit 1 | ||
fi | ||
|
||
BUILD_VERSION="$(./describe_repo.bash)" | ||
ARCH="$(echo ${ARCH} | sed 's@\\;@-@g')" | ||
|
||
CCACHE_ARCHIVE="ccache-${VARIANT}-${ARCH}-${BUILD_VERSION}.tbz2" | ||
|
||
docker run -it --rm \ | ||
-v "$PWD:/this_dir" \ | ||
-v $VARIANT-llvm-ccache:/work/ccache \ | ||
"$DOCKER_NAMETAG-$VARIANT" \ | ||
/bin/bash -c "tar -cjf ${CCACHE_ARCHIVE} -C /work/ccache ." | ||
|
||
./publish.sh "${CCACHE_ARCHIVE}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/bash | ||
|
||
# Copyright (C) 2016 Swift Navigation Inc. | ||
# Contact: Fergus Noble <[email protected]> | ||
# | ||
# This source is subject to the license found in the file 'LICENSE' which must | ||
# be be distributed together with this source. All other rights reserved. | ||
# | ||
# THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, | ||
# EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED | ||
# WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. | ||
# | ||
# Script for downloading firmware and NAP binaries from S3 to be incorporated | ||
# into the Linux image. | ||
|
||
set -xe | ||
|
||
REPO="${PWD##*/}" | ||
BUCKET="${BUCKET:-llvm-obfuscator-arm}" | ||
|
||
BUILD_VERSION="$(describe_repo.bash)" | ||
BUILD_PATH="$REPO/$BUILD_VERSION" | ||
if [[ ! -z "$PRODUCT_VERSION" ]]; then | ||
BUILD_PATH="$BUILD_PATH/$PRODUCT_VERSION" | ||
fi | ||
if [[ ! -z "$PRODUCT_REV" ]]; then | ||
BUILD_PATH="$BUILD_PATH/$PRODUCT_REV" | ||
fi | ||
if [[ ! -z "$PRODUCT_TYPE" ]]; then | ||
BUILD_PATH="$BUILD_PATH/$PRODUCT_TYPE" | ||
fi | ||
|
||
echo "Downloading $* to $BUILD_PATH" | ||
|
||
for file in "$@"; do | ||
KEY="$BUILD_PATH/$(basename "$file")" | ||
OBJECT="s3://$BUCKET/$KEY" | ||
aws s3 cp "$OBJECT" "$file" | ||
done |