add repo in script

Hello,

After 1 an half month building a very very basic install package script for my susestudio xfce I have a problem:
How to add a repo with the keys verification, e.g:

But zypper ref after there is always a problem because is asking for the trust question.

Observ: I’m just trying to easy install some apps like spotify and others that you need some extra work, it 's a personal learning process.
Thanks.

Hi
Why not just add the packages to your SUSE Studio image by adding the relevant repositories?

Anyway, you need to script out importing the gpg keys for the repoistory, see here;
https://forums.opensuse.org/showthread.php/512615-How-do-I-un-trust-a-repo?highlight=signing+key

You are using your zypper flags incorrectly.
I describe how to do this correctly using those flags with the “zypper ref” command in my Wiki page describing adding Elasticsearch repos

https://en.opensuse.org/User:Tsu2/elasticsearch_logstash_official_repos

So, in your case the following should work

zypper ar -f  http://download.opensuse.org/repositories/GNOME:/Apps/openSUSE_Leap_42.1/GNOME:Apps.repo gnomeApps LEAP_42.1_GnomeApps && zypper ref --gpg-auto-import-keys         

TSU

Didn’t notice your reponame.
Modified which should work

zypper ar -f  http://download.opensuse.org/repositories/GNOME:/Apps/openSUSE_Leap_42.1/GNOME:Apps.repo gnomeApps  && zypper ref --gpg-auto-import-keys