You can use the command $oc secrets [options]
Via the command $oc secrets --help
you can see the available types.
Following an example to create a new secret for a basic authentication.
$oc secrets new-basicauth myapp-secret --username=admin --password=admin123
After creating the secret is required to attach it to your build config via the command $oc set build-secret --source
Following an example to attach the secret created above to a build config object.
$oc set build-secret --source bc/myapp myapp-secret
If you edit the build config you will see that the secret was added to the file as the following example. ($oc edit bc/myapp)
For further information check the OpenShift Developer Guide.