From bb9f42f7006f67d2132f5c5af2c96cd7bef81ff9 Mon Sep 17 00:00:00 2001 From: Bill Maxwell Date: Thu, 28 Jan 2016 12:33:06 -0700 Subject: [PATCH] Initial commit --- .drone.yml | 3 +++ .gitignore | 1 + README.md | 18 ++++++++++++++++++ scripts/bootstrap | 11 +++++++++++ scripts/ci | 6 ++++++ scripts/test | 18 ++++++++++++++++++ 6 files changed, 57 insertions(+) create mode 100644 .drone.yml create mode 100644 .gitignore create mode 100644 README.md create mode 100755 scripts/bootstrap create mode 100755 scripts/ci create mode 100755 scripts/test diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..3522162 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,3 @@ +image: rancher/dind:v0.6.0 +script: + - ./scripts/ci diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a01ee28 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.*.swp diff --git a/README.md b/README.md new file mode 100644 index 0000000..2ac5070 --- /dev/null +++ b/README.md @@ -0,0 +1,18 @@ +# Rancher Community Catalog + +This catalog provides templates created by the community, and they are not maintained or supported by Rancher Labs. + +# License +Copyright (c) 2014-2015 [Rancher Labs, Inc.](http://rancher.com) + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +[http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. \ No newline at end of file diff --git a/scripts/bootstrap b/scripts/bootstrap new file mode 100755 index 0000000..a2d158e --- /dev/null +++ b/scripts/bootstrap @@ -0,0 +1,11 @@ +#!/bin/bash + +apt-get update && apt-get install -y curl jq python python-pip +pip install -U pip tox + +## Get latest rancher-catalog +download_url=$(curl https://api.github.com/repos/rancher/rancher-catalog-service/releases/latest | jq -r '.assets[]| select(.name == "rancher-catalog-service.tar.xz")| .browser_download_url') +curl -sL -o /tmp/rancher-catalog-service.tar.xz ${download_url} +tar -xJf /tmp/rancher-catalog-service.tar.xz -C /usr/bin/ + + diff --git a/scripts/ci b/scripts/ci new file mode 100755 index 0000000..622948e --- /dev/null +++ b/scripts/ci @@ -0,0 +1,6 @@ +#!/bin/bash + +cd $(dirname $0)/.. + +./scripts/bootstrap +./scripts/test diff --git a/scripts/test b/scripts/test new file mode 100755 index 0000000..2ea821f --- /dev/null +++ b/scripts/test @@ -0,0 +1,18 @@ +#!/bin/bash +set -e + +cd $(dirname $0)/.. + +trap "rm -rf /scratch/*" exit + +if [ -d "/scratch" ]; then + rsync -a --exclude .tox ./ /scratch +fi + +pushd /scratch/integration + +# Start rancher-catalog-service and wait for it to start. +/usr/bin/rancher-catalog-service -catalogUrl ../ -refreshInterval 7200 > /dev/null 2>&1 & +sleep 10 +tox -e flake8,py27 +popd