forked from google/grr
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add CD for client templates and components.
- Client templates and components will now be built on every commit and uploaded to cloud storage for OS X and linux (appveyor handles windows). - Fix a objectfilter bug
- Loading branch information
Showing
8 changed files
with
111 additions
and
29 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,36 @@ | ||
language: python | ||
sudo: false | ||
python: 2.7 | ||
# From https://goo.gl/XuEMpi GCP CD with travis | ||
env: PROTOC="${HOME}/protobuf/bin/protoc" PATH=$PATH:${HOME}/google-cloud-sdk/bin CLOUDSDK_CORE_DISABLE_PROMPTS=1 | ||
matrix: | ||
include: | ||
- os: linux | ||
language: python | ||
python: 2.7 | ||
sudo: false | ||
- os: osx | ||
# psutil fails to install on the default beta-xcode6.1 | ||
osx_image: beta-xcode6.2 | ||
language: generic | ||
sudo: required | ||
cache: | ||
directories: | ||
- $HOME/.cache/pip | ||
- $HOME/protobuf | ||
python: | ||
- "2.7" | ||
before_install: /bin/bash travis/install_protobuf.sh | ||
env: | ||
- PROTOC="${HOME}/protobuf/bin/protoc" | ||
- $HOME/.cache/pip | ||
- $HOME/protobuf | ||
before_install: | ||
- /bin/bash travis/install_protobuf.sh | ||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update && brew install libffi && git clone https://github.com/MacPython/terryfy && source terryfy/travis_tools.sh; get_python_environment macpython 2.7.11; fi | ||
# We upgrade pip inside the virtualenv to avoid sudo here. | ||
- pip install --upgrade virtualenv | ||
- virtualenv ${HOME}/INSTALL | ||
install: | ||
- pip install --upgrade pip wheel setuptools | ||
- pip install -e . | ||
- pip install -e grr/config/grr-response-server/ | ||
- pip install -e grr/config/grr-response-test/ | ||
- python makefile.py | ||
- cd grr/artifacts && python makefile.py && cd - | ||
script: grr_run_tests --processes=2 | ||
- /bin/bash travis/install.sh | ||
script: | ||
- grr_run_tests --processes=2 | ||
- /bin/bash travis/deploy_to_gcs.sh | ||
addons: | ||
apt: | ||
packages: | ||
- libffi-dev | ||
- libssl-dev | ||
- python-dev | ||
- prelink | ||
|
||
|
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
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,60 @@ | ||
#!/bin/bash | ||
|
||
# Build client templates and upload them to cloud storage. | ||
# | ||
# This script must be run inside travis, as it relies on some travis specific | ||
# environment variables. Ideally it should run in the travis deploy stage rather | ||
# than the script phase (which will run for every pull request), but here is a | ||
# litany of reasons why it doesn't. | ||
# | ||
# There is already a travis gcs deployer but it isn't usable: | ||
# https://github.com/travis-ci/dpl/issues/476 | ||
# | ||
# When using the experimental script deployer there were differences between the | ||
# virtual env in the deploy and install stages that caused the client build to | ||
# fail (previously installed grr-* packages would somehow be missing from the | ||
# virtualenv). I'm still attempting to make a minimal reproducible case for a | ||
# good bug report there. | ||
# | ||
# and it's also annoying to debug: | ||
# https://github.com/travis-ci/dpl/issues/477 | ||
# | ||
# We could use after_success but it doesn't exit on error: | ||
# https://github.com/travis-ci/travis-ci/issues/758 | ||
|
||
set -e | ||
|
||
source "${HOME}/INSTALL/bin/activate" | ||
|
||
# Temporary workaround until we migrate off PackageMaker. | ||
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then | ||
cd /Applications | ||
wget -q https://storage.googleapis.com/grr-osx-buildtools/packagemaker.tar.gz | ||
tar zxf packagemaker.tar.gz | ||
cd - | ||
fi | ||
|
||
grr_client_build build --output built_templates | ||
grr_client_build build_components --output built_templates | ||
|
||
# If we don't have the sdk, go get it. While we could cache the cloud sdk | ||
# directory it may contain authentication tokens after the authorization step | ||
# below, so we don't. | ||
gcloud version || ( wget -q https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-116.0.0-linux-x86_64.tar.gz && tar zxf google-cloud-sdk-116.0.0-linux-x86_64.tar.gz -C "${HOME}" ) | ||
|
||
# See https://docs.travis-ci.com/user/encrypting-files/ | ||
openssl aes-256-cbc -K "$encrypted_db009a5a71c6_key" \ | ||
-iv "$encrypted_db009a5a71c6_iv" \ | ||
-in travis/travis_uploader_service_account.json.enc \ | ||
-out travis/travis_uploader_service_account.json -d | ||
|
||
gcloud auth activate-service-account --key-file travis/travis_uploader_service_account.json | ||
echo Uploading templates to "gs://autobuilds.grr-response.com/${TRAVIS_JOB_NUMBER}" | ||
gsutil -m cp built_templates/* "gs://autobuilds.grr-response.com/${TRAVIS_JOB_NUMBER}/" | ||
|
||
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then | ||
shred -u travis/travis_uploader_service_account.json | ||
fi | ||
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then | ||
srm -sz travis/travis_uploader_service_account.json | ||
fi |
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,17 @@ | ||
#!/bin/bash | ||
|
||
# Install grr into a virtualenv | ||
|
||
set -e | ||
|
||
source "${HOME}/INSTALL/bin/activate" | ||
pip install --upgrade pip wheel setuptools | ||
pip install -e . | ||
pip install -e grr/config/grr-response-test/ | ||
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then | ||
pip install -e grr/config/grr-response-server/ | ||
fi | ||
pip install -e grr/config/grr-response-client/ | ||
|
||
python makefile.py | ||
cd grr/artifacts && python makefile.py && cd - |
Binary file not shown.