mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-06 15:46:57 +01:00
38 lines
1.0 KiB
Plaintext
38 lines
1.0 KiB
Plaintext
// Module included in the following assemblies:
|
|
//
|
|
// <List assemblies here, each on a new line>
|
|
//* assembly/builds
|
|
|
|
// This module can be included from assemblies using the following include statement:
|
|
// include::<path>/builds-source-secret-basic-auth.adoc[leveloffset=+1]
|
|
|
|
[id="source-secrets-basic-auth_{context}"]
|
|
= Creating a secret from source code basic authentication
|
|
|
|
Basic authentication requires either a combination of `--username` and
|
|
`--password`, or a `token` to authenticate against the SCM server.
|
|
|
|
.Prerequisites
|
|
|
|
* User name and password to access the private repository.
|
|
|
|
.Procedure
|
|
|
|
. Create the `secret` first before using the user name and password to access the
|
|
private repository:
|
|
+
|
|
----
|
|
$ oc create secret generic <secret_name> \
|
|
--from-literal=username=<user_name> \
|
|
--from-literal=password=<password> \
|
|
--type=kubernetes.io/basic-auth
|
|
----
|
|
+
|
|
. Create a basic authentication secret with a token:
|
|
+
|
|
----
|
|
$ oc create secret generic <secret_name> \
|
|
--from-literal=password=<token> \
|
|
--type=kubernetes.io/basic-auth
|
|
----
|