Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Commit

Permalink
Merge pull request #1 from fluxcd/master
Browse files Browse the repository at this point in the history
Pull upstream changes
  • Loading branch information
waseem-h authored Oct 16, 2019
2 parents e58cecf + 655c907 commit afdf5f1
Show file tree
Hide file tree
Showing 426 changed files with 19,788 additions and 13,029 deletions.
173 changes: 150 additions & 23 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,50 +1,177 @@
version: 2
jobs:
build:
working_directory: /go/src/github.com/weaveworks/flux
helm:
docker:
- image: circleci/golang:1.10
- image: memcached
- image: circleci/golang:1.12
steps:
- checkout
- setup_remote_docker
- run:
name: Install kubectl
command: sudo curl -L https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl -o /usr/local/bin/kubectl && sudo chmod +x /usr/local/bin/kubectl
- run:
name: Install helm
command: sudo curl -L https://storage.googleapis.com/kubernetes-helm/helm-v2.14.2-linux-amd64.tar.gz | tar xz && sudo mv linux-amd64/helm /bin/helm && sudo rm -rf linux-amd64
- run:
name: Initialize helm
command: helm init --client-only --kubeconfig=$HOME/.kube/kubeconfig
- run:
name: Lint chart
command: |
helm lint ./chart/flux
- run:
name: Package chart
command: |
mkdir $HOME/chart
helm package ./chart/flux --destination $HOME/chart
- run:
name: Publish chart
command: |
git config --global user.email fluxcdbot@users.noreply.github.com
git config --global user.name fluxcdbot
- run: curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
- run: dep ensure -vendor-only
- run: make check-generated
# Push to fluxcd/flux gh-pages branch
if echo "${CIRCLE_TAG}" | grep -Eq "chart-[0-9]+(\.[0-9]+)*(-[a-z]+)?$"; then
REPOSITORY="https://fluxcdbot:${GITHUB_TOKEN}@github.com/fluxcd/flux.git"
git remote set-url origin ${REPOSITORY}
git checkout gh-pages
cp $HOME/chart/*.tgz .
helm repo index . --url https://fluxcd.github.io/flux
git add .
git commit -m "Publish Helm chart"
git push origin gh-pages
else
echo "Not a chart release! Skip chart publish"
fi
# Push to fluxcd/charts gh-pages branch
if echo "${CIRCLE_TAG}" | grep -Eq "chart-[0-9]+(\.[0-9]+)*(-[a-z]+)?$"; then
REPOSITORY="https://fluxcdbot:${GITHUB_TOKEN}@github.com/fluxcd/charts.git"
mkdir $HOME/fluxcd-charts
cd $HOME/fluxcd-charts && git clone ${REPOSITORY}
cd $HOME/fluxcd-charts/charts
git checkout gh-pages
mv $HOME/chart/*.tgz .
helm repo index . --url https://charts.fluxcd.io
git add .
git commit -m "Publish chart to fluxcd/charts"
git push origin gh-pages
else
echo "Not a chart release! Skip chart publish"
fi
build:
working_directory: /home/circleci/go/src/github.com/fluxcd/flux
machine:
image: ubuntu-1604:201903-01
environment:
GO_VERSION: 1.13.1
# We don't need a GOPATH but CircleCI defines it, so we override it
GOPATH: /home/circleci/go
GO111MODULE: 'on'
PATH: /bin:/usr/bin:/usr/local/go/bin:/home/circleci/go/bin
steps:
- checkout
- run:
name: Install Golang
command: |
curl -OL https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz
tar -xf go${GO_VERSION}.linux-amd64.tar.gz
sudo rm -rf /usr/local/go
sudo mv go /usr/local
mkdir -p "$HOME/go/bin"
rm -rf go${GO_VERSION}.linux-amd64.tar.gz
go version
- run:
name: Update packages and start Memcached
no_output_timeout: 10m
command: |
# Kill any apt-get processes that may be hanging due to
# networking related issues, and thus holding on to
# `/var/lib/apt/lists/lock`.
# https://support.circleci.com/hc/en-us/articles/360021256633-Apt-Get-Update-Is-Slow-Or-Locked
sudo killall apt-get || true
sudo apt-get update
sudo apt-get install -y git rng-tools memcached
git version
docker version
- restore_cache:
keys:
- cache-{{ checksum "Makefile" }}
- cache-
- restore_cache:
keys:
- go-build-{{ .Branch }}-{{ .Revision }}
- go-build-{{ .Branch }}-
- go-build-
- restore_cache:
keys:
- go-mod-{{ checksum "go.mod" }}
- go-mod-
- run: make test TEST_FLAGS="-race -tags integration -timeout 60s"
- run: make check-generated
- run: make all

- run: make e2e
- run: make test-docs
- save_cache:
key: cache-{{ checksum "Makefile" }}
paths:
- "cache"
- save_cache:
key: go-build-{{ .Branch }}-{{ .Revision }}
paths:
- "~/.cache/go-build/"
- save_cache:
key: go-mod-{{ checksum "go.mod" }}
paths:
- "~/go/pkg/mod/"
- deploy:
name: Maybe push master image
name: Maybe push prerelease images
command: |
if [ -z "${CIRCLE_TAG}" -a "${CIRCLE_BRANCH}" == "master" ]; then
docker login -u "$DOCKER_REGISTRY_USER" -p "$DOCKER_REGISTRY_PASSWORD" quay.io
docker push "quay.io/weaveworks/flux:$(docker/image-tag)"
docker push "quay.io/weaveworks/helm-operator:$(docker/image-tag)"
# Re-tag image as prerelease and publish on DockerHub
echo "$DOCKER_FLUXCD_PASSWORD" | docker login --username "$DOCKER_FLUXCD_USER" --password-stdin
docker tag "docker.io/fluxcd/flux:$(docker/image-tag)" "docker.io/fluxcd/flux-prerelease:$(docker/image-tag)"
docker push "docker.io/fluxcd/flux-prerelease:$(docker/image-tag)"
fi
- deploy:
name: Maybe push release image and upload binaries
command: |
if echo "${CIRCLE_TAG}" | grep -Eq "^[0-9]+(\.[0-9]+)*(-[a-z]+)?$"; then
if echo "${CIRCLE_TAG}" | grep -Eq "^[0-9]+(\.[0-9]+)*(-[a-z0-9]+)?$"; then
# Publish binaries to GitHub
go get github.com/weaveworks/github-release
make release-bins
bin/upload-binaries
docker login -u "$DOCKER_REGISTRY_USER" -p "$DOCKER_REGISTRY_PASSWORD" quay.io
docker push "quay.io/weaveworks/flux:${CIRCLE_TAG}"
fi
if echo "${CIRCLE_TAG}" | grep -Eq "helm-[0-9]+(\.[0-9]+)*(-[a-z]+)?$"; then
docker login -u "$DOCKER_REGISTRY_USER" -p "$DOCKER_REGISTRY_PASSWORD" quay.io
RELEASE_TAG=$(echo "$CIRCLE_TAG" | cut -c 6-)
docker push "quay.io/weaveworks/helm-operator:${RELEASE_TAG}"
# Publish image on DockerHub
echo "$DOCKER_FLUXCD_PASSWORD" | docker login --username "$DOCKER_FLUXCD_USER" --password-stdin
docker push "docker.io/fluxcd/flux:${CIRCLE_TAG}"
# Republish tag with v prefix so it is available to Go Mod
git config --global user.email fluxcdbot@users.noreply.github.com
git config --global user.name fluxcdbot
REPOSITORY="https://fluxcdbot:${GITHUB_TOKEN}@github.com/fluxcd/flux.git"
git remote set-url origin ${REPOSITORY}
V_TAG="v${CIRCLE_TAG}"
git tag ${V_TAG} $(git rev-list -n1 ${CIRCLE_TAG})
git push origin ${V_TAG}
fi
workflows:
version: 2
build-and-push:
jobs:
- helm
- build:
filters:
tags:
only: /(helm-)?[0-9]+(\.[0-9]+)*(-[a-z]+)?/
only: /[0-9]+(\.[0-9]+)*(-[a-z0-9]+)?/

release-helm:
jobs:
- helm:
filters:
branches:
ignore: /.*/
tags:
only: /^chart.*/
33 changes: 33 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: Bug report
about: Create a report to help us improve Flux
title: ''
labels: blocked-needs-validation, bug
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behaviour:
0. What's your setup?
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Logs**
If applicable, please provide logs of `fluxd` or the helm-operator. In a standard stand-alone installation of Flux, you'd get this by running `kubectl logs -n default deploy/flux`.

