Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Commit

Permalink
Merge pull request #22 from fabricio-aguiar/5492
Browse files Browse the repository at this point in the history
adding bindings
  • Loading branch information
dkliban committed Sep 25, 2019
2 parents 6c64e0e + c274fe7 commit 71980fc
Show file tree
Hide file tree
Showing 36 changed files with 912 additions and 26 deletions.
87 changes: 87 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# WARNING: DO NOT EDIT!
#
# This file was generated by plugin_template, and is managed by bootstrap.py. Please use
# bootstrap.py to update this file.
#
# For more info visit https://github.com/pulp/plugin_template
---
sudo: required
# https://docs.travis-ci.com/user/trusty-ci-environment/
dist: xenial
language: python
python:
# Fedora has 3.6 available (python36.x86_64), but pulp container images
# with it are not being built or published yet.
# - "3.6"
- "3.7"
env:
matrix:
- DB=postgres TEST=pulp
- DB=postgres TEST=bindings
matrix:
exclude:
- python: '3.6'
env: DB=postgres TEST=bindings
fast_finish: true
services:
- postgresql
- redis-server
- docker
addons:
apt:
packages:
- httpie
- jq
# postgres versions provided by el7 RHSCL (lowest supportable version)
postgresql: '9.6'
before_install: .travis/before_install.sh
install: .travis/install.sh
before_script: .travis/before_script.sh
script: .travis/script.sh
after_failure:
- http --timeout 30 --check-status --pretty format --print hb http://localhost:24817/pulp/api/v3/status/
- sudo docker images
- sudo kubectl logs -l name=pulp-operator -c ansible --tail=10000
- sudo kubectl logs -l name=pulp-operator -c operator --tail=10000
- sudo kubectl logs -l app=pulp-api --tail=50000
- sudo kubectl logs -l app=pulp-content --tail=10000
- sudo kubectl logs -l app=pulp-resource-manager --tail=10000
- sudo kubectl logs -l app=pulp-worker --tail=10000
jobs:
include:
- stage: deploy-plugin-to-pypi
install: skip
script: bash .travis/publish_plugin_pypi.sh
if: tag IS present
- stage: publish-daily-client-gem
script: bash .travis/publish_client_gem.sh
env:
- DB=postgres
- TEST=bindings
if: type = cron
- stage: publish-daily-client-pypi
script: bash .travis/publish_client_pypi.sh
env:
- DB=postgres
- TEST=bindings
if: type = cron
- stage: publish-client-gem
script: bash .travis/publish_client_gem.sh
env:
- DB=postgres
- TEST=bindings
if: tag IS present
- stage: publish-client-pypi
script: bash .travis/publish_client_pypi.sh
env:
- DB=postgres
- TEST=bindings
if: tag IS present
notifications:
irc:
channels:
- chat.freenode.net#pulp-build
on_failure: always
on_success: change

...
103 changes: 103 additions & 0 deletions .travis/before_install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
#!/usr/bin/env bash

# WARNING: DO NOT EDIT!
#
# This file was generated by plugin_template, and is managed by bootstrap.py. Please use
# bootstrap.py to update this file.
#
# For more info visit https://github.com/pulp/plugin_template

set -mveuo pipefail

export PRE_BEFORE_INSTALL=$TRAVIS_BUILD_DIR/.travis/pre_before_install.sh
export POST_BEFORE_INSTALL=$TRAVIS_BUILD_DIR/.travis/post_before_install.sh

COMMIT_MSG=$(git log --format=%B --no-merges -1)
export COMMIT_MSG

if [ -f $PRE_BEFORE_INSTALL ]; then
$PRE_BEFORE_INSTALL
fi

if [[ -n $(echo -e $COMMIT_MSG | grep -P "Required PR:.*" | grep -v "https") ]]; then
echo "Invalid Required PR link detected in commit message. Please use the full https url."
exit 1
fi

export PULP_PR_NUMBER=$(echo $COMMIT_MSG | grep -oP 'Required\ PR:\ https\:\/\/github\.com\/pulp\/pulpcore\/pull\/(\d+)' | awk -F'/' '{print $7}')
export PULP_PLUGIN_PR_NUMBER=$(echo $COMMIT_MSG | grep -oP 'Required\ PR:\ https\:\/\/github\.com\/pulp\/pulpcore-plugin\/pull\/(\d+)' | awk -F'/' '{print $7}')
export PULP_SMASH_PR_NUMBER=$(echo $COMMIT_MSG | grep -oP 'Required\ PR:\ https\:\/\/github\.com\/PulpQE\/pulp-smash\/pull\/(\d+)' | awk -F'/' '{print $7}')
export PULP_ROLES_PR_NUMBER=$(echo $COMMIT_MSG | grep -oP 'Required\ PR:\ https\:\/\/github\.com\/pulp\/ansible-pulp\/pull\/(\d+)' | awk -F'/' '{print $7}')
export PULP_BINDINGS_PR_NUMBER=$(echo $COMMIT_MSG | grep -oP 'Required\ PR:\ https\:\/\/github\.com\/pulp\/pulp-openapi-generator\/pull\/(\d+)' | awk -F'/' '{print $7}')
export PULP_OPERATOR_PR_NUMBER=$(echo $COMMIT_MSG | grep -oP 'Required\ PR:\ https\:\/\/github\.com\/pulp\/pulp-operator\/pull\/(\d+)' | awk -F'/' '{print $7}')

