Vauxoo / travis2docker

This is a Library to transform travis to docker file
BSD 2-Clause "Simplified" License
13 stars 15 forks source link

KeyError: 'docker_image_repo' when using t2d to clone a new repo #174

Closed ebirbe closed 1 year ago

ebirbe commented 1 year ago

Trying to use nortenas repository to build a new image using the --deployv option I get this traceback:

erick@DesktopDelux:~$ t2dnappa --deployv git@git.vauxoo.com:vauxoo/nortenas.git 12.0
cmd list ['git', '--git-dir=/home/erick/src/t2dnappa/repo/git_git.vauxoo.com_vauxoo_nortenas.git', 'gc', '--auto', '--prune=all']
cmd git --git-dir=/home/erick/src/t2dnappa/repo/git_git.vauxoo.com_vauxoo_nortenas.git gc --auto --prune=all
cmd list ['git', '--git-dir=/home/erick/src/t2dnappa/repo/git_git.vauxoo.com_vauxoo_nortenas.git', 'fetch', '-p', 'origin', '+refs/heads/*:refs/heads/*']
cmd git --git-dir=/home/erick/src/t2dnappa/repo/git_git.vauxoo.com_vauxoo_nortenas.git fetch -p origin +refs/heads/*:refs/heads/*
cmd list ['git', '--git-dir=/home/erick/src/t2dnappa/repo/git_git.vauxoo.com_vauxoo_nortenas.git', 'fetch', 'origin', '+refs/pull/*/head:refs/pull/*']
cmd git --git-dir=/home/erick/src/t2dnappa/repo/git_git.vauxoo.com_vauxoo_nortenas.git fetch origin +refs/pull/*/head:refs/pull/*
cmd list ['git', '--git-dir=/home/erick/src/t2dnappa/repo/git_git.vauxoo.com_vauxoo_nortenas.git', 'fetch', 'origin', '+refs/merge-requests/*/head:refs/pull/*']
cmd git --git-dir=/home/erick/src/t2dnappa/repo/git_git.vauxoo.com_vauxoo_nortenas.git fetch origin +refs/merge-requests/*/head:refs/pull/*
cmd list ['git', '--git-dir=/home/erick/src/t2dnappa/repo/git_git.vauxoo.com_vauxoo_nortenas.git', 'rev-parse', '12.0']
cmd git --git-dir=/home/erick/src/t2dnappa/repo/git_git.vauxoo.com_vauxoo_nortenas.git rev-parse 12.0
cmd list ['git', '--git-dir=/home/erick/src/t2dnappa/repo/git_git.vauxoo.com_vauxoo_nortenas.git', 'show', '12.0:.travis.yml']
cmd git --git-dir=/home/erick/src/t2dnappa/repo/git_git.vauxoo.com_vauxoo_nortenas.git show 12.0:.travis.yml
cmd list ['git', '--git-dir=/home/erick/src/t2dnappa/repo/git_git.vauxoo.com_vauxoo_nortenas.git', 'show', '12.0:variables.sh']
cmd git --git-dir=/home/erick/src/t2dnappa/repo/git_git.vauxoo.com_vauxoo_nortenas.git show 12.0:variables.sh
cmd list ['git', '--git-dir=/home/erick/src/t2dnappa/repo/git_git.vauxoo.com_vauxoo_nortenas.git', 'config', 'user.email']
cmd git --git-dir=/home/erick/src/t2dnappa/repo/git_git.vauxoo.com_vauxoo_nortenas.git config user.email
cmd list ['git', '--git-dir=/home/erick/src/t2dnappa/repo/git_git.vauxoo.com_vauxoo_nortenas.git', 'config', 'user.name']
cmd git --git-dir=/home/erick/src/t2dnappa/repo/git_git.vauxoo.com_vauxoo_nortenas.git config user.name
Traceback (most recent call last):
  File "/home/erick/.local/bin/travisfile2dockerfile", line 8, in <module>
    sys.exit(main())
  File "/home/erick/.local/lib/python3.8/site-packages/travis2docker/cli.py", line 239, in main
    t2d = Travis2Docker(
  File "/home/erick/.local/lib/python3.8/site-packages/travis2docker/travis2docker.py", line 96, in __init__
    "%(docker_image_repo)s:%(main_app)s-%(version)s-%(sha_short)s" % self.variables_sh_data
KeyError: 'docker_image_repo'
erick@DesktopDelux:~$ 

I think the nortenas repo is not prepared to use this option, but maybe catch this error and present a more readable error and/or recommendations could be better.

moylop260 commented 1 year ago

@luisg123v

Could you help us to migrate this project, please?

@ebirbe

If this project is not migrated you even can use normal way without --deployv parameter

@antonag32

Could you catch the message in a better way, please?

antonag32 commented 1 year ago

@ebirbe As a temporary fix you can avoid this error with the extra parameter docker-image, you will need to download the Deployv image manually. For example, this is one of my entries from docker image ls

REPOSITORY                           TAG                          IMAGE ID       CREATED         SIZE
quay.io/vauxoo/islamicrelief         islamicrelief-14.0-98a5362   5e11b82fe787   2 weeks ago     8.71GB

You can run t2d with --deployv like this:

t2d <repo> --root-path=/your/path --deployv --docker-image=quay.io/vauxoo/islamicrelief:islamicrelief-14.0-98a5362
moylop260 commented 1 year ago

@antonag32 it works for cases where the docker image is already generated and pushed

But I think this odoo-sh project is not

moylop260 commented 1 year ago

@ebirbe

The project needs to be migrated to new vxci way

Check quay.io is not here:

cc @luisg123v