Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read the message file and execute all cexec steps #4

Merged
merged 1 commit into from
Dec 22, 2015
Merged

Read the message file and execute all cexec steps #4

merged 1 commit into from
Dec 22, 2015

Conversation

rageshkrishna
Copy link
Contributor

Addresses #2

This flow was tested end-to-end using mexec by publishing the following message:

{
  "steps": [
    {
      "name": "build.boot",
      "who": "mexec",
      "scripts": ["#!/bin/bash\n\ncexec_image_id=$(docker run -d --privileged=true --restart=no --net=host -e SHIPPABLE_API_TOKEN=cc540ee6-1d2c-43a4-8413-39facb15fab9 -e SHIPPABLE_API_URL=https://172.17.42.1:50000 -e SHIPPABLE_API_RETRY_INTERVAL=3 -e RUN_MODE=dev -e SHIPPABLE_AMQP_URL=amqp:https://SHIPPABLETESTUSER:[email protected]:5672/shippable -v /usr/bin/docker:/usr/bin/docker -v /var/run/docker.sock:/var/run/docker.sock -v /tmp/cexec:/cexec -v /home/shippable/cexec:/home/shippable/cexec:rw -t shipimg/cexec)\n\ndocker wait $cexec_image_id\n\necho __SH__SCRIPT_END_SUCCESS__"]
    },
    {
      "name": "build.ci",
      "who": "cexec",
      "scripts": ["ls -ltra; sleep 15; echo __SH__SCRIPT_END_SUCCESS__"]
    }
  ]
}

mexec received the message, successfully launched a cexec container and waited until it returned before acknowledging the message. The wait was accomplished using docker wait in the boot script right after launching the cexec container.

cexec correctly read the script file from the mounted /cexec directory and executed its script.

ric03uec added a commit that referenced this pull request Dec 22, 2015
Read the message file and execute all cexec steps
@ric03uec ric03uec merged commit 5dee7c0 into Shippable:master Dec 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants