Skip to content
This repository has been archived by the owner on Jul 6, 2020. It is now read-only.

Commit

Permalink
Pipeline (#625)
Browse files Browse the repository at this point in the history
* Added initial release automation script

* Updated DevOps Pipfile and frankfurter env

* Standardized Shepherd installation

* Updated README by using local PiE logo

* Added prompt function to frankfurter env

* Added version number flag to runtime

* Added dawn version printing

* Added release number editing in makerelease

* Enabled makerelease tagging

* Added encrypted artifacts private key file

* Updated pipeline script to use PyGitHub client

* Added upload functionality

* Modified encrypted key path

* Removed homedir from openssl decryption

* Trying to fix path issues with encrypted key

* Cleaned runtime to pass linter, using Shepherd Pipfile

* Use global Travis env variable for APP_ID
  • Loading branch information
jonathan-j-lee authored Oct 8, 2018
1 parent c9e1f3b commit 52162a1
Show file tree
Hide file tree
Showing 23 changed files with 803 additions and 134 deletions.
25 changes: 15 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,29 @@ python:
os:
- linux
env:
- TEST_DIR=dawn
- TEST_DIR=hibike/travis
- TEST_DIR=runtime
- TEST_DIR=shepherd
global:
- APP_ID=15634
matrix:
- TEST_DIR=dawn
- TEST_DIR=hibike/travis
- TEST_DIR=runtime
- TEST_DIR=shepherd
cache:
pip: true
directories:
- node_modules
- $HOME/.cache/yarn
before_install:
- openssl aes-256-cbc -K $encrypted_516b8f19f8a6_key -iv $encrypted_516b8f19f8a6_iv -in DevOps/pipeline/piecentral-artifacts.pem.encrypted -out DevOps/pipeline/piecentral-artifacts.pem -d
- nvm install --lts
- pip3 install pipenv
- mkdir -p artifacts
- if [[ $TEST_DIR = dawn ]] && git tag -l --points-at HEAD | grep dawn; then
export DEPLOY_ARTIFACTS=1; fi
- if [[ $TEST_DIR = runtime ]] && git tag -l --points-at HEAD | grep runtime; then
export DEPLOY_ARTIFACTS=1; fi
- if [[ $TEST_DIR = shepherd ]] && git tag -l --points-at HEAD | grep shepherd; then
export DEPLOY_ARTIFACTS=1; fi
- pushd $TEST_DIR
- mkdir -p build-deps
- export PATH="$PATH:$PWD/build-deps/bin"
Expand All @@ -46,12 +52,11 @@ branches:
- /^runtime\/.*$/
- /^test\/.*$/
deploy:
provider: releases
api_key:
secure: Y9p9wvz8ZLX4tM7lygUG1DaqCVOKC8qtpyNL0Nf6kgE6TLpB1fzCnndTg6sz9C6brw2pBriwXe9aHEG3QdV/u3ku4AdQqwT9PqemWJmxJT9ex+Eyk47Sp8do+tkLF44+8IkIlxSlcKfnD99fpAgrZSh3iAotJspyhckDu5R1+UNi1TBIPfBoUOtdKKFGbWNqX9lYyWompBa0Q08ZbIKW10H7HJCWQ9MhwL1Q2RxFRtLANWXLwOUW59gzfLQq07Z8b+PRmMmUiE1jr30OjnDDn+tiJk9kLG/Y5UcxzIpHaq+Wo7a5ncwHcyGaqXCs8q25wDQEsXdq6z6+kFqsi9tQkmMsrM6W9qGO8AVfxGgII6yExf6pweg02dNHMwDNI5JcpEVonP73YwuB7UH2UwUxbxzwsmnGMFYx41EpM0nYua6xHC3SZEqTurBgQMMnELJPMX2lbmFGdZPOJ5lEjnS5UEYazn1VSY00qUrQlU+nnQgbU9GJfSrHhWSJ5ycONGCBbE+dm2/vs9qnKQGXNmKeKhRSw+duNzarx648nNz6kklA9r2st0kVMfLZTMj6nKhksts88Khy1oWhFtdXOqi3daWwGz7H0jG6cvMvxSPBFA2svYy45etaXrXtJtI3kYQPl3ESdeOEWYhjPlsJXb+MVL3DUtDgMFaLRww4z/s0q/E=
file: artifacts/*
file_glob: true
skip_cleanup: true
provider: script
script:
- pushd DevOps/pipeline
- pipenv run python3 pipeline.py -k piecentral-artifacts.pem -a "$APP_ID" -t "$TRAVIS_TAG" -d artifacts
- popd
on:
tags: true
condition: $DEPLOY_ARTIFACTS = 1
Expand Down
9 changes: 7 additions & 2 deletions DevOps/Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ url = "https://pypi.python.org/simple"
verify_ssl = true

[requires]
python_version = "3.6"
python_version = "3.7"

[dev-packages]
[packages]
selenium = "*"
pyjwt = "*"
cryptography = "*"
click = "*"
pytest = "*"
PyGithub = "*"
224 changes: 224 additions & 0 deletions DevOps/Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 22 additions & 5 deletions DevOps/frankfurter/scripts/tools/env
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,35 @@ ssh_options="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null"
ifs=% # Disable whitespace truncation
indent=' '

error="\e[1;31m" # Bold red
warning="\e[1;33m" # Bold yellow
success="\e[1;32m" # Bold green
black="\e[1;30m"
red="\e[1;31m"
green="\e[1;32m"
yellow="\e[1;33m"
blue="\e[1;34m"
purple="\e[1;35m"
cyan="\e[1;36m"
white="\e[1;37m"
clear="\e[0m"

error="$red"
warning="$yellow"
success="$green"
info="$blue"

export PATH="$PATH:$frankfurter/scripts/install"
export PATH="$PATH:$frankfurter/scripts/tools"
export PATH="$PATH:$frankfurter/scripts/update"

function prompt {
read -p "$1 (y/N) " -n 1 -e choice
if [ "$choice" == 'y' ]; then
echo "$choice"
fi
}

function make_requirements {
cd "$runtime" && pipenv lock --python 3.6 --requirements > "$tmp_dir/runtime-requirements.txt" 2>/dev/null
cd "$hibike" && pipenv lock --python 3.6 --requirements > "$tmp_dir/hibike-requirements.txt" 2>/dev/null
cd "$runtime" && pipenv lock --python 3.7 --requirements > "$tmp_dir/runtime-requirements.txt" 2>/dev/null
cd "$hibike" && pipenv lock --python 3.7 --requirements > "$tmp_dir/hibike-requirements.txt" 2>/dev/null
cat "$tmp_dir/"*"-requirements.txt" | sort -u > "$tmp_dir/requirements.txt"
rm "$tmp_dir/"*"-requirements.txt"
}
2 changes: 2 additions & 0 deletions DevOps/pipeline/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Pipeline
Build automation.
Binary file not shown.
Loading

0 comments on commit 52162a1

Please sign in to comment.