Skip to content
Draft
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
84 changes: 13 additions & 71 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,82 +1,24 @@
version: 2.1

executors:
my-executor:
docker:
- image: buildpack-deps:jessie
working_directory: /tmp

# Define the jobs we want to run for this project
jobs:
flow:
executor: my-executor
steps:
- run: mkdir -p $CIRCLE_WORKFLOW_JOB_ID
- run: ls -al
- run: pwd
- run: echo "Hello, world!" > $CIRCLE_WORKFLOW_JOB_ID/echo-output
- run: cat /tmp/$CIRCLE_WORKFLOW_JOB_ID/echo-output
- run: ls -al
- run: find $CIRCLE_WORKFLOW_JOB_ID/echo-output
- run: cat $CIRCLE_WORKFLOW_JOB_ID/echo-output

# Persist the specified paths (workspace/echo-output) into the workspace for use in downstream job.
- persist_to_workspace:
# Must be an absolute path, or relative path from working_directory. This is a directory in the execution
# environment which is taken to be the root directory of the workspace.
root: $CIRCLE_WORKFLOW_JOB_ID
# Must be relative path from root
paths:
- echo-output
test:
executor: my-executor
steps:
- run: mkdir -p $CIRCLE_WORKFLOW_JOB_ID
- run: echo "Hello, world!" > $CIRCLE_WORKFLOW_JOB_ID/echo-output

# Persist the specified paths (workspace/echo-output) into the workspace for use in downstream job.
- persist_to_workspace:
# Must be an absolute path, or relative path from working_directory. This is a directory in the execution
# environment which is taken to be the root directory of the workspace.
root: $CIRCLE_WORKFLOW_JOB_ID
# Must be relative path from root
paths:
- echo-output
testing:
executor: my-executor
build:
docker:
- image: cimg/python:3.12.5
steps:
- run: mkdir -p $CIRCLE_WORKFLOW_JOB_ID
- run: echo "Hello, world!" > $CIRCLE_WORKFLOW_JOB_ID/echo-output
- checkout

# Persist the specified paths (workspace/echo-output) into the workspace for use in downstream job.
- persist_to_workspace:
# Must be an absolute path, or relative path from working_directory. This is a directory in the execution
# environment which is taken to be the root directory of the workspace.
root: $CIRCLE_WORKFLOW_JOB_ID
# Must be relative path from root
paths:
- echo-output


downstream:
executor: my-executor
steps:
- attach_workspace:
# Must be absolute path or relative path from working_directory
at: /tmp/workspace

- run: |
if [[ `cat /tmp/workspace/echo-output` == "Hello, world!" ]]; then
echo "It worked!";
else
echo "Nope!"; exit 1
fi

workflows:
btd:
build_and_test:
jobs:
- flow
- test
- testing
- downstream:
requires:
- flow
- build:
name: build/test