Skip to content

Commit

Permalink
ci: fix drone deploy job
Browse files Browse the repository at this point in the history
The deploy job stopped working for some unknown reason. This commit
fixes it by moving the deploy script to its own file.
  • Loading branch information
rfratto committed Nov 5, 2019
1 parent 64c7012 commit f89dd81
Show file tree
Hide file tree
Showing 3 changed files with 468 additions and 464 deletions.
32 changes: 16 additions & 16 deletions .drone/drone.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ local docker(arch, app) = {
},
};

local arch_image(arch,tags='') = {
local arch_image(arch, tags='') = {
platform: {
os: 'linux',
arch: arch,
Expand All @@ -59,8 +59,8 @@ local arch_image(arch,tags='') = {
}],
};

local fluentbit() = pipeline('fluent-bit-amd64') + arch_image('amd64','latest,master') {
steps+: [
local fluentbit() = pipeline('fluent-bit-amd64') + arch_image('amd64', 'latest,master') {
steps+: [
// dry run for everything that is not tag or master
docker('amd64', 'fluent-bit') {
depends_on: ['image-tag'],
Expand All @@ -69,7 +69,7 @@ local fluentbit() = pipeline('fluent-bit-amd64') + arch_image('amd64','latest,ma
dry_run: true,
repo: 'grafana/fluent-bit-plugin-loki',
},
}
},
] + [
// publish for tag or master
docker('amd64', 'fluent-bit') {
Expand All @@ -78,7 +78,7 @@ local fluentbit() = pipeline('fluent-bit-amd64') + arch_image('amd64','latest,ma
settings+: {
repo: 'grafana/fluent-bit-plugin-loki',
},
}
},
],
depends_on: ['check'],
};
Expand Down Expand Up @@ -130,8 +130,8 @@ local manifest(apps) = pipeline('manifest') {
local drone = [
pipeline('check') {
workspace: {
base: "/src",
path: "loki"
base: '/src',
path: 'loki',
},
steps: [
make('test', container=false) { depends_on: ['clone'] },
Expand All @@ -144,28 +144,28 @@ local drone = [
multiarch_image(arch)
for arch in archs
] + [
fluentbit()
fluentbit(),
] + [
manifest(['promtail', 'loki', 'loki-canary']) {
trigger: condition('include').tagMaster,
},
] + [
pipeline("deploy") {
pipeline('deploy') {
trigger: condition('include').tagMaster,
depends_on: ["manifest"],
depends_on: ['manifest'],
steps: [
{
name: "trigger",
name: 'trigger',
image: 'grafana/loki-build-image:%s' % build_image_version,
environment: {
CIRCLE_TOKEN: {from_secret: "circle_token"}
CIRCLE_TOKEN: { from_secret: 'circle_token' },
},
commands: [
'curl -s --header "Content-Type: application/json" --data "{\\"build_parameters\\": {\\"CIRCLE_JOB\\": \\"deploy\\", \\"IMAGE_NAMES\\": \\"$(make print-images)\\"}}" --request POST https://circleci.com/api/v1.1/project/github/raintank/deployment_tools/tree/master?circle-token=$CIRCLE_TOKEN'
]
}
'./tools/deploy.sh',
],
},
],
}
},
];

{
Expand Down
Loading

0 comments on commit f89dd81

Please sign in to comment.