-
Notifications
You must be signed in to change notification settings - Fork 153
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- This PR adds automatic deployment of leapp discover --json output to the https://github.com/oamg/githubio-data repository after successful test runs and only when merged to master Please note on pull requests the deployment section won't actually run as it has a condition for push to master only. - Additionally fixes some config warning from travis. Signed-off-by: Vinzenz Feenstra <[email protected]>
- Loading branch information
Showing
5 changed files
with
67 additions
and
9 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,20 +1,28 @@ | ||
git: | ||
depth: 3 | ||
language: | ||
minimal | ||
language: shell | ||
os: linux | ||
dist: xenial | ||
env: | ||
global: | ||
- CONTAINER=centos:7 | ||
jobs: | ||
- PYTHON_VENV=python2.7 | ||
- PYTHON_VENV=python3.6 | ||
services: | ||
- docker | ||
sudo: required | ||
|
||
install: | ||
- docker pull ${CONTAINER} | ||
- docker build -t leapp-tests -f utils/docker-tests/Dockerfile utils/docker-tests | ||
|
||
script: | ||
- docker run --rm -ti -v ${PWD}:/payload --env=PYTHON_VENV leapp-tests | ||
jobs: | ||
include: | ||
- script: | ||
- docker run --rm -ti -v ${PWD}:/payload --env=PYTHON_VENV leapp-tests | ||
env: PYTHON_VENV=python2.7 | ||
- script: | ||
- docker run --rm -ti -v ${PWD}:/payload --env=PYTHON_VENV leapp-tests | ||
env: PYTHON_VENV=python3.6 | ||
- stage: deploy | ||
script: | ||
- docker run --rm -ti -v ${PWD}:/payload --entrypoint "/bin/bash" leapp-tests -c "make install-deps && make dashboard_data" | ||
- bash ./utils/update_dashboard.sh | ||
if: branch = master AND type = push |
Binary file not shown.
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,15 @@ | ||
from __future__ import print_function | ||
import json | ||
|
||
from leapp.utils.repository import find_repository_basedir | ||
from leapp.repository.scan import find_and_scan_repositories | ||
|
||
base_dir = find_repository_basedir('.') | ||
repository = find_and_scan_repositories(base_dir, include_locals=True) | ||
|
||
repository.load() | ||
|
||
if not hasattr(repository, 'repos'): | ||
repository.repos = [repository] | ||
|
||
print(json.dumps([repo.serialize() for repo in repository.repos])) |
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,29 @@ | ||
#!/bin/bash | ||
|
||
# Decrypt private SSH key | ||
ENCRYPTED_FILE=.travis/githubio-data-idrsa | ||
DECRYPTED_FILE=${ENCRYPTED_FILE}-dec | ||
openssl aes-256-cbc -K $aes_encryption_key -iv $aes_encryption_iv -in $ENCRYPTED_FILE -out $DECRYPTED_FILE -d | ||
|
||
# Setup SSH agent with decrypted private SSH key | ||
eval "$(ssh-agent -s)" | ||
chmod 0600 $DECRYPTED_FILE | ||
ssh-add $DECRYPTED_FILE | ||
|
||
# Clone githubio-data repository | ||
git clone --depth 1 --branch master [email protected]:oamg/githubio-data | ||
|
||
cd githubio-data | ||
# Setting username and email for committer | ||
git config user.name "Leapp Build Automation" | ||
git config user.email "[email protected]" | ||
|
||
# Update data | ||
mv -f ../discover.json files/discover.json | ||
|
||
# Stage and commit | ||
git add files/discover.json | ||
git commit -s -m "Leapp dashboard discover for ${TRAVIS_COMMIT}" --allow-empty | ||
|
||
# Push changes | ||
git push origin master |