mirror of
https://github.com/weaveworks/scope.git
synced 2026-03-03 18:20:27 +00:00
initial
This commit is contained in:
committed by
Bryan Boreham
parent
b090dfe788
commit
6b4a51563f
127
.circleci/config.yml
Normal file
127
.circleci/config.yml
Normal file
@@ -0,0 +1,127 @@
|
||||
version: 2
|
||||
|
||||
defaults: &defaults
|
||||
steps:
|
||||
- run:
|
||||
name: Setup Environment Variables
|
||||
command: |
|
||||
echo 'export GOPATH="/home/ubuntu"' >> $BASH_ENV
|
||||
echo 'export SRCDIR="/home/ubuntu/src/github.com/weaveworks/scope"' >> $BASH_ENV
|
||||
echo 'export PATH="$PATH:$HOME/.local/bin"' >> $BASH_ENV
|
||||
echo 'export CLOUDSDK_CORE_DISABLE_PROMPTS="1"' >> $BASH_ENV
|
||||
echo 'export SCOPE_UI_BUILD="$HOME/docker/scope_ui_build.tar"' >> $BASH_ENV
|
||||
echo 'export IMAGES="scope cloud-agent"' >> $BASH_ENV
|
||||
jobs:
|
||||
build:
|
||||
<<: *defaults
|
||||
machine: true
|
||||
steps:
|
||||
- checkout
|
||||
|
||||
- run: curl -sSL https://s3.amazonaws.com/circle-downloads/install-circleci-docker.sh | bash -s -- 1.10.0
|
||||
- run: pip install --upgrade requests
|
||||
- run: |
|
||||
sudo apt-get update &&
|
||||
sudo apt-get install jq pv &&
|
||||
sudo chmod a+wr --recursive /usr/local/go/pkg &&
|
||||
(curl https://sdk.cloud.google.com | bash) &&
|
||||
(test -z "$SECRET_PASSWORD" || bin/setup-circleci-secrets "$SECRET_PASSWORD") &&
|
||||
make deps &&
|
||||
mkdir -p $(dirname $SRCDIR) &&
|
||||
cp -r $(pwd)/ $SRCDIR
|
||||
- run: "cd $SRCDIR/client; ../tools/rebuild-image weaveworks/scope-ui-build . Dockerfile package.json webpack.production.config.js .eslintrc .babelrc && touch $SRCDIR/.scope_ui_build.uptodate"
|
||||
- run: "cd $SRCDIR/backend; ../tools/rebuild-image weaveworks/scope-backend-build . Dockerfile build.sh && touch $SRCDIR/.scope_backend_build.uptodate"
|
||||
- run: sudo apt-get update && sudo apt-get install python-pip && sudo pip install awscli
|
||||
|
||||
- run: test -z "$SECRET_PASSWORD" || (cd $SRCDIR/integration; ./gce.sh make_template)
|
||||
- run: cd $SRCDIR; make RM= lint
|
||||
- run: cd $SRCDIR; COVERDIR=./coverage make RM= CODECGEN_UID=23 tests
|
||||
- run: cd $SRCDIR; make RM= client-test static
|
||||
- run: cd $SRCDIR; make RM= client-lint static
|
||||
- run: cd $SRCDIR; rm -f prog/scope; if [ "$CIRCLE_NODE_INDEX" = "0" ]; then GOARCH=arm make GO_BUILD_INSTALL_DEPS= RM= prog/scope; else GOOS=darwin make GO_BUILD_INSTALL_DEPS= RM= prog/scope; fi
|
||||
- run: cd $SRCDIR; rm -f prog/scope; make RM=
|
||||
- run: cd $SRCDIR/extras; ./build_on_circle.sh
|
||||
- run: "test -z \"$SECRET_PASSWORD\" || (cd $SRCDIR/integration; ./gce.sh setup && eval $(./gce.sh hosts); ./setup.sh)"
|
||||
- run:
|
||||
command: test -z "$SECRET_PASSWORD" || (cd $SRCDIR/integration; eval $(./gce.sh hosts); ./run_all.sh)
|
||||
no_output_timeout: 5m
|
||||
- run: test -z "$SECRET_PASSWORD" || (cd $SRCDIR/integration; ./gce.sh destroy)
|
||||
- run: test "$CIRCLE_NODE_INDEX" != "0" || (cd $SRCDIR; ./tools/cover/gather_coverage.sh ./coverage $SRCDIR/coverage)
|
||||
- run: test "$CIRCLE_NODE_INDEX" != "0" || (goveralls -repotoken $COVERALLS_REPO_TOKEN -coverprofile=$SRCDIR/profile.cov -service=circleci || true)
|
||||
- run: test "$CIRCLE_NODE_INDEX" != "0" || (cd $SRCDIR; cp */*.codecgen.go $CIRCLE_ARTIFACTS)
|
||||
|
||||
# machine:
|
||||
# pre:
|
||||
# - curl -sSL https://s3.amazonaws.com/circle-downloads/install-circleci-docker.sh | bash -s -- 1.10.0
|
||||
# services:
|
||||
# - docker
|
||||
|
||||
deploy:
|
||||
<<: *defaults
|
||||
steps:
|
||||
- checkout
|
||||
- run: |
|
||||
test -z "${DOCKER_USER}" || (
|
||||
docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS &&
|
||||
(test "${DOCKER_ORGANIZATION:-$DOCKER_USER}" = "weaveworks" || (
|
||||
for IMAGE in $IMAGES; do
|
||||
docker tag weaveworks/$IMAGE:latest ${DOCKER_ORGANIZATION:-$DOCKER_USER}/$IMAGE:latest &&
|
||||
docker tag weaveworks/$IMAGE:$(./tools/image-tag) ${DOCKER_ORGANIZATION:-$DOCKER_USER}/$IMAGE:$(./tools/image-tag)
|
||||
done
|
||||
)) &&
|
||||
for IMAGE in $IMAGES; do
|
||||
docker push ${DOCKER_ORGANIZATION:-$DOCKER_USER}/$IMAGE &&
|
||||
docker push ${DOCKER_ORGANIZATION:-$DOCKER_USER}/$IMAGE:$(./tools/image-tag)
|
||||
done
|
||||
)
|
||||
- run: |
|
||||
test -z "${QUAY_USER}" || (
|
||||
docker login -e '.' -u "$QUAY_USER" -p "$QUAY_PASSWORD" quay.io &&
|
||||
docker tag weaveworks/scope:$(./tools/image-tag) "quay.io/${QUAY_ORGANIZATION}/scope:$(./tools/image-tag)" &&
|
||||
docker push "quay.io/${QUAY_ORGANIZATION}/scope:$(./tools/image-tag)"
|
||||
)
|
||||
- run: test -z "${UI_BUCKET_KEY_ID}" || (cd $SRCDIR && make ui-upload && make ui-pkg-upload)
|
||||
|
||||
deploy-dev:
|
||||
<<: *defaults
|
||||
steps:
|
||||
- checkout
|
||||
- run: >
|
||||
test -z "${DEPLOY_BRANCH}" || test -z "${DOCKER_USER}" || (
|
||||
docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS &&
|
||||
docker tag weaveworks/scope:latest ${DOCKER_ORGANIZATION:-$DOCKER_USER}/scope:${CIRCLE_BRANCH//\//-} &&
|
||||
docker push ${DOCKER_ORGANIZATION:-$DOCKER_USER}/scope:${CIRCLE_BRANCH//\//-}
|
||||
)
|
||||
workflows:
|
||||
version: 2
|
||||
test_and_deploy:
|
||||
jobs:
|
||||
- build:
|
||||
filters:
|
||||
branches:
|
||||
ignore: gh-pages
|
||||
- deploy:
|
||||
filters:
|
||||
branches:
|
||||
only: master
|
||||
requires:
|
||||
- build
|
||||
- deploy-dev:
|
||||
filters:
|
||||
branches:
|
||||
ignore: master
|
||||
requires:
|
||||
- build
|
||||
|
||||
# release:
|
||||
# branch: /release-[0-9]+\.[0-9]+/
|
||||
# owner: weaveworks
|
||||
# commands:
|
||||
# - go get github.com/weaveworks/wordepress && cd /home/ubuntu/src/github.com/weaveworks/wordepress && git checkout v1.0.0 && cd cmd/wordepress && go get
|
||||
# - cd $SRCDIR; PRODUCT=scope tools/publish-site "$WP_LIVE_URL" "$WP_LIVE_USER" "$WP_LIVE_PASSWORD"
|
||||
# issues:
|
||||
# branch: /.*/
|
||||
# owner: weaveworks
|
||||
# commands:
|
||||
# - go get github.com/weaveworks/wordepress && cd /home/ubuntu/src/github.com/weaveworks/wordepress && git checkout v1.0.0 && cd cmd/wordepress && go get
|
||||
# - cd $SRCDIR; PRODUCT=scope tools/publish-site "$WP_DEV_URL" "$WP_DEV_USER" "$WP_DEV_PASSWORD"
|
||||
117
circle.yml
117
circle.yml
@@ -1,117 +0,0 @@
|
||||
general:
|
||||
branches:
|
||||
ignore:
|
||||
- gh-pages
|
||||
|
||||
machine:
|
||||
pre:
|
||||
- curl -sSL https://s3.amazonaws.com/circle-downloads/install-circleci-docker.sh | bash -s -- 1.10.0
|
||||
services:
|
||||
- docker
|
||||
environment:
|
||||
GOPATH: /home/ubuntu
|
||||
SRCDIR: /home/ubuntu/src/github.com/weaveworks/scope
|
||||
PATH: $PATH:$HOME/.local/bin
|
||||
CLOUDSDK_CORE_DISABLE_PROMPTS: 1
|
||||
SCOPE_UI_BUILD: $HOME/docker/scope_ui_build.tar
|
||||
IMAGES: scope cloud-agent
|
||||
|
||||
dependencies:
|
||||
pre:
|
||||
- pip install --upgrade requests
|
||||
cache_directories:
|
||||
- "~/docker"
|
||||
override:
|
||||
- |
|
||||
sudo apt-get update &&
|
||||
sudo apt-get install jq pv &&
|
||||
sudo chmod a+wr --recursive /usr/local/go/pkg &&
|
||||
sudo chown ubuntu:ubuntu "$HOME/.bashrc.backup"
|
||||
(curl https://sdk.cloud.google.com | bash) &&
|
||||
(test -z "$SECRET_PASSWORD" || bin/setup-circleci-secrets "$SECRET_PASSWORD") &&
|
||||
make deps &&
|
||||
mkdir -p $(dirname $SRCDIR) &&
|
||||
cp -r $(pwd)/ $SRCDIR
|
||||
- "cd $SRCDIR/client; ../tools/rebuild-image weaveworks/scope-ui-build . Dockerfile package.json webpack.production.config.js .eslintrc .babelrc && touch $SRCDIR/.scope_ui_build.uptodate"
|
||||
- "cd $SRCDIR/backend; ../tools/rebuild-image weaveworks/scope-backend-build . Dockerfile build.sh && touch $SRCDIR/.scope_backend_build.uptodate"
|
||||
- test -z "$SECRET_PASSWORD" || (cd $SRCDIR/integration; ./gce.sh make_template):
|
||||
parallel: false
|
||||
- sudo apt-get update && sudo apt-get install python-pip && sudo pip install awscli
|
||||
|
||||
test:
|
||||
override:
|
||||
- cd $SRCDIR; make RM= lint:
|
||||
parallel: true
|
||||
- cd $SRCDIR; COVERDIR=./coverage make RM= CODECGEN_UID=23 tests:
|
||||
parallel: true
|
||||
- cd $SRCDIR; make RM= client-test static:
|
||||
parallel: true
|
||||
- cd $SRCDIR; make RM= client-lint static:
|
||||
parallel: true
|
||||
- cd $SRCDIR; rm -f prog/scope; if [ "$CIRCLE_NODE_INDEX" = "0" ]; then GOARCH=arm make GO_BUILD_INSTALL_DEPS= RM= prog/scope; else GOOS=darwin make GO_BUILD_INSTALL_DEPS= RM= prog/scope; fi:
|
||||
parallel: true
|
||||
- cd $SRCDIR; rm -f prog/scope; make RM=:
|
||||
parallel: true
|
||||
- cd $SRCDIR/extras; ./build_on_circle.sh:
|
||||
parallel: true
|
||||
- "test -z \"$SECRET_PASSWORD\" || (cd $SRCDIR/integration; ./gce.sh setup && eval $(./gce.sh hosts); ./setup.sh)":
|
||||
parallel: true
|
||||
- test -z "$SECRET_PASSWORD" || (cd $SRCDIR/integration; eval $(./gce.sh hosts); ./run_all.sh):
|
||||
parallel: true
|
||||
timeout: 300
|
||||
post:
|
||||
- test -z "$SECRET_PASSWORD" || (cd $SRCDIR/integration; ./gce.sh destroy):
|
||||
parallel: true
|
||||
- test "$CIRCLE_NODE_INDEX" != "0" || (cd $SRCDIR; ./tools/cover/gather_coverage.sh ./coverage $SRCDIR/coverage):
|
||||
parallel: true
|
||||
- test "$CIRCLE_NODE_INDEX" != "0" || (goveralls -repotoken $COVERALLS_REPO_TOKEN -coverprofile=$SRCDIR/profile.cov -service=circleci || true):
|
||||
parallel: true
|
||||
- test "$CIRCLE_NODE_INDEX" != "0" || (cd $SRCDIR; cp */*.codecgen.go $CIRCLE_ARTIFACTS):
|
||||
parallel: true
|
||||
|
||||
deployment:
|
||||
hub:
|
||||
branch: master
|
||||
commands:
|
||||
- |
|
||||
test -z "${DOCKER_USER}" || (
|
||||
docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS &&
|
||||
(test "${DOCKER_ORGANIZATION:-$DOCKER_USER}" = "weaveworks" || (
|
||||
for IMAGE in $IMAGES; do
|
||||
docker tag weaveworks/$IMAGE:latest ${DOCKER_ORGANIZATION:-$DOCKER_USER}/$IMAGE:latest &&
|
||||
docker tag weaveworks/$IMAGE:$(./tools/image-tag) ${DOCKER_ORGANIZATION:-$DOCKER_USER}/$IMAGE:$(./tools/image-tag)
|
||||
done
|
||||
)) &&
|
||||
for IMAGE in $IMAGES; do
|
||||
docker push ${DOCKER_ORGANIZATION:-$DOCKER_USER}/$IMAGE &&
|
||||
docker push ${DOCKER_ORGANIZATION:-$DOCKER_USER}/$IMAGE:$(./tools/image-tag)
|
||||
done
|
||||
)
|
||||
- |
|
||||
test -z "${QUAY_USER}" || (
|
||||
docker login -e '.' -u "$QUAY_USER" -p "$QUAY_PASSWORD" quay.io &&
|
||||
docker tag weaveworks/scope:$(./tools/image-tag) "quay.io/${QUAY_ORGANIZATION}/scope:$(./tools/image-tag)" &&
|
||||
docker push "quay.io/${QUAY_ORGANIZATION}/scope:$(./tools/image-tag)"
|
||||
)
|
||||
- test -z "${UI_BUCKET_KEY_ID}" || (cd $SRCDIR && make ui-upload && make ui-pkg-upload)
|
||||
hub-dev:
|
||||
branch: /^((?!master).)*$/ # not the master branch
|
||||
commands:
|
||||
- >
|
||||
test -z "${DEPLOY_BRANCH}" || test -z "${DOCKER_USER}" || (
|
||||
docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS &&
|
||||
docker tag weaveworks/scope:latest ${DOCKER_ORGANIZATION:-$DOCKER_USER}/scope:${CIRCLE_BRANCH//\//-} &&
|
||||
docker push ${DOCKER_ORGANIZATION:-$DOCKER_USER}/scope:${CIRCLE_BRANCH//\//-}
|
||||
)
|
||||
# release:
|
||||
# branch: /release-[0-9]+\.[0-9]+/
|
||||
# owner: weaveworks
|
||||
# commands:
|
||||
# - go get github.com/weaveworks/wordepress && cd /home/ubuntu/src/github.com/weaveworks/wordepress && git checkout v1.0.0 && cd cmd/wordepress && go get
|
||||
# - cd $SRCDIR; PRODUCT=scope tools/publish-site "$WP_LIVE_URL" "$WP_LIVE_USER" "$WP_LIVE_PASSWORD"
|
||||
# issues:
|
||||
# branch: /.*/
|
||||
# owner: weaveworks
|
||||
# commands:
|
||||
# - go get github.com/weaveworks/wordepress && cd /home/ubuntu/src/github.com/weaveworks/wordepress && git checkout v1.0.0 && cd cmd/wordepress && go get
|
||||
# - cd $SRCDIR; PRODUCT=scope tools/publish-site "$WP_DEV_URL" "$WP_DEV_USER" "$WP_DEV_PASSWORD"
|
||||
Reference in New Issue
Block a user