aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2018-06-18 16:47:56 +0200
committerLukas Larsson <[email protected]>2018-06-18 16:47:56 +0200
commitb4cb07a6f618b37109d6bdc21240fbac66f8e078 (patch)
treed353d0d5dde6c90a742ca369ee1a87685db40982
parent9d5af99762b3795c763fb62c1516247bd3f8e12f (diff)
parent36001798500e6ddecd597a5694a7ee25ab4e6a64 (diff)
downloadotp-b4cb07a6f618b37109d6bdc21240fbac66f8e078.tar.gz
otp-b4cb07a6f618b37109d6bdc21240fbac66f8e078.tar.bz2
otp-b4cb07a6f618b37109d6bdc21240fbac66f8e078.zip
Merge branch 'lukas/travis/deploy'
* lukas/travis/deploy: Add deploy stage to travis-ci
-rw-r--r--.travis.yml59
-rwxr-xr-xscripts/build-otp46
-rwxr-xr-xscripts/bundle-otp29
-rwxr-xr-xscripts/run-dialyzer5
4 files changed, 121 insertions, 18 deletions
diff --git a/.travis.yml b/.travis.yml
index 1438ea865a..174f259a7d 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -23,25 +23,66 @@ addons:
matrix:
include:
+ # Dialyzer is first as it takes the longest to run
+ - env: Linux64Dialyzer
+ addons:
+ apt:
+ packages:
+ # Don't build with wx, java or xslt to get faster build
+ - autoconf
+ - libncurses-dev
+ - build-essential
+ - libssl-dev
+ script:
+ - ./scripts/build-otp
+ - ./scripts/run-dialyzer
- env: Linux32
- os: linux
services:
- docker
script:
- ./scripts/build-docker-otp 32 sh -c "scripts/build-otp release && ./otp_build tests && scripts/run-smoke-tests && bin/dialyzer --build_plt --apps erts kernel stdlib"
- - env: Linux64Dialyzer
- os: linux
- script:
- - ./scripts/build-otp
- - ./scripts/run-dialyzer
- env: Linux64SmokeTest
- os: linux
script:
- ./scripts/build-otp
- ./otp_build tests
- - make release_docs
- - make xmllint
- ./scripts/run-smoke-tests
+ - env: Linux64Docbuild
+ script:
+ - ./scripts/build-otp docs
+ ### Disabled for now, we do not want this to push to otp repo
+ # deploy:
+ # provider: pages
+ # skip-cleanup: true
+ # keep-history: true
+ # verbose: true
+ # github-token:
+ # secure: oea4VBDok/gSPwo82XRkM3C5mpyVrcgJfOHgzO01rN4UbWN615wpnTLmkwe9gtkiSwRNNT6GoZ8Rx0EM5ByS2H3qY65bj3M+clMgFAPBn7aHDmnWpi8pi8OBIMmIGxHYQn0hzY4ZCVZQ1FtzTrLZDqZrAZBAGdgDdlH9IrsnBDUKNKzU28UMEgXJKX7bwdHo5H7JGkKeGh6bMi7/s5f/MwTQgp5Iv+PUhCZ1II+Wxz+fh+B6O8kgpq6oaBLjKeaim8bpeQ/vER6Vbaf6ORH0JiJcivDeBAfOVXyx75Omam3fqEuAGW1tmvXWljijWI21WhWmjZc+s8z5ML9wEBKlw0w9BGlzVs7Z+nVtAxufx0YqTsMhlzruxzhaNxh+7jEAMsU9LzBR3AHugqV5xbp3cyYEhWQl+MkhtrKsjs2MyZeyL2T9aeXJBDC6Jb2mznjvHKm11r5oz986uGr88qbDrwT+arRVYDFBvG52nqXa+4Hn+qPoZqDl4JC0YQeVhkbYtpPS1CYkl7JAXev2L4wDSc9Cywr02tJCTrR/yWKEANyYtVl2PzNkKAAvtROpEJv6y3PxhBJzr+Qk/MDLZWGV0KN4gNIYSxFkTFUddbgF53ZnVKAh4tv/vr7Uxvup9Zy7pqF9h+p4jZ0Yq0Y1AESCorU+qfXAxnGiKO8dewuBQhI=
+ # on:
+ # # We only deploy on pushes to branches
+ # tags: false
+ # condition: $TRAVIS_PULL_REQUEST = "false"
+ # repo: erlang/otp
+ # This stage publishes a otp bundle that contains multiple
+ # Erlang/OTP source repositories
+ - stage: deploy
+ env: Deploy
+ if: tag =~ ^OTP-[0-9]+\.[0-9]+$
+ script:
+ - ./scripts/bundle-otp
+ deploy:
+ provider: releases
+ skip_cleanup: true
+ api_key:
+ secure: oea4VBDok/gSPwo82XRkM3C5mpyVrcgJfOHgzO01rN4UbWN615wpnTLmkwe9gtkiSwRNNT6GoZ8Rx0EM5ByS2H3qY65bj3M+clMgFAPBn7aHDmnWpi8pi8OBIMmIGxHYQn0hzY4ZCVZQ1FtzTrLZDqZrAZBAGdgDdlH9IrsnBDUKNKzU28UMEgXJKX7bwdHo5H7JGkKeGh6bMi7/s5f/MwTQgp5Iv+PUhCZ1II+Wxz+fh+B6O8kgpq6oaBLjKeaim8bpeQ/vER6Vbaf6ORH0JiJcivDeBAfOVXyx75Omam3fqEuAGW1tmvXWljijWI21WhWmjZc+s8z5ML9wEBKlw0w9BGlzVs7Z+nVtAxufx0YqTsMhlzruxzhaNxh+7jEAMsU9LzBR3AHugqV5xbp3cyYEhWQl+MkhtrKsjs2MyZeyL2T9aeXJBDC6Jb2mznjvHKm11r5oz986uGr88qbDrwT+arRVYDFBvG52nqXa+4Hn+qPoZqDl4JC0YQeVhkbYtpPS1CYkl7JAXev2L4wDSc9Cywr02tJCTrR/yWKEANyYtVl2PzNkKAAvtROpEJv6y3PxhBJzr+Qk/MDLZWGV0KN4gNIYSxFkTFUddbgF53ZnVKAh4tv/vr7Uxvup9Zy7pqF9h+p4jZ0Yq0Y1AESCorU+qfXAxnGiKO8dewuBQhI=
+ file:
+ - ${TRAVIS_TAG}-bundle.txt
+ - ${TRAVIS_TAG}-bundle.tar.gz
+ on:
+ # We only deploy on pushes to tags that match the regexp
+ tags: true
+ condition: $TRAVIS_TAG =~ ^OTP-[0-9]+\.[0-9]+$
+ repo: erlang/otp
+
before_script:
- set -e
diff --git a/scripts/build-otp b/scripts/build-otp
index ad0eb07359..abdffe8759 100755
--- a/scripts/build-otp
+++ b/scripts/build-otp
@@ -1,5 +1,7 @@
#!/bin/bash
+set -e
+
function progress {
local file=$1
ls=$(ls -l $file)
@@ -14,15 +16,19 @@ function progress {
}
function do_and_log {
+ start_time=`date +%s`
log="logs/latest-log.$$"
echo "" >$log
echo -n "$1..."
(progress $log) &
pid=$!
disown
- if ./otp_build $2 $3 >$log 2>&1; then
+ shift
+ if $* >$log 2>&1; then
kill $pid >/dev/null 2>&1
- echo " done."
+ stop_time=`date +%s`
+ diff_time=$((stop_time-start_time))
+ echo " done, took $diff_time seconds"
else
kill $pid >/dev/null 2>&1
echo " failed."
@@ -36,12 +42,38 @@ if [ ! -d "logs" ]; then
mkdir logs
fi
-do_and_log "Autoconfing" autoconf
-do_and_log "Configuring" configure
-do_and_log "Building OTP" boot -a
+do_and_log "Autoconfing" ./otp_build autoconf
+do_and_log "Configuring" ./otp_build configure
+do_and_log "Building OTP" ./otp_build boot -a
+
+if [ "$1" = "release" ]; then
+ do_and_log "Releasing OTP" ./otp_build release -a
+fi
-if [ $1 = "release" ]; then
- do_and_log "Releasing OTP" release -a
+if [ "$1" = "docs" ]; then
+ DOC_TARGET=${TRAVIS_BRANCH:-release/`erts/autoconf/config.guess`}
+ DOC_TARGET=${TRAVIS_TAG:-$DOC_TARGET}
+ TESTROOT=$PWD/$DOC_TARGET do_and_log "Building documentation" make release_docs
+ do_and_log "Linting documentation" make xmllint
+ # The code below prepares this build to be used as a deploy to
+ # github pages for documentation.
+ if [ "$TRAVIS_PULL_REQUEST" = "false" -a "$TRAVIS_TAG" = "" ]; then
+ set -x
+ rm -rf logs
+ SHA=`git rev-parse --verify HEAD`
+ DATE=`date -Iseconds`
+ git clean -xfdq -e $DOC_TARGET
+ git fetch https://github.com/$TRAVIS_REPO_SLUG gh-pages
+ git checkout -f FETCH_HEAD
+ rm -rf _docs/$DOC_TARGET
+ mv $DOC_TARGET _docs/$DOC_TARGET
+ echo "---" > _docs/$DOC_TARGET.md
+ echo "title: $DOC_TARGET" >> _docs/$DOC_TARGET.md
+ echo "sha: $SHA" >> _docs/$DOC_TARGET.md
+ echo "generated: $DATE" >> _docs/$DOC_TARGET.md
+ echo "---" >> _docs/$DOC_TARGET.md
+ set +x
+ fi
fi
exit 0
diff --git a/scripts/bundle-otp b/scripts/bundle-otp
new file mode 100755
index 0000000000..f3ff632b63
--- /dev/null
+++ b/scripts/bundle-otp
@@ -0,0 +1,29 @@
+#!/bin/bash
+
+set -e
+
+OTP_META_FILE=$ERL_TOP/${TRAVIS_TAG}-bundle.txt
+OTP_FILE=$ERL_TOP/${TRAVIS_TAG}-bundle.tar.gz
+
+REPOSITORIES="otp,$TRAVIS_TAG corba,.*"
+
+mkdir bundle
+
+for repo in $REPOSITORIES; do
+ OLD_IFS=$IFS
+ IFS=','
+ set -- $repo
+ IFS=$OLD_IFS
+ cd $ERL_TOP/bundle/
+ git clone https://github.com/erlang/$1 $1
+ cd $1
+ echo $1 $2
+ TAG=`git tag -l | grep -P "$2" | sort -V | tail -1`
+ git checkout $TAG
+ SHA=`git rev-parse --verify HEAD`
+ rm -rf .git
+ echo "$1 $TAG $SHA" >> $OTP_META_FILE
+done
+
+cd $ERL_TOP/bundle/
+tar czf $OTP_FILE *
diff --git a/scripts/run-dialyzer b/scripts/run-dialyzer
index c9da647952..621de3fa65 100755
--- a/scripts/run-dialyzer
+++ b/scripts/run-dialyzer
@@ -1,16 +1,17 @@
#!/bin/bash
set -e
+set -x
$ERL_TOP/bin/dialyzer --build_plt --apps asn1 compiler crypto dialyzer edoc erts et ftp hipe inets kernel mnesia observer public_key runtime_tools snmp ssh ssl stdlib syntax_tools tftp wx xmerl --statistics
$ERL_TOP/bin/dialyzer -n -Wunknown -Wunmatched_returns --apps compiler erts ftp tftp kernel stdlib asn1 crypto dialyzer hipe parsetools public_key runtime_tools sasl tools --statistics
$ERL_TOP/bin/dialyzer -n --apps common_test debugger edoc ftp inets mnesia observer ssh ssl syntax_tools tftp wx xmerl --statistics
# In travis we don't dialyze everything as it takes too much time
-if [ "X$DIALYZE_ALL_APPLICATIONS" = "Xtrue" ]; then
+if [ "X$TRAVIS" != "Xtrue" ]; then
$ERL_TOP/bin/dialyzer -n -Wunknown -Wunmatched_returns --apps eldap erl_docgen et odbc --statistics
$ERL_TOP/bin/dialyzer -n --apps eunit reltool os_mon --statistics
# These application are not run always as the currently have dialyzer warnings
- # $ERL_TOP/bin/dialyzer -n --apps cosEvent cosEventDomain cosFileTransfer cosNotification cosProperty cosTime cosTransactions diameter megaco orber snmp --statistics
+ # $ERL_TOP/bin/dialyzer -n --apps diameter megaco snmp --statistics
fi