Files
fn-serverless/.circleci/config.yml
Reed Allman 292f673747 Go1.11 (#1188)
* update circleci to go1.11

* update opencensus dep to build with go1.11

* fix up for new gofmt rules
2018-08-27 10:55:52 -07:00

71 lines
2.4 KiB
YAML

version: 2
jobs:
build:
machine:
image: circleci/classic:201708-01
working_directory: ~/go/src/github.com/fnproject/fn
environment: # apparently expansion doesn't work here yet: https://discuss.circleci.com/t/environment-variable-expansion-in-working-directory/11322
- GOPATH=/home/circleci/go
- GOVERSION=1.11
- OS=linux
- ARCH=amd64
- FN_LOG_LEVEL=debug
steps:
- checkout
# install Go
- run: |
go version
go env GOROOT
mkdir tmp
cd tmp
sudo rm -rf /usr/local/go
wget https://storage.googleapis.com/golang/go$GOVERSION.$OS-$ARCH.tar.gz
sudo tar -C /usr/local -xzf go$GOVERSION.$OS-$ARCH.tar.gz
- run: go version
# install latest Docker
- run: |
sudo rm -rf /var/cache/apt/archives && sudo ln -s ~/.apt-cache /var/cache/apt/archives && mkdir -p ~/.apt-cache/partial
sudo service docker stop
curl -fsSL https://get.docker.com/ | sudo sh
docker version
- run: docker version
- run: nproc
# fixes git-diff warning: "warning: inexact rename detection was skipped due to too many files.""
- run: git config diff.renamelimit 65535
- run: make clear-images
# Work out what needs rebuilding and what has changed
- run: |
( ./changed-since-last.sh
echo "export DIND_NEEDED DIND_TAG DIND_PREV"
echo "export FN_NEEDED FN_TAG FN_PREV"
) >> $BASH_ENV
# Rebuild the build tools if necessary
# This leaves local docker images around
- run: |
if [[ -n "$DIND_NEEDED" ]]; then
make build-dind
fi
# Rebuild fnserver if necessary
- run: |
if [[ -n "$FN_NEEDED" ]]; then
make test -j $(nproc)
fi
- deploy:
command: |
if [[ "${CIRCLE_BRANCH}" == "master" && -z "${CIRCLE_PR_REPONAME}" ]]; then
printenv DOCKER_PASS | docker login -u $DOCKER_USER --password-stdin
git config --global user.email "ci@fnproject.com"
git config --global user.name "CI"
git branch --set-upstream-to=origin/${CIRCLE_BRANCH} ${CIRCLE_BRANCH}
if [[ -n "$DIND_NEEDED" ]]; then
make release-dind
fi
if [[ -n "$FN_NEEDED" ]]; then
make release-fnserver
fi
fi