I'm trying to migrate a java app that runs on Wildfly from Openshift Online v2 to Openshift Online v3 and having difficulties. I go through the steps here
and get to
"4. Use the the oc command to launch a new Wildfly application from the builder image and source code:
$ oc new-app https://github.com/<github-id>/<repo-name>.git
--image-stream=”openshift/wildfly:10.0" --name=<app-name> -e
<ENV_VAR_NAME>=<env_var_value>"
I get the error "error: No language matched the source repository"
1) How does Openshift even know what my account is?
2) Why doesn't it know what to do with my .war files?
I tried adding a Wildfly cartridge to my account, thinking whether I understand how or not, somehow the oc command knows which account is mine, and I need a Wildfly cartridge before it can recognize a .war file.
I get to the part where it asks me for my Git repository URL and it gives me the message:
" Please enter a valid name.
A valid name is applied to all generated resources. It is an alphanumeric (a-z, and 0-9) string with a maximum length of 24 characters, where the first character is a letter (a-z), and the '-' character is allowed anywhere except the first or last character."
How is that possible? "https://github.com//.git" is already 24 characters; "https://github.com/github-id/repo-name.git" is going to be too long no matter what my github id is or my repository name is.
So, working through each of your issues here
The migration guides assume that you have already logged in to
oc
and created your projects. If you haven't, you can do so as followsoc login api.starter-<region>.openshift.com
oc new-project <project-name>
Where matches the URL for the cluster that you've signed up for, and can be any name that hasn't already been taken on that cluster (I've found it's usually easiest to my username, as it's rarely already taken). By logging in and creating your project (if you already have 1 project, then the
oc login
will use that project by default and you can skipoc new-project
), this is how OpenShift will know what account to use.oc new-app
uses some key files in your git repo to determine what language to deploy, you can find this list of files used for language detection in the documentation. So for your application, you need to be sure to include a pom.xml file. You can find an example of a git repository for Wildfly here. That should help you in deploying your application.When using
--name
, you need to actually specify an application name, instead of using the default provided<app-name>
. The command is complaining that<
and>
are not valid characters to use, and is not referring to your git repo URL being too long.