Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .circleci/test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ jobs:
- image: cimg/base:current
steps:
- checkout
# Run your orb's commands to validate them.
- workflow-queue/greet
- workflow-queue/queue
workflows:
test-deploy:
jobs:
Expand Down
1 change: 0 additions & 1 deletion .yamllint
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ rules:
line-length:
max: 200
allow-non-breakable-inline-mappings: true

15 changes: 0 additions & 15 deletions src/commands/greet.yml

This file was deleted.

37 changes: 37 additions & 0 deletions src/commands/queue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
description: >
This command is executed and blocks further execution until the necessary criteria is met.

parameters:
debug:
type: boolean
default: true
description: "If enabled, DEBUG messages will be logged."
time:
type: string
default: "10"
description: "Minutes to wait before giving up."
dont-quit:
type: boolean
default: false
description: "Force job through once time expires instead of failing."
only-on-branch:
type: string
default: "*"
description: "Only queue on specified branch"
confidence:
type: string
default: "1"
description: >
Due to concurrency issues, how many times should we requery the pipeline list to ensure previous jobs are "pending",
but not yet active. This number indicates the threshold for API returning no previous pending pipelines.
Default is one confirmation, increase if you see issues.
circleci-user-auth:
type: env_var_name
default: CIRCLECI_USER_AUTH
description: "In the event you wish to supply CCI basic-auth credentials via a different environment value, set the name here."
steps:
- run:
name: Queue Until Front of Line
environment:
DEBUG_ENABLED: "<< parameters.debug >>"
command: <<include(scripts/queue.sh)>>
12 changes: 0 additions & 12 deletions src/executors/default.yml

This file was deleted.

14 changes: 0 additions & 14 deletions src/jobs/hello.yml

This file was deleted.

44 changes: 44 additions & 0 deletions src/jobs/queue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
description: >
This job is executed and blocks further execution until the necessary criteria is met.

docker:
- image: cimg/base:stable
resource_class: small

parameters:
debug:
type: boolean
default: false
description: "If enabled, DEBUG messages will be logged."
time:
type: string
default: "10"
description: "Minutes to wait before giving up."
dont-quit:
type: boolean
default: false
description: "Force job through once time expires instead of failing."
only-on-branch:
type: string
default: "*"
description: "Only queue on specified branch"
confidence:
type: string
default: "1"
description: >
Due to concurrency issues, how many times should we requery the pipeline list to ensure previous jobs are "pending",
but not yet active. This number indicates the threshold for API returning no previous pending pipelines.
Default is one confirmation, increase if you see issues.
circleci-user-auth:
type: env_var_name
default: CIRCLECI_USER_AUTH
description: "In the event you wish to supply CCI basic-auth credentials via a different environment value, set the name here."

steps:
- queue:
debug: << parameters.debug >>
time: <<parameters.time>>
dont-quit: <<parameters.dont-quit>>
only-on-branch: <<parameters.only-on-branch>>
confidence: <<parameters.confidence>>
circleci-user-auth: <<parameters.circleci-user-auth>>
2 changes: 0 additions & 2 deletions src/scripts/greet.sh

This file was deleted.

10 changes: 10 additions & 0 deletions src/scripts/queue.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

debug() {
if [ -n "${DEBUG_ENABLED}" ]; then
echo "DEBUG: ${*}"
fi
}

debug "this is a test"
echo "this is a test"