Like Prometheus, but for logs.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
loki/.circleci/config.yml

149 lines
3.8 KiB

version: 2
.tags: &tags # tags need to be explicitely defined (whitelist)
tags: {only: "/.*/"}
.only-tags: &only-tags
<<: *tags
branches: { ignore: "/.*/" }
.tag-or-master: &tag-or-master
branches: { only: master }
<<: *tags
.no-master: &no-master # contrary to tags, the branches must be excluded (blacklist)
branches: { ignore: master }
workflows:
version: 2
default:
jobs:
# publish jobs depend on this as well,
# thus tags need to be allowed for these
- test: {filters: {<<: *tags}}
- build/promtail-windows:
requires: [ test ]
- build/docker-driver:
requires: [ test ]
filters: {<<: *no-master}
- publish/docker-driver:
requires: [ test ]
filters: { <<: *tag-or-master }
- publish/binaries:
requires: [ test ]
filters: { <<: *only-tags }
- test-helm:
requires: [ test ]
filters: {<<: *tags}
- publish-helm:
requires: [ test-helm ]
filters: {<<: *tag-or-master}
# https://circleci.com/blog/circleci-hacks-reuse-yaml-in-your-circleci-config-with-yaml/
.defaults: &defaults
docker:
- image: grafana/loki-build-image:0.9.1
working_directory: /src/loki
jobs:
test:
<<: *defaults
steps:
- checkout
- run:
name: Unit Tests
command: make BUILD_IN_CONTAINER=false test
- run:
name: Upload Codecov
command: |
bash <(curl -s https://codecov.io/bash)
# Promtail
build/promtail-windows:
<<: *defaults
steps:
- checkout
- setup_remote_docker
- run:
name: touch-protos
command: make touch-protos
- run:
name: build
command: make GOOS=windows GOGC=10 promtail
# Docker driver
build/docker-driver:
<<: *defaults
steps:
- checkout
- setup_remote_docker
- run:
name: docker-driver
command: make docker-driver
publish/docker-driver:
<<: *defaults
steps:
- checkout
- setup_remote_docker
- run:
name: login
command: docker login -u "$DOCKER_USER" -p "$DOCKER_PASS"
- run:
name: docker-driver
command: make docker-driver-push
publish/binaries:
<<: *defaults
steps:
- checkout
- run:
name: github release
command: make BUILD_IN_CONTAINER=false publish
test-helm:
environment:
CT_VERSION: 2.3.3
machine:
image: ubuntu-1604:201903-01
steps:
- checkout
- run:
name: Install k3s
command: |
curl -sfL https://get.k3s.io | sh -
sudo chmod 755 /etc/rancher/k3s/k3s.yaml
mkdir -p ~/.kube
cp /etc/rancher/k3s/k3s.yaml ~/.kube/config
- run:
name: Install Helm
command: |
curl -L https://git.io/get_helm.sh | bash
kubectl apply -f tools/helm.yaml
helm init --service-account helm --wait
- run:
name: Install Chart Testing tool
command: |
pip install yamale yamllint
curl -Lo ct.tgz https://github.com/helm/chart-testing/releases/download/v${CT_VERSION}/chart-testing_${CT_VERSION}_linux_amd64.tar.gz
sudo tar -C /usr/local/bin -xvf ct.tgz
sudo mv /usr/local/bin/etc /etc/ct/
- run:
name: Run Chart Tests
command: |
ct lint --chart-dirs=production/helm --check-version-increment=false --validate-maintainers=false
ct install --build-id=${CIRCLE_BUILD_NUM} --charts production/helm/loki-stack
publish-helm:
<<: *defaults
steps:
- add_ssh_keys:
fingerprints:
- "5a:d3:08:5e:f7:53:a0:c4:e9:5d:83:c6:02:6a:d9:bd"
- checkout
- run: make helm-publish