GithubHelp home page GithubHelp logo

isabella232 / commerce-ccv2ctl Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sap-archive/commerce-ccv2ctl

0.0 0.0 0.0 72 KB

Command Line Interface for the SAP Commerce Cloud Portal (CCv2 aka Commerce Cloud in the Public Cloud)

License: Apache License 2.0

Shell 5.33% Go 94.67%

commerce-ccv2ctl's Introduction

Archived
With the 2102 release of the Cloud Portal, the offical APIs now cover all features of ccv2ctl

Please use the official API / CLI instead of this tool.

ccv2ctl - SAP Commerce Cloud Portal CLI

REUSE status

This tool allows you to:

  • get data about builds and create (=start) new builds:

    ccv2ctl get build 20180930.2
    # data about a specific build
    
    ccv2ctl get build --all
    # data of all builds
    
    ccv2ctl create build --name some-name --branch production
    # create a new build
    
    ccv2ctl logs 20180930.2
    # dump build log to stdout
    
  • check the data about running deployments

    ccv2ctl get deployment d1
    
  • trigger a deployment

    ccv2ctl create deployment --build 20180930.3 --environment d1
    
  • get data about previous deployments

    ccv2ctl get deploymenthistory d1
    
  • get data about initial passwords

    ccv2ctl get initialpassword d1
    
  • get customer properties

    ccv2ctl get customerproperties d1 --aspect hcs_common
    
  • set customer properties

    ccv2ctl set customerproperties d1 --aspect hcs_common --propertyfile hcs_common.properties
    # set properties from file hcs_common.properties
    
    echo accstore.environment=dev | ccv2ctl set customerproperties d1 --aspect hcs_common
    # set properties from stdin
    

Every command has a detailed help available, make sure to check it! (use ccv2ctl help as an entry point)

Since Go compiles executables as statically linked binaries, you can easily distribute this tool to you CI/CD servers (Jenkins, for example) and use it to automate builds and deployments to the Commerce Cloud.

Installation

Authentication is done via the client certificate for a S-User, the SAP Passport

The S-User needs to be configured as CUSTOMER_DEVELOPER or CUSTOMER_SYS_ADMIN in the CCV2 Cloud Portal.

Make sure to disable two-factor authentication when you add the S-User to your subscription!
If you enable 2FA even once, you cannot get rid of it without a support ticket.

You need to export the certificate and the key into two PEM-encoded files so they can be used for ccv2ctl (you will be prompted for the keystore password):

openssl pkcs12 -in /path/to/store.pfx -nokeys -nodes | openssl x509 -out certfile.pem
openssl pkcs12 -in /path/to/store.pfx -nocerts -nodes |  openssl rsa -out keyfile.pem
  1. Download the pre-built binary for your OS from the Github releases, rename it to ccv2ctl
  1. Put the binary somewhere on your $PATH

  2. Create the config file .ccv2ctl.yaml in your home directory with following content:

     certfile: /path/to/certfile.pem
     # Path to PEM-encoded SAP Passport client certificate
    
     keyfile: /path/to/keyfile.pem
     # Path to PEM-encoded key of SAP Passport client certificate
    
     # subscription: c0deba5ec0deba5ec0deba5ec0deba5e
     # (optional) Default subscription-ID to use for all commands. You can find the ID in the URL of the cloud portal.
     # https://portal.commerce.ondemand.com/subscription/c0deba5ec0deba5ec0deba5ec0deba5e/...
     #                                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    
     # cookiejar: /path/to/jar
     # (optional) path to HTTP cookie jar to avoid DDOSing the portal.
     # Default value: $HOME/.ccv2jar
    

    I recommend configuring the default subscription, provided you only work on a single project.

  3. Enjoy

You can provide all configuration options also on the commend line or as environment variables (prefixed with CCV2_)
Check the output of ccv2ctl help for further details.

How it works

It simulates the single-sign-on flow of the frontend using a SAP Passport client certificate.

Once we have an authenticated session, we can call the same REST APIs that the Cloud Portal uses.

Support

If you encounter any bugs or have an idea for a new feature, please submit a new issue in this repository.

Contributing

Any contributions are welcome!

Please:

  1. Fork the repository
  2. Implement and
  3. Test your changes
  4. Format the code (gofmt -l -s -w .)
  5. Open a new pull request

Developer Certificate of Origin (DCO)

Due to legal reasons, contributors will be asked to accept a DCO before they submit the first pull request to this projects, this happens in an automated fashion during the submission process. SAP uses the standard DCO text of the Linux Foundation.

commerce-ccv2ctl's People

Contributors

mpern avatar yehorov-sap avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.