@@ -104,23 +104,24 @@ digestfile = "tmp/oscontainer-digest"
104
104
# We need to pass the auth file from the unpriv user to the root process
105
105
cosa_argv = ['sudo' , '--preserve-env=container,DISABLE_TLS_VERIFICATION,SSL_CERT_DIR,SSL_CERT_FILE,REGISTRY_AUTH_FILE,OSCONTAINER_CERT_DIR' ]
106
106
authfile = os .environ .get ("REGISTRY_AUTH_FILE" , os .path .expanduser ('~/.docker/config.json' ))
107
- if not os .path .isfile (authfile ):
108
- raise SystemExit (f"Missing { authfile } " )
109
- os .environ ['REGISTRY_AUTH_FILE' ] = authfile
110
- cosa_argv .extend (['/usr/lib/coreos-assembler/oscontainer.py' , '--workdir=./tmp' , 'build' , f"--from={ args .from_image } " ])
107
+ #if not os.path.isfile(authfile):
108
+ # raise SystemExit(f"Missing {authfile}")
109
+ #os.environ['REGISTRY_AUTH_FILE'] = authfile
110
+ print ("Entering vm to build oscontainer for build: {}" .format (latest_build ))
111
+ arguments = ''
111
112
for d in args .add_directory :
112
- cosa_argv . append ( f" --add-directory={ d } " )
113
- cosa_argv . append ( f" --display-name={ display_name } " )
113
+ arguments = arguments + ( f' --add-directory=" { d } "' )
114
+ arguments = arguments + ( f' --display-name=" { display_name } "' )
114
115
if 'labeled-packages' in configyaml :
115
116
pkgs = ' ' .join (configyaml ['labeled-packages' ])
116
- cosa_argv . append ( f" --labeled-packages={ pkgs } " )
117
+ arguments = arguments + ( f' --labeled-packages=" { pkgs } "' )
117
118
if args .format is not None :
118
- cosa_argv . append (f'--format={ args .format } ' )
119
- subprocess . check_call ( cosa_argv +
120
- [ f'--digestfile= { digestfile } ' ,
121
- '--push' , tmprepo ,
122
- meta [ 'ostree-commit' ],
123
- osc_name_and_tag ] )
119
+ arguments = arguments + (f' --format=" { args .format } " ' )
120
+
121
+ print ( arguments )
122
+ #adding aguments failing
123
+ cosa_argv . extend ([ '/bin/sh' , '-c' , f'. /usr/lib/coreos-assembler/cmdlib.sh; prepare_build && . /usr/lib/coreos-assembler/cmdlib.sh && runvm -- /usr/lib/coreos-assembler/oscontainer-deprecated-legacy-format.py --workdir=./tmp build --from= { args . from_image } --digestfile= { digestfile } --push { tmprepo } { ostree_commit } { osc_name_and_tag } ' ])
124
+ subprocess . check_call ( cosa_argv )
124
125
125
126
with open (digestfile ) as f :
126
127
osc_digest = f .read ().strip ()
0 commit comments