Permalink
Browse files

ci

  • Loading branch information...
killix committed Apr 13, 2017
1 parent 90c7172 commit 29cc6b826df64dcc398f4cac9685f1e5d4cee692
View
@@ -10,7 +10,7 @@
"critics": {
"lint": {
"engine": "tslint",
- "configLocation": ".ci/ci_tslint.json"
+ "configLocation": "_tools/ci_tslint.json"
},
"wc": {
"limit": 3000
@@ -1,24 +0,0 @@
-
-#!/bin/bash
-
-GIT_DIFF="origin/master $TRAVIS_BRANCH"
-
-if ([ "$TRAVIS_BRANCH" == "master" ]); then
- echo "Setting git diff to commit range ${TRAVIS_COMMIT_RANGE} comparision for push to master"
- GIT_DIFF="$TRAVIS_COMMIT_RANGE"
-else
- echo "Setting git diff to comparision with master branch for branch ${TRAVIS_BRANCH}"
- git remote set-branches --add origin master
- git fetch
-fi
-
-# shellcheck disable=SC2086
-modified_services=(
- $(
- git diff $GIT_DIFF --name-only | # Get commits diff to check changed services
- grep -E -i -w '(broid-\/)\w+' | # Get only broid integrations paths
- awk -F'/' '!($2 in seen){seen[$2]++; print $2}' # Extract service names
- )
-)
-
-echo "${modified_services[@]}"
View
@@ -1,10 +0,0 @@
-#!/bin/bash
-
-set -e
-
-source "$(dirname "$0")/get-modified.sh"
-modified_services=( ${modified_services[@]} )
-
-echo $modified_services
-
-exit 1
View
@@ -1,10 +0,0 @@
-#!/bin/bash
-
-set -e
-
-source "$(dirname "$0")/get-modified.sh"
-modified_services=( ${modified_services[@]} )
-
-echo $modified_services
-
-exit 1
View
@@ -4,7 +4,7 @@ engines:
tslint:
enabled: true
channel: beta
- config: .ci/ci_tslint.json
+ config: _tools/ci_tslint.json
ratings:
paths:
- "**/src/**.d.ts"
View
@@ -0,0 +1,6 @@
+node_modules/
+**/node_modules/
+*.log
+LICENSE
+*.md
+spec
View
@@ -1,49 +1,32 @@
-language: node_js
-dist: trusty
+os:
+ - linux
sudo: true
-env:
- - CXX=g++-4.8
+language: cpp
addons:
apt:
sources:
- - ubuntu-toolchain-r-test
+ - ubuntu-toolchain-r-test
packages:
- - g++-4.8
-cache:
- directories:
- - integrations/broid-alexa/node_modules
- - integrations/broid-callr/node_modules
- - integrations/broid-discord/node_modules
- - integrations/broid-flowdock/node_modules
- - integrations/broid-kik/node_modules
- - integrations/broid-line/node_modules
- - integrations/broid-messenger/node_modules
- - integrations/broid-ms-teams/node_modules
- - integrations/broid-schemas/node_modules
- - integrations/broid-skype/node_modules
- - integrations/broid-slack/node_modules
- - integrations/broid-telegram/node_modules
- - integrations/broid-twilio/node_modules
- - integrations/broid-twitter/node_modules
- - integrations/broid-utils/node_modules
- - integrations/broid-viber/node_modules
- - integrations/broid-irc/node_modules
- - integrations/broid-wechat/node_modules
- - integrations/broid-ms-team/node_modules
-node_js:
- - "6"
-before_install:
+ - g++-4.8
+ - build-essential
+notifications:
+ email: false
+env:
+ matrix:
+ - TRAVIS_NODE_VERSION="6"
+install:
+ - "rm -rf ~/.nvm && mkdir -p ~/.nvm && curl -sL `curl -sI https://github.com/creationix/nvm/releases/latest|sed -En 's/^Location: (.+)\\/releases\\/tag\\/(.+)/\\1\\/tarball\\/\\2/p'|tr -d '\r\n'`|tar zx --strip=1 -C ~/.nvm && source ~/.nvm/nvm.sh && nvm install $TRAVIS_NODE_VERSION"
+ - npm --version
+ - if [[ $TRAVIS_OS_NAME == "linux" ]]; then export CXX=g++-4.8; export CC=gcc-4.8; fi
+ - $CXX --version
# Repo for Yarn
- curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
- echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
- sudo apt-get update -qq
- sudo apt-get install -y -qq yarn
- npm install -g nsp
- yarn --version
- - export CXX=g++-4.8
- - export BUILDTYPE="production";
before_script:
- - $CXX --version
- - chmod +x ./.ci/scripts/*
- - ./.ci/scripts/run-install.sh
-script: ./.ci/scripts/run-tests.sh
+ - chmod +x ./_tools/test
+ - ./_tools/test install
+script: ./_tools/test
@@ -0,0 +1,67 @@
+FROM node:6.9.4-alpine
+
+RUN apk --no-cache add ca-certificates curl make gcc g++ python linux-headers paxctl libgcc libstdc++ gnupg git wget && update-ca-certificates
+RUN mkdir -p /opt/yarn && cd /opt/yarn && wget https://yarnpkg.com/latest.tar.gz && tar zxf latest.tar.gz
+ENV PATH "/Users/killix/.nvm/versions/node/v6.9.1/bin:/Users/killix/.local/google-cloud-sdk/bin:/usr/local/bin:/Users/killix/.gvm/pkgsets/go1.7.1/global/bin:/Users/killix/.gvm/gos/go1.7.1/bin:/Users/killix/.gvm/pkgsets/go1.7.1/global/overlay/bin:/Users/killix/.gvm/bin:/Users/killix/.gvm/bin:/Users/killix/.cargo/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/MacGPG2/bin:/Users/killix/bin:/usr/local/Cellar/node/7.3.0/bin:/opt/yarn/dist/bin"
+
+ARG CI_BRANCH
+ENV CI_BRANCH $CI_BRANCH
+
+RUN mkdir -p /integrations
+WORKDIR /integrations/
+
+COPY ./_tools /integrations/_tools/
+RUN chmod +x _tools/scripts/run-install.sh
+RUN chmod +x _tools/scripts/run-tests.sh
+
+COPY ./broid-alexa/package.json ./broid-alexa/yarn.lock /integrations/broid-alexa/
+COPY ./broid-callr/package.json ./broid-callr/yarn.lock /integrations/broid-callr/
+COPY ./broid-discord/package.json ./broid-discord/yarn.lock /integrations/broid-discord/
+COPY ./broid-flowdock/package.json ./broid-flowdock/yarn.lock /integrations/broid-flowdock/
+COPY ./broid-gitter/package.json ./broid-gitter/yarn.lock /integrations/broid-gitter/
+COPY ./broid-google-assistant/package.json ./broid-google-assistant/yarn.lock /integrations/broid-google-assistant/
+COPY ./broid-groupme/package.json ./broid-groupme/yarn.lock /integrations/broid-groupme/
+COPY ./broid-irc/package.json ./broid-irc/yarn.lock /integrations/broid-irc/
+COPY ./broid-kik/package.json ./broid-kik/yarn.lock /integrations/broid-kik/
+COPY ./broid-line/package.json ./broid-line/yarn.lock /integrations/broid-line/
+COPY ./broid-messenger/package.json ./broid-messenger/yarn.lock /integrations/broid-messenger/
+COPY ./broid-ms-teams/package.json ./broid-ms-teams/yarn.lock /integrations/broid-ms-teams/
+COPY ./broid-nexmo/package.json ./broid-nexmo/yarn.lock /integrations/broid-nexmo/
+COPY ./broid-schemas/package.json ./broid-schemas/yarn.lock /integrations/broid-schemas/
+COPY ./broid-skype/package.json ./broid-skype/yarn.lock /integrations/broid-skype/
+COPY ./broid-slack/package.json ./broid-slack/yarn.lock /integrations/broid-slack/
+COPY ./broid-telegram/package.json ./broid-telegram/yarn.lock /integrations/broid-telegram/
+COPY ./broid-twilio/package.json ./broid-twilio/yarn.lock /integrations/broid-twilio/
+COPY ./broid-twitter/package.json ./broid-twitter/yarn.lock /integrations/broid-twitter/
+COPY ./broid-utils/package.json ./broid-utils/yarn.lock /integrations/broid-utils/
+COPY ./broid-viber/package.json ./broid-viber/yarn.lock /integrations/broid-viber/
+COPY ./broid-wechat/package.json ./broid-wechat/yarn.lock /integrations/broid-wechat/
+
+COPY ./.git /integrations/.git/
+
+RUN /bin/sh _tools/scripts/run-install.sh
+
+COPY ./broid-alexa/src/* /integrations/broid-alexa/src/
+COPY ./broid-callr/src/* /integrations/broid-callr/src/
+COPY ./broid-discord/src/* /integrations/broid-discord/src/
+COPY ./broid-flowdock/src/* /integrations/broid-flowdock/src/
+COPY ./broid-gitter/src/* /integrations/broid-gitter/src/
+COPY ./broid-google-assistant/src/* /integrations/broid-google-assistant/src/
+COPY ./broid-groupme/src/* /integrations/broid-groupme/src/
+COPY ./broid-irc/src/* /integrations/broid-irc/src/
+COPY ./broid-kik/src/* /integrations/broid-kik/src/
+COPY ./broid-line/src/* /integrations/broid-line/src/
+COPY ./broid-messenger/src/* /integrations/broid-messenger/src/
+COPY ./broid-ms-teams/src/* /integrations/broid-ms-teams/src/
+COPY ./broid-nexmo/src/* /integrations/broid-nexmo/src/
+COPY ./broid-schemas/src/* /integrations/broid-schemas/src/
+COPY ./broid-skype/src/* /integrations/broid-skype/src/
+COPY ./broid-slack/src/* /integrations/broid-slack/src/
+COPY ./broid-telegram/src/* /integrations/broid-telegram/src/
+COPY ./broid-twilio/src/* /integrations/broid-twilio/src/
+COPY ./broid-twitter/src/* /integrations/broid-twitter/src/
+COPY ./broid-utils/src/* /integrations/broid-utils/src/
+COPY ./broid-viber/src/* /integrations/broid-viber/src/
+COPY ./broid-wechat/src/* /integrations/broid-wechat/src/
+
+RUN /bin/sh _tools/scripts/run-tests.sh
File renamed without changes.
@@ -0,0 +1,43 @@
+#!/bin/bash
+
+set -e
+
+SUFFIX=${1:-test}
+today=`date '+%Y_%m_%d__%H_%M_%S'`;
+filename="./Dockerfile.$SUFFIX.$today"
+
+echo $SUFFIX
+echo $filename
+
+echo "FROM node:6.9.4-alpine"
+echo ""
+echo "RUN apk --no-cache add ca-certificates curl make gcc g++ python linux-headers paxctl libgcc libstdc++ gnupg git wget && update-ca-certificates"
+echo "RUN mkdir -p /opt/yarn && cd /opt/yarn && wget https://yarnpkg.com/latest.tar.gz && tar zxf latest.tar.gz"
+echo "ENV PATH \"$PATH:/opt/yarn/dist/bin\""
+echo ""
+echo "ARG CI_BRANCH"
+echo "ENV CI_BRANCH \$CI_BRANCH"
+echo ""
+echo "RUN mkdir -p /integrations"
+echo "WORKDIR /integrations/"
+echo ""
+echo "COPY ./_tools /integrations/_tools/"
+echo "RUN chmod +x _tools/scripts/run-install.sh"
+echo "RUN chmod +x _tools/scripts/run-tests.sh"
+echo ""
+for dir in ../../broid-* ; do
+ dircleaned=${dir//[..\/]/}
+ echo "COPY ./$dircleaned/package.json ./$dircleaned/yarn.lock /integrations/$dircleaned/"
+done
+echo ""
+echo "COPY ./.git /integrations/.git/"
+echo ""
+echo "RUN /bin/sh _tools/scripts/run-install.sh"
+echo ""
+for dir in ../../broid-* ; do
+ dircleaned=${dir//[..\/]/}
+ echo "COPY ./$dircleaned/src/* /integrations/$dircleaned/src/"
+done
+echo ""
+echo "RUN /bin/sh _tools/scripts/run-tests.sh"
+echo ""
@@ -0,0 +1,23 @@
+#!/bin/sh
+set -e
+
+rootDir() {
+ xargs -n1 | cut -d/ -f1
+}
+
+integrations() {
+ echo broid-*/package.json | rootDir | sort | sed '/^_/d'
+}
+
+revelant_directories() {
+ git diff --name-only "origin/master...$CI_BRANCH" | rootDir | sort | uniq |
+ grep -E -i -w '(broid-)\w+' # Get only broid integrations paths
+}
+
+integrations_changed() {
+ integrations > .integrations
+ revelant_directories > .revelant_directories
+ comm -12 .integrations .revelant_directories
+}
+
+echo $(integrations_changed)
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+set -e
+
+source "$(dirname "$0")/get-modified.sh"
+
+echo "CI_BRANCH: $CI_BRANCH"
+
+INTS_UPDATED=$(integrations_changed)
+echo $INTS_UPDATED
+
+for integration in $INTS_UPDATED; do
+ echo "> Install dependencies for $integration"
+ (cd "$integration" && yarn install --ignore-scripts)
+done
+
+echo "> Install dependencies finished"
+exit 0
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+set -e
+
+source "$(dirname "$0")/get-modified.sh"
+
+echo "CI_BRANCH: $CI_BRANCH"
+
+INTS_UPDATED=$(integrations_changed)
+echo $INTS_UPDATED
+
+for integration in $INTS_UPDATED; do
+ echo "> Run Tests for $integration"
+ (cd "$integration" && yarn run travis)
+done
+
+echo "> Tests finished"
+exit 0
View
@@ -35,7 +35,7 @@ fi
command_install() {
for integration in $INTS_UPDATED; do
- (cd "$integration" && yarn install --ignore-scripts)
+ (cd "$integration" && npm install --ignore-scripts)
done
}
@@ -44,7 +44,7 @@ command_test() {
echo "> Testing $integration"
(
cd "$integration"
- yarn run travis
+ npm run travis
)
done
}
File renamed without changes.
File renamed without changes.
View
@@ -30,7 +30,7 @@
"build": "yarn run clean && yarn run copy && yarn run copy:config && tsc -p tsconfig.json",
"clean": "rm -rf lib && rm -rf tsconfig.json && rm -rf tslint.json",
"copy": "copyfiles -u 1 src/**/*.json lib/",
- "copy:config": "cp ../.ci/tsconfig.json . && cp ../.ci/tslint.json .",
+ "copy:config": "cp ../_tools/tsconfig.json . && cp ../_tools/tslint.json .",
"lint": "yarn run copy:config && tslint -c tslint.json src/**/*.ts",
"lint:watch": "watch 'yarn run lint' src",
"nsp-check": "nsp check --warn-only -o summary",
View
@@ -30,7 +30,7 @@
"build": "yarn run clean && yarn run copy && yarn run copy:config && tsc -p tsconfig.json",
"clean": "rm -rf lib && rm -rf tsconfig.json && rm -rf tslint.json",
"copy": "copyfiles -u 1 src/**/*.json lib/",
- "copy:config": "cp ../.ci/tsconfig.json . && cp ../.ci/tslint.json .",
+ "copy:config": "cp ../_tools/tsconfig.json . && cp ../_tools/tslint.json .",
"lint": "yarn run copy:config && tslint -c tslint.json src/**/*.ts",
"lint:watch": "watch 'yarn run lint' src",
"nsp-check": "nsp check --warn-only -o summary",
@@ -30,7 +30,7 @@
"build": "yarn run clean && yarn run copy && yarn run copy:config && tsc -p tsconfig.json",
"clean": "rm -rf lib && rm -rf tsconfig.json && rm -rf tslint.json",
"copy": "copyfiles -u 1 src/**/*.json lib/",
- "copy:config": "cp ../.ci/tsconfig.json . && cp ../.ci/tslint.json .",
+ "copy:config": "cp ../_tools/tsconfig.json . && cp ../_tools/tslint.json .",
"lint": "yarn run copy:config && tslint -c tslint.json src/**/*.ts",
"lint:watch": "watch 'yarn run lint' src",
"nsp-check": "nsp check --warn-only -o summary",
@@ -30,7 +30,7 @@
"build": "yarn run clean && yarn run copy && yarn run copy:config && tsc -p tsconfig.json",
"clean": "rm -rf lib && rm -rf tsconfig.json && rm -rf tslint.json",
"copy": "copyfiles -u 1 src/**/*.json lib/",
- "copy:config": "cp ../.ci/tsconfig.json . && cp ../.ci/tslint.json .",
+ "copy:config": "cp ../_tools/tsconfig.json . && cp ../_tools/tslint.json .",
"lint": "yarn run copy:config && tslint -c tslint.json src/**/*.ts",
"lint:watch": "watch 'yarn run lint' src",
"nsp-check": "nsp check --warn-only -o summary",
@@ -30,7 +30,7 @@
"build": "yarn run clean && yarn run copy && yarn run copy:config && tsc -p tsconfig.json",
"clean": "rm -rf lib && rm -rf tsconfig.json && rm -rf tslint.json",
"copy": "copyfiles -u 1 src/**/*.json lib/",
- "copy:config": "cp ../.ci/tsconfig.json . && cp ../.ci/tslint.json .",
+ "copy:config": "cp ../_tools/tsconfig.json . && cp ../_tools/tslint.json .",
"lint": "yarn run copy:config && tslint -c tslint.json src/**/*.ts",
"lint:watch": "watch 'yarn run lint' src",
"nsp-check": "nsp check --warn-only -o summary",
@@ -30,7 +30,7 @@
"build": "yarn run clean && yarn run copy && yarn run copy:config && tsc -p tsconfig.json",
"clean": "rm -rf lib && rm -rf tsconfig.json && rm -rf tslint.json",
"copy": "copyfiles -u 1 src/**/*.json lib/",
- "copy:config": "cp ../.ci/tsconfig.json . && cp ../.ci/tslint.json .",
+ "copy:config": "cp ../_tools/tsconfig.json . && cp ../_tools/tslint.json .",
"lint": "yarn run copy:config && tslint -c tslint.json src/**/*.ts",
"lint:watch": "watch 'yarn run lint' src",
"nsp-check": "nsp check --warn-only -o summary",
@@ -30,7 +30,7 @@
"build": "yarn run clean && yarn run copy && yarn run copy:config && tsc -p tsconfig.json",
"clean": "rm -rf lib && rm -rf tsconfig.json && rm -rf tslint.json",
"copy": "copyfiles -u 1 src/**/*.json lib/",
- "copy:config": "cp ../.ci/tsconfig.json . && cp ../.ci/tslint.json .",
+ "copy:config": "cp ../_tools/tsconfig.json . && cp ../_tools/tslint.json .",
"lint": "yarn run copy:config && tslint -c tslint.json src/**/*.ts",
"lint:watch": "watch 'yarn run lint' src",
"nsp-check": "nsp check --warn-only -o summary",
Oops, something went wrong.

0 comments on commit 29cc6b8

Please sign in to comment.