Skip to content
This repository has been archived by the owner on Mar 31, 2023. It is now read-only.

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
weave-e2e-quickstart committed Aug 14, 2019
0 parents commit 607ec24
Show file tree
Hide file tree
Showing 345 changed files with 55,941 additions and 0 deletions.
249 changes: 249 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,249 @@
version: 2

# https://circleci.com/blog/circleci-hacks-reuse-yaml-in-your-circleci-config-with-yaml/
defaults: &defaults
docker:
- image: quay.io/wks/build:master-134af34f
environment:
GOPATH: /go/
SRCDIR: /src/github.com/weaveworks/wksctl
working_directory: /src/github.com/weaveworks/wksctl

workflows:
version: 2
test-build-deploy:
jobs:
- build:
filters:
tags:
only: /.*/
- container-tests: {}
- unit-tests: {}
- integration-tests-container:
requires:
- build
- integration-tests-gcp-centos:
requires:
- build
- integration-tests-gcp-ubuntu:
requires:
- build

jobs:
build:
<<: *defaults
steps:
- checkout
- setup_remote_docker
- run: make
- run: make lint
- deploy:
name: Push wksctl to S3
command: |
TAG=${CIRCLE_TAG}
if [ -z "$TAG" ]; then
TAG=$(./tools/image-tag)
fi
- persist_to_workspace:
root: .
paths:
- kubectl
- cmd/wksctl/wksctl
- cmd/mock-https-authz-server/server
# - run: docker login -u "$DOCKER_USER" -p "$DOCKER_PASSWORD" quay.io
# - run: make push

unit-tests:
docker:
- image: quay.io/wks/build:master-134af34f
environment:
GOPATH: /go
SRCDIR: /src/github.com/weaveworks/wksctl
KUBECTL_URL: https://dl.k8s.io/v1.10.5/kubernetes-client-linux-amd64.tar.gz
KUBECTL_CHECKSUM: da9d557989a0b9671a610f21642052febb8f70c3cf144c98a8a4f7ecab6bafe2
working_directory: /src/github.com/weaveworks/wksctl
steps:
- checkout
- run:
name: Install kubectl
command: |
curl -L $KUBECTL_URL -o kubectl.tar.gz
echo "$KUBECTL_CHECKSUM kubectl.tar.gz" | sha256sum -c
tar xvzf kubectl.tar.gz --strip-components=3
sudo mv kubectl /usr/local/bin
- run:
name: Run unit tests
command: |
go version
make unit-tests
container-tests:
machine:
docker_layer_caching: true
environment:
GOURL: https://dl.google.com/go/go1.12.7.linux-amd64.tar.gz
GOCHECKSUM: 66d83bfb5a9ede000e33c6579a91a29e6b101829ad41fffb5c5bb6c900e109d9
GOROOT: /home/circleci/goroot
GOPATH: /home/circleci/go
SRCDIR: /home/circleci/src/github.com/weaveworks/wksctl
working_directory: /home/circleci/src/github.com/weaveworks/wksctl
steps:
# - checkout
# - run:
# name: Install go
# command: |
# (cd ~ && curl -L $GOURL -o go.tar.gz && echo "$GOCHECKSUM go.tar.gz" | sha256sum -c)
# mkdir -p $GOROOT && tar xf ~/go.tar.gz -C $GOROOT --strip-components 1

# - run:
# name: Run container tests
# command: |
# export PATH=$GOROOT/bin:$PATH
# go version
# make container-tests
- run: "true"
integration-tests-container:
machine:
docker_layer_caching: true
environment:
GOURL: https://dl.google.com/go/go1.12.7.linux-amd64.tar.gz
GOCHECKSUM: 66d83bfb5a9ede000e33c6579a91a29e6b101829ad41fffb5c5bb6c900e109d9
GOROOT: /home/circleci/goroot
GOPATH: /home/circleci/go
SRCDIR: /home/circleci/src/github.com/weaveworks/wksctl
HUGO_URL: https://github.com/gohugoio/hugo/releases/download/v0.55.6/hugo_0.55.6_Linux-64bit.tar.gz
HUGO_CHECKSUM: 39d3119cdb9ba5d6f1f1b43693e707937ce851791a2ea8d28003f49927c428f4
FOOTLOOSE_URL: https://github.com/weaveworks/footloose/releases/download/0.5.0/footloose-0.5.0-linux-x86_64
FOOTLOOSE_CHECKSUM: 0e4e49e81940c5876eafa26607154acd788d9979e9f4a4215f17532a3ea5429a
KUBECTL_URL: https://dl.k8s.io/v1.10.5/kubernetes-client-linux-amd64.tar.gz
KUBECTL_CHECKSUM: da9d557989a0b9671a610f21642052febb8f70c3cf144c98a8a4f7ecab6bafe2
working_directory: /home/circleci/src/github.com/weaveworks/wksctl
steps:
# - checkout
# - run:
# name: Install go
# command: |
# (cd ~ && curl -L $GOURL -o go.tar.gz && echo "$GOCHECKSUM go.tar.gz" | sha256sum -c)
# mkdir -p $GOROOT && tar xf ~/go.tar.gz -C $GOROOT --strip-components 1
# - run:
# name: Install hugo
# command: |
# curl -L $HUGO_URL -o hugo.tar.gz
# echo "$HUGO_CHECKSUM hugo.tar.gz" | sha256sum -c
# tar xzf hugo.tar.gz hugo
# chmod +x hugo
# sudo mv hugo /usr/local/bin
# - run:
# name: Install footloose
# command: |
# curl -L $FOOTLOOSE_URL -o footloose
# echo "$FOOTLOOSE_CHECKSUM footloose" | sha256sum -c
# chmod +x footloose
# sudo mv footloose /usr/local/bin
# - run:
# name: Install kubectl
# command: |
# curl -L $KUBECTL_URL -o kubectl.tar.gz
# echo "$KUBECTL_CHECKSUM kubectl.tar.gz" | sha256sum -c
# tar xvzf kubectl.tar.gz --strip-components=3
# sudo mv kubectl /usr/local/bin
# - restore_cache:
# keys:
# - local-docker-registry-images
# - run:
# name: Run integration container tests
# command: |
# export PATH=$GOROOT/bin:$PATH
# go version
# make integration-tests-container
# - save_cache:
# key: local-docker-registry-images
# paths:
# # This ought to match the path mounted by the local Docker registry
# # in the integration tests.
# - "/tmp/registry"
- run: "true"
integration-tests-gcp-centos:
docker:
- image: quay.io/wks/build:master-134af34f
environment:
GOPATH: /go/
SRCDIR: /src/github.com/weaveworks/wksctl
KUBECTL_URL: https://dl.k8s.io/v1.10.5/kubernetes-client-linux-amd64.tar.gz
KUBECTL_CHECKSUM: da9d557989a0b9671a610f21642052febb8f70c3cf144c98a8a4f7ecab6bafe2
CREATE_IMAGE: 0
USE_IMAGE: 0
IMAGE_NAME: centos-cloud/centos-7
working_directory: /src/github.com/weaveworks/wksctl
steps:
# - checkout
# - setup_remote_docker

# - attach_workspace:
# at: /tmp/workspace
# - run: /tmp/workspace/cmd/wksctl/wksctl version
# - run: env

# - run:
# name: Install kubectl
# command: |
# curl -L $KUBECTL_URL -o kubectl.tar.gz
# echo "$KUBECTL_CHECKSUM kubectl.tar.gz" | sha256sum -c
# tar xvzf kubectl.tar.gz --strip-components=3
# sudo mv kubectl /usr/local/bin

# - run:
# name: Create VMs
# command: $SRCDIR/test/integration/bin/up.sh

# - run:
# name: Run integration tests
# command: $SRCDIR/test/integration/bin/test.sh

# - run:
# name: Destroy VMs
# command: $SRCDIR/test/integration/bin/down.sh
# when: always
- run: "true"
integration-tests-gcp-ubuntu:
docker:
- image: quay.io/wks/build:master-134af34f
environment:
GOPATH: /go/
SRCDIR: /src/github.com/weaveworks/wksctl
KUBECTL_URL: https://dl.k8s.io/v1.10.5/kubernetes-client-linux-amd64.tar.gz
KUBECTL_CHECKSUM: da9d557989a0b9671a610f21642052febb8f70c3cf144c98a8a4f7ecab6bafe2
CREATE_IMAGE: 0
USE_IMAGE: 0
IMAGE_NAME: ubuntu-os-cloud/ubuntu-1804-bionic-v20190530
working_directory: /src/github.com/weaveworks/wksctl
steps:
# - checkout
# - setup_remote_docker

