GithubHelp home page GithubHelp logo

legetz / sfdx-orgdev-build-deploy Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tiagonnascimento/sfdx-orgdev-build-deploy

0.0 1.0 0.0 1.29 MB

Github Action for Salesforce DX Org Development Model Build & Deploy

License: MIT License

JavaScript 100.00%

sfdx-orgdev-build-deploy's Introduction

SFDX Org Development Model Github Action - Build & Deploy

This repository implements a Github Action that's is a variation of the Bitbucket Pipelines examples with org development.

This action is usefull to deploy to non-scratch orgs (sandbox or production) with Github Workflow.

It's a Javascript Github Action, that will once is executed will run the following steps:

  • Download and install Salesforce CLI
  • Decrypt the certificate
  • Auth in the target sandbox/org
  • Deploy/Check one or more deploy package
  • Deploy/Check destructive changes (optional)
  • Execute Data Factory Apex

Getting Started

  1. If you intent to use it, please go through the Readme of the referred repo, make sure you understand the concept and execute the Getting Started (of the referred repo) steps #4, 5, 6 and 10

  2. Also you will need to add the following Github Secrets on your github repository, that will be later used on your Github Workflow:

  • CONSUMER_KEY: holds the client_id of the connected app that you created on step #4 of the referred repo
  • USERNAME: holds the username that will be used to connect to the target org/sandbox
  • DECRYPTION_KEY: holds the Key value you generated on step #6 of the referred repo - will be used to decrypt the certificate
  • DECRYPTION_IV: holds the IV value you generated on step #6 of the referred repo - will be used to decrypt the certificate

Usage Sample

You can execute the action as per the following sample:

# Unique name for this workflow
name: On push develop - Deploy to TI01

# Definition when the workflow should run
on:
    push:
        branches:
            - develop

# Jobs to be executed
jobs:
    build-deploy:
        runs-on: ubuntu-latest
        steps:

            # Checkout the code in the pull request
            - name: 'Checkout source code'
              uses: actions/checkout@v2

            - name: 'Build and Deploy'
              uses: tiagonnascimento/sfdx-orgdev-build-deploy@v2
              with:
                type: 'sandbox'
                certificate_path: devops/server.key.enc
                decryption_key: ${{ secrets.DECRYPTION_KEY_NON_PRODUCTIVE }}
                decryption_iv: ${{ secrets.DECRYPTION_IV_NON_PRODUCTIVE }}
                client_id: ${{ secrets.CONSUMER_KEY_TI01 }}
                username: ${{ secrets.USERNAME_TI01 }}
                checkonly: false
                deploy_wait_time: '10'
                manifest_path: manifest/package-01.xml,manifest/package-02.xml,manifest/package-03.xml
                destructive_path: destructive
                data_factory: scripts/apex/CreateBaseData.apex

Inputs:

Name Requirement Description
type required Whether to deploy on production or on sandbox (default value)
certificate_path required Path on the repo where the encrypted certificate is stored
decryption_key required Decryption KEY to be used to decrypt the certificate
decryption_iv required Decryption IV to be used to decrypt the certificate
client_id required Client ID that will be used to connect into the target org/sandbox
username required Username that will be used to connect into the target org/sandbox
checkonly required Boolean value to indicate whether this action should execute the deploy or only check it, default is false, but if true it will add -c parameter on the force:mdapi:deploy commands
manifest_path required Path on the current repository to one or more package.xml that represents the packages to be deployed. Based on this files the metadata package will be created and deployed in the order specified. Ex:
deploy_testlevel optional TestLevel applied on the deploy. Default is RunLocalTests. If specified RunSpecifiedTests, the action will execute only the classes mentioned in the manifest file that contains @isTest tag
deploy_wait_time optional Wait time for deployment to finish in minutes. Default is 60
destructive_path optional Path on the repo where the destructive changes directory is - if not informed, it's not executed
data_factory optional Path on the repo where an APEX script used as a data factory is stored. if not informed, it's not executed

Note for destructives changes.

The destructive_path input is a path folder, with two files inside. For example if we have the following folder structure

  |-- config
  |-- devops
  |-- force-app
  |-- manifest
  |-- releases
    |-- 01_releases
       |-- destructive
          |-- package.xml
          |-- destructiveChanges.xml
  |-- scripts
  |-- .forceignore
  |-- .gitignore
  ...
  |-- sfdx-project.json 

The destructive_path will be releases/01_releases/destructive.

Contributing to the Repository

If you find any issues or opportunities for improving this repository, fix them! Feel free to contribute to this project by forking this repository and making changes to the content. Once you've made your changes, share them back with the community by sending a pull request. See How to send pull requests for more information about contributing to GitHub projects.

Reporting Issues

If you find any issues with this demo that you can't fix, feel free to report them in the issues section of this repository.

sfdx-orgdev-build-deploy's People

Contributors

dependabot[bot] avatar leojok-fluido avatar manuelcortes15 avatar manuelcortessf avatar tiagonnascimento avatar

Watchers

 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.