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

Build and publish huginn/huginn-test #2016

Merged
merged 2 commits into from
May 31, 2017

Conversation

mandrews
Copy link
Contributor

@mandrews mandrews commented May 24, 2017

If we publish this docker image, then it will be possible to execute commands from within a huginn development/test environment. For example, it should be possible to test and build an external huginn_agent using this docker image:

# docker-compose.yml
version: '2'

services:
  ...
  huginn_gem_build:
    image: huginn/huginn_test
    environment:
      DATABASE_ADAPTER: postgresql
      TEST_DATABASE_NAME: huginn
       ...
    links:
      - postgres
    command: rake prepare spec build
    working_dir: /build
    volumes:
      - .:/build

I don't think the Travis job will work until docker.io/huginn/huginn-test is created:

DOCKER_IMAGE=huginn/huginn-test DOCKERFILE=docker/test/Dockerfile ./build_docker_image.sh

docker pull $DOCKER_IMAGE
Using default tag: latest
Pulling repository docker.io/huginn/huginn-test
Error: image huginn/huginn-test:latest not found

@dsander
Copy link
Collaborator

dsander commented May 25, 2017

Being about to use the test image for Agent gems looks awesome!

You are right, we first need to push a image to huginn/huginn-test. I think we should change how the image is build. Because the Travis jobs run in parallel the test image would always be based on the previous single-process image.
We could use build stages which would probably clean up the travis config but also slow down the build because stages are run successively. An other option would be to change the build_docker_image.sh script to spawn another build for the test image after the single-process is done. Appending this to the script should do the trick:

if [[ $DOCKER_IMAGE == "huginn/huginn" ]]; then
  DOCKER_IMAGE=huginn/huginn-test DOCKERFILE=docker/test/Dockerfile ./build_docker_image.sh
fi

@mandrews
Copy link
Contributor Author

@dsander good idea - updated the PR with your suggestion

@dsander
Copy link
Collaborator

dsander commented May 26, 2017

@mandrews I think I was wrong yesterday. Since the test image is based on huginn/huginn-single-process we should build it after that one, right?

@mandrews
Copy link
Contributor Author

@dsander good catch - sorry I missed that 👍

@dsander dsander merged commit 47bd9ec into huginn:master May 31, 2017
@dsander
Copy link
Collaborator

dsander commented May 31, 2017

Thanks!

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