# - attach_workspace:
# at: /tmp/workspace
# - run: /tmp/workspace/cmd/wksctl/wksctl version
# - run: env

# - run:
# name: Install kubectl
# command: |
# curl -L $KUBECTL_URL -o kubectl.tar.gz
# echo "$KUBECTL_CHECKSUM kubectl.tar.gz" | sha256sum -c
# tar xvzf kubectl.tar.gz --strip-components=3
# sudo mv kubectl /usr/local/bin

# - run:
# name: Create VMs
# command: $SRCDIR/test/integration/bin/up.sh

# - run:
# name: Run integration tests
# command: $SRCDIR/test/integration/bin/test.sh

# - run:
# name: Destroy VMs
# command: $SRCDIR/test/integration/bin/down.sh
# when: always
- run: "true"
31 changes: 31 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
*_vfsdata.go
.uptodate
/examples/.vagrant
/rpm/output
/test/resource/tests

# Ignore generated binaries
/cmd/controller/controller
/cmd/mock-authz-server/server
/cmd/mock-https-authz-server/server
/cmd/wksctl/wksctl
*_vfsdata.go

# Ignore files generated by footlose:
cluster-key
cluster-key.pub
footloose.yaml

# OS-specific files:
.DS_Store

# Ignore direnv's .envrc files, as they should not be shared and may contain
# sensitive information:
.envrc

# Ignore Terraform state files & working directories:
.terraform/
terraform.tfstate
terraform.tfstate.backup
.terraform.tfstate.lock.info
tf.json
38 changes: 38 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
Contributing to the project

## Typical workflow

1. Choose an issue from the backlog
1. Fork the repo
1. Update source, test, and documentation files
1. Make sure all the unit tests pass and all the files successfully lint. I've taken to running `make clean all unit-tests install`
1. Commit and push your new branch
1. Open a pull request against the master branch in the main repo
1. Address comments and questions in pull request
1. Merge to main repo
1. Delete your branch

## Unit Testing

For all new functionality, provide unit tests where practical and possible. Of course, when they are needed is subjective and might be different for everyone. When trying to decide, keep in mind that a more comprehensive unit test suite makes it easier for engineers to work in areas of the code they are unfamilar with.

## Integration Testing

We have a set of integration tests which run as part of the Circle CI build. It's OK to push changes to your branch and let CircleCI run the integration tests. When changing/adding significant functionality, please add integration tests.

## Pull Requests

Create pull requests for your branch early during development and push code frequently. Pull requests are an efficient mechanism to keep other engineers informed about the work you are doing and gives them an opportunity to weigh in before the formal review is requested.

When opening the PR, put a description of the feature/functionality along with `fixes #<issuenumber>`. This will move the issue to done automatically when the pull request is closed. Additionally, if there are descrete pieces of work in your PR, consider adding a [task list](https://guides.github.com/features/mastering-markdown/#GitHub-flavored-markdown) identifying the work. That takes the form of

> - [ ] add foo
> - [ ] add bar
GitHub will add x of y to the issue when it is displayed in the project board.

#### Reviews
We only require a single maintainer to approve your PR prior to merging it. While you can identify multiple maintainers, it is assumed you **require** everyone listed to review the PR. If you just want to make sure other engineers take a look, use the GitHub [mentions](https://guides.github.com/features/mastering-markdown/#GitHub-flavored-markdown) @<username> within a comment and they will receive a notification about your PR.

#### Merging
One of the maintainers will merge your PR after it is approved.
3 changes: 3 additions & 0 deletions DEPENDENCIES
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
DOCKER_VERSION=17.06
KUBERNETES_VERSION=1.10.4
KUBERNETES_CNI_VERSION=0.6.0
Loading

0 comments on commit 607ec24

Please sign in to comment.