// The only indication we have that we're running in a fork is the presence of a secret.
// If a secret is blank, it means we're running in a fork.
local skipMissingSecretPipelineStep(secretName) = run(
'skip pipeline if missing secret',
[
'if [ "${#TEST_SECRET}" -eq 0 ]; then',
' echo "Missing a secret to run this pipeline. This branch needs to be re-pushed as a branch in main grafana/loki repository in order to run." && exit 78',
'fi',
],
image='alpine',
env={
TEST_SECRET: { from_secret: secretName },
},
);
local docker(arch, app) = {
name: '%s-image' % if $.settings.dry_run then 'build-' + app else 'publish-' + app,
image: if arch == 'arm' then 'plugins/docker:linux-arm' else 'plugins/docker',