# test_requirements contains tools needed for flake8, etc.
# So install them here rather than in install.sh
pip install -r test_requirements.txt

# check the commit message
./.travis/check_commit.sh



# Lint code.
flake8 --config flake8.cfg

cd ..
git clone --depth=1 https://github.com/pulp/ansible-pulp.git
if [ -n "$PULP_ROLES_PR_NUMBER" ]; then
cd ansible-pulp
git fetch --depth=1 origin +refs/pull/$PULP_ROLES_PR_NUMBER/merge
git checkout FETCH_HEAD
cd ..
fi


git clone --depth=1 https://github.com/pulp/pulp-operator.git
if [ -n "$PULP_OPERATOR_PR_NUMBER" ]; then
cd pulp-operator
git fetch --depth=1 origin +refs/pull/$PULP_OPERATOR_PR_NUMBER/merge
git checkout FETCH_HEAD
cd ..
fi


git clone --depth=1 https://github.com/pulp/pulpcore.git

if [ -n "$PULP_PR_NUMBER" ]; then
cd pulpcore
git fetch --depth=1 origin +refs/pull/$PULP_PR_NUMBER/merge
git checkout FETCH_HEAD
cd ..
fi


git clone --depth=1 https://github.com/pulp/pulpcore-plugin.git

if [ -n "$PULP_PLUGIN_PR_NUMBER" ]; then
cd pulpcore-plugin
git fetch --depth=1 origin +refs/pull/$PULP_PLUGIN_PR_NUMBER/merge
git checkout FETCH_HEAD
cd ..
fi


git clone --depth=1 https://github.com/PulpQE/pulp-smash.git

if [ -n "$PULP_SMASH_PR_NUMBER" ]; then
cd pulp-smash
git fetch --depth=1 origin +refs/pull/$PULP_SMASH_PR_NUMBER/merge
git checkout FETCH_HEAD
cd ..
fi

# pulp-smash already got installed via test_requirements.txt
pip install --upgrade --force-reinstall ./pulp-smash

pip install ansible

cd pulp-2to3-migration

if [ -f $POST_BEFORE_INSTALL ]; then
$POST_BEFORE_INSTALL
fi
45 changes: 45 additions & 0 deletions .travis/before_script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/usr/bin/env bash

# WARNING: DO NOT EDIT!
#
# This file was generated by plugin_template, and is managed by bootstrap.py. Please use
# bootstrap.py to update this file.
#
# For more info visit https://github.com/pulp/plugin_template

set -euv

export PRE_BEFORE_SCRIPT=$TRAVIS_BUILD_DIR/.travis/pre_before_script.sh
export POST_BEFORE_SCRIPT=$TRAVIS_BUILD_DIR/.travis/post_before_script.sh

# Aliases for running commands in the pulp-api container.
export PULP_API_POD=$(sudo kubectl get pods | grep -E -o "pulp-api-(\w+)-(\w+)")
# Run a command
export CMD_PREFIX="sudo kubectl exec $PULP_API_POD --"
# Run a command, and pass STDIN
export CMD_STDIN_PREFIX="sudo kubectl exec -i $PULP_API_POD --"

if [ -f $PRE_BEFORE_SCRIPT ]; then
$PRE_BEFORE_SCRIPT
fi

mkdir -p ~/.config/pulp_smash

if [ -f .travis/pulp-smash-config.json ]; then
sed "s/localhost/$(hostname)/g" .travis/pulp-smash-config.json > ~/.config/pulp_smash/settings.json
else
sed "s/localhost/$(hostname)/g" ../pulpcore/.travis/pulp-smash-config.json > ~/.config/pulp_smash/settings.json
fi

if [ "$TEST" = 'pulp' ]; then
# Many tests require pytest/mock, but users do not need them at runtime
# (or to add plugins on top of pulpcore or pulp container images.)
# So install it here, rather than in the image Dockerfile.
$CMD_PREFIX pip3 install pytest mock
# Many functional tests require these
$CMD_PREFIX dnf install -yq lsof which dnf-plugins-core
fi

if [ -f $POST_BEFORE_SCRIPT ]; then
$POST_BEFORE_SCRIPT
fi
38 changes: 38 additions & 0 deletions .travis/check_commit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash

# WARNING: DO NOT EDIT!
#
# This file was generated by plugin_template, and is managed by bootstrap.py. Please use
# bootstrap.py to update this file.
#
# For more info visit https://github.com/pulp/plugin_template

set -euv

# skip this check for everything but PRs
if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then
exit 0
fi

if [ "$TRAVIS_COMMIT_RANGE" != "" ]; then
RANGE=$TRAVIS_COMMIT_RANGE
elif [ "$TRAVIS_COMMIT" != "" ]; then
RANGE=$TRAVIS_COMMIT
fi

# Travis sends the ranges with 3 dots. Git only wants two.
if [[ "$RANGE" == *...* ]]; then
RANGE=`echo $TRAVIS_COMMIT_RANGE | sed 's/\.\.\./../'`
else
RANGE="$RANGE~..$RANGE"
fi

for sha in `git log --format=oneline --no-merges "$RANGE" | cut '-d ' -f1`
do
python .travis/validate_commit_message.py $sha
VALUE=$?

if [ "$VALUE" -gt 0 ]; then
exit $VALUE
fi
done
Loading

0 comments on commit 71980fc

Please sign in to comment.