**Additional context**
Add any other context about the problem here, e.g
- Flux version:
- Helm Operator version:
- Kubernetes version:
- Git provider:
- Container registry provider:
23 changes: 23 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: Feature request
about: Suggest a new feature for Flux
title: ''
labels: blocked-needs-validation, enhancement
assignees: ''

---

**Describe the feature**
A clear and concise description of the feature.

**What would the new user story look like?**
How would the new interaction with Flux look like? E.g.
0. What are the prerequisites for this?
1. User starts up Flux using the --add-frobnication flag
2. New commits in git branch happen
3. Deployments happen, which include frobnication

Feel free to add a diagram if that helps explaining things.

**Expected behavior**
A clear and concise description of what you expect to happen.
16 changes: 13 additions & 3 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!--
# General contribution criteria
Please have a look at our contribution guidelines: https://github.com/weaveworks/flux/blob/master/CONTRIBUTING.md
Please have a look at our contribution guidelines: https://github.com/fluxcd/flux/blob/master/CONTRIBUTING.md
Particularly the sections about the:
- DCO;
Expand All @@ -10,8 +10,7 @@ Particularly the sections about the:
To help the maintainers out when they're writing release notes, please
try to include a sentence or two here describing your change for end
users. See the CHANGELOG.md and CHANGELOG-helmop.md files in the
top-level directory for examples.
users. See the CHANGELOG.md file in the top-level directory for examples.
Particularly for ground-breaking changes and new features, it's important to
make users and developers aware of what's changing and where those changes
Expand All @@ -20,4 +19,15 @@ were documented or discussed.
Even for smaller changes it's useful to see things documented as well, as it
gives everybody a chance to see at a glance what's coming up in the next
release. It makes the life of the project maintainer a lot easier as well.
The following short checklist can be used to make sure your PR is of good
quality, and can be merged easily:
- [ ] if it resolves an issue;
is a reference (i.e. #1) to this issue included?
- [ ] if it introduces a new functionality or configuration flag;
did you document this in the references or guides?
- [ ] optional but much appreciated;
do you think many users would profit from a dedicated setting
for this functionality in the Helm chart?
-->
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ _testmain.go
.ackrc
.envrc

### Package builds (e.g. snap of fluxctl)
fluxctl_*_*.snap
fluxctl_*_*.snap.xdelta3
parts
prime
stage


# Specific to this project
vendor/*
!vendor/manifest
Expand All @@ -39,4 +47,9 @@ testdata/sidecar/.sidecar
docker/fluxy-dumbconf.priv
test/profiles
test/bin/kubectl
test/bin/kustomize
test/bin/helm
test/bin/kind

# Docs
docs/_build
23 changes: 23 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# .readthedocs.yml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py

# Build documentation with MkDocs
#mkdocs:
# configuration: mkdocs.yml

# Optionally build your docs in additional formats such as PDF and ePub
formats: all

# Optionally set the version of Python and requirements required to build your docs
python:
version: 3.7
install:
- requirements: docs/requirements.txt
Loading

0 comments on commit afdf5f1

Please sign in to comment.