Можно ли создавать переменные CI с помощью Gitlab API? - PullRequest
0 голосов
/ 10 ноября 2019

Я переношу проекты на Gitlab.com с хостинга Gitlab-ce и хотел перенести переменные более эффективно. Поэтому я попытался использовать Gitlab API, но он ничего не сделал. Вот как я это попробовал:

curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/variables" --form "key=NEW_VARIABLE" --form "value=new value"

с многословным:

*   Trying 35.231.145.151...
* TCP_NODELAY set
* Connected to www.gitlab.com (35.231.145.151) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: /etc/ssl/certs
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384
* ALPN, server did not agree to a protocol
* Server certificate:
*  subject: OU=Domain Control Validated; OU=PositiveSSL Multi-Domain; CN=gitlab.com
*  start date: Jun 27 00:00:00 2019 GMT
*  expire date: May 11 23:59:59 2020 GMT
*  subjectAltName: host "www.gitlab.com" matched cert's "www.gitlab.com"
*  issuer: C=GB; ST=Greater Manchester; L=Salford; O=Sectigo Limited; CN=Sectigo RSA Domain Validation Secure Server CA
*  SSL certificate verify ok.
> POST /api/v4/projects/<my-project-id>/variables HTTP/1.1
> Host: www.gitlab.com
> User-Agent: curl/7.58.0
> Accept: */*
> PRIVATE-TOKEN: <my-token>
> Content-Length: 253
> Content-Type: multipart/form-data; boundary=------------------------e33f3d40ebb8591f
> 
< HTTP/1.1 308 Permanent Redirect
< Content-length: 0
< Location: https://gitlab.com/api/v4/projects/15160496/variables
< Connection: close
< 
* Closing connection 0
* TLSv1.2 (OUT), TLS alert, Client hello (1):

Возможно ли это вообще или нет? если возможно что я делаю не так?

...