Skip to content

Commit

Permalink
update CI for branch rename to main (#3625)
Browse files Browse the repository at this point in the history
  • Loading branch information
slim-bean authored Apr 19, 2021
1 parent 0a02aec commit 31bb757
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 68 deletions.
12 changes: 6 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ version: 2
<<: *tags
branches: { ignore: "/.*/" }

.tag-or-master: &tag-or-master
branches: { only: master }
.tag-or-main: &tag-or-main
branches: { only: main }
<<: *tags

.no-master: &no-master # contrary to tags, the branches must be excluded
branches: { ignore: master }
.no-main: &no-main # contrary to tags, the branches must be excluded
branches: { ignore: main }

workflows:
version: 2
Expand All @@ -27,10 +27,10 @@ workflows:

- build/docker-driver:
requires: [test]
filters: { <<: *no-master }
filters: { <<: *no-main }
- publish/docker-driver:
requires: [test]
filters: { <<: *tag-or-master }
filters: { <<: *tag-or-main }

- publish/binaries:
requires: [test]
Expand Down
54 changes: 27 additions & 27 deletions .drone/drone.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ local archs = ['amd64', 'arm64', 'arm'];
local build_image_version = std.extVar('__build-image-version');

local condition(verb) = {
tagMaster: {
tagMain: {
ref: {
[verb]:
[
'refs/heads/master',
'refs/heads/main',
'refs/heads/k??',
'refs/tags/v*',
],
Expand Down Expand Up @@ -87,22 +87,22 @@ local promtail_win() = pipeline('promtail-windows') {
}],
};

local fluentbit() = pipeline('fluent-bit-amd64') + arch_image('amd64', 'latest,master') {
local fluentbit() = pipeline('fluent-bit-amd64') + arch_image('amd64', 'latest,main') {
steps+: [
// dry run for everything that is not tag or master
// dry run for everything that is not tag or main
clients_docker('amd64', 'fluent-bit') {
depends_on: ['image-tag'],
when: condition('exclude').tagMaster,
when: condition('exclude').tagMain,
settings+: {
dry_run: true,
repo: 'grafana/fluent-bit-plugin-loki',
},
},
] + [
// publish for tag or master
// publish for tag or main
clients_docker('amd64', 'fluent-bit') {
depends_on: ['image-tag'],
when: condition('include').tagMaster,
when: condition('include').tagMain,
settings+: {
repo: 'grafana/fluent-bit-plugin-loki',
},
Expand All @@ -111,22 +111,22 @@ local fluentbit() = pipeline('fluent-bit-amd64') + arch_image('amd64', 'latest,m
depends_on: ['check'],
};

local fluentd() = pipeline('fluentd-amd64') + arch_image('amd64', 'latest,master') {
local fluentd() = pipeline('fluentd-amd64') + arch_image('amd64', 'latest,main') {
steps+: [
// dry run for everything that is not tag or master
// dry run for everything that is not tag or main
clients_docker('amd64', 'fluentd') {
depends_on: ['image-tag'],
when: condition('exclude').tagMaster,
when: condition('exclude').tagMain,
settings+: {
dry_run: true,
repo: 'grafana/fluent-plugin-loki',
},
},
] + [
// publish for tag or master
// publish for tag or main
clients_docker('amd64', 'fluentd') {
depends_on: ['image-tag'],
when: condition('include').tagMaster,
when: condition('include').tagMain,
settings+: {
repo: 'grafana/fluent-plugin-loki',
},
Expand All @@ -135,22 +135,22 @@ local fluentd() = pipeline('fluentd-amd64') + arch_image('amd64', 'latest,master
depends_on: ['check'],
};

local logstash() = pipeline('logstash-amd64') + arch_image('amd64', 'latest,master') {
local logstash() = pipeline('logstash-amd64') + arch_image('amd64', 'latest,main') {
steps+: [
// dry run for everything that is not tag or master
// dry run for everything that is not tag or main
clients_docker('amd64', 'logstash') {
depends_on: ['image-tag'],
when: condition('exclude').tagMaster,
when: condition('exclude').tagMain,
settings+: {
dry_run: true,
repo: 'grafana/logstash-output-loki',
},
},
] + [
// publish for tag or master
// publish for tag or main
clients_docker('amd64', 'logstash') {
depends_on: ['image-tag'],
when: condition('include').tagMaster,
when: condition('include').tagMain,
settings+: {
repo: 'grafana/logstash-output-loki',
},
Expand All @@ -161,20 +161,20 @@ local logstash() = pipeline('logstash-amd64') + arch_image('amd64', 'latest,mast

local promtail(arch) = pipeline('promtail-' + arch) + arch_image(arch) {
steps+: [
// dry run for everything that is not tag or master
// dry run for everything that is not tag or main
clients_docker(arch, 'promtail') {
depends_on: ['image-tag'],
when: condition('exclude').tagMaster,
when: condition('exclude').tagMain,
settings+: {
dry_run: true,
build_args: ['TOUCH_PROTOS=1'],
},
}
] + [
// publish for tag or master
// publish for tag or main
clients_docker(arch, 'promtail') {
depends_on: ['image-tag'],
when: condition('include').tagMaster,
when: condition('include').tagMain,
settings+: {
build_args: ['TOUCH_PROTOS=1'],
},
Expand All @@ -185,21 +185,21 @@ steps+: [

local multiarch_image(arch) = pipeline('docker-' + arch) + arch_image(arch) {
steps+: [
// dry run for everything that is not tag or master
// dry run for everything that is not tag or main
docker(arch, app) {
depends_on: ['image-tag'],
when: condition('exclude').tagMaster,
when: condition('exclude').tagMain,
settings+: {
dry_run: true,
build_args: ['TOUCH_PROTOS=1'],
},
}
for app in apps
] + [
// publish for tag or master
// publish for tag or main
docker(arch, app) {
depends_on: ['image-tag'],
when: condition('include').tagMaster,
when: condition('include').tagMain,
settings+: {
build_args: ['TOUCH_PROTOS=1'],
},
Expand Down Expand Up @@ -290,11 +290,11 @@ local manifest(apps) = pipeline('manifest') {
logstash(),
] + [
manifest(['promtail', 'loki', 'loki-canary']) {
trigger: condition('include').tagMaster,
trigger: condition('include').tagMain,
},
] + [
pipeline('deploy') {
trigger: condition('include').tagMaster,
trigger: condition('include').tagMain,
depends_on: ['manifest'],
steps: [
{
Expand Down
Loading

0 comments on commit 31bb757

Please sign in to comment.