.yaml files from Dreamforce 16

In the presentation you mention you'll add all the Pipelines .yaml files, but I don't see them in the cookbook.

Can you share where I can find those?

2 answers

I can post ours. Perhaps it will help. Obviously you may have some differences. For instance, we have some code to handle dependencies (fflib_apexmocks and fflib_apexcommon). You'll have to remove those lines if you don't use those libraries or switch them to the standard repo if you do, as we use our own fork. We are actually using our own docker image as well, because I wanted some newer ant functionality that wasn't available in the version that was being used in Mark's image. You're welcome to use it but if you want to go back to the base just replace "omnifinancial/salesforce" with mklinski/salesforce" on the second line.

For what it's worth, here ya go.

image:
  name: omnifinancial/salesforce
pipelines:
  branches:
    feature/*:
      - step:
          script:
            # Set up SSH key; follow instructions at https://confluence.atlassian.com/display/BITBUCKET/Set+up+SSH+for+Bitbucket+Pipelines
            - (mkdir -p ~/.ssh ; cat my_known_hosts >> ~/.ssh/known_hosts; umask  077 ; echo $SSH_KEY | base64 -d > ~/.ssh/id_rsa)
            # Set up fflib-apex-mocks repo and checkout master
            - git clone git@github.com:$BITBUCKET_REPO_OWNER/fflib-apex-mocks.git fflib-apex-mocks
            # Set up fflib-apex-common repo and checkout master
            #- git clone git@github.com:$BITBUCKET_REPO_OWNER/fflib-apex-common.git fflib-apex-common
            # Send metadata to server
            - ant -buildfile build/build.xml testCode -Dsfdc.username=$SFDC_USERNAME$SFDC_USERNAME_SUFFIX_DEV -Dsfdc.password=$SFDC_PASS$SFDC_TOKEN_DEV -Dsfdc.serverurl=https://$SFDC_SERVERURL -DrunTests=on -DnoDepend=on
    bug/*:
      - step:
          script:
            # Set up SSH key; follow instructions at https://confluence.atlassian.com/display/BITBUCKET/Set+up+SSH+for+Bitbucket+Pipelines
            - (mkdir -p ~/.ssh ; cat my_known_hosts >> ~/.ssh/known_hosts; umask  077 ; echo $SSH_KEY | base64 -d > ~/.ssh/id_rsa)
            # Set up fflib-apex-mocks repo and checkout master
            - git clone git@github.com:$BITBUCKET_REPO_OWNER/fflib-apex-mocks.git fflib-apex-mocks
            # Set up fflib-apex-common repo and checkout master
            - git clone git@github.com:$BITBUCKET_REPO_OWNER/fflib-apex-common.git fflib-apex-common
            # Send metadata to server
            - ant -buildfile build/build.xml testCode -Dsfdc.username=$SFDC_USERNAME$SFDC_USERNAME_SUFFIX_TEST -Dsfdc.password=$SFDC_PASS$SFDC_TOKEN_TEST -Dsfdc.serverurl=https://$SFDC_SERVERURL -DrunTests=on -DnoDepend=on
    hotfix/*:
      - step:
          script:
            # Set up SSH key; follow instructions at https://confluence.atlassian.com/display/BITBUCKET/Set+up+SSH+for+Bitbucket+Pipelines
            - (mkdir -p ~/.ssh ; cat my_known_hosts >> ~/.ssh/known_hosts; umask  077 ; echo $SSH_KEY | base64 -d > ~/.ssh/id_rsa)
            # Set up fflib-apex-mocks repo and checkout master
            - git clone git@github.com:$BITBUCKET_REPO_OWNER/fflib-apex-mocks.git fflib-apex-mocks
            # Set up fflib-apex-common repo and checkout master
            #- git clone git@github.com:$BITBUCKET_REPO_OWNER/fflib-apex-common.git fflib-apex-common
            # Send metadata to server
            - ant -buildfile build/build.xml testCode -Dsfdc.username=$SFDC_USERNAME -Dsfdc.password=$SFDC_PASS$SFDC_TOKEN_PROD -Dsfdc.serverurl=https://$SFDC_SERVERURL_PROD -DrunTests=on -DnoDepend=on
    master:
      - step:
          script:
            # Set up SSH key; follow instructions at https://confluence.atlassian.com/display/BITBUCKET/Set+up+SSH+for+Bitbucket+Pipelines
            - (mkdir -p ~/.ssh ; cat my_known_hosts >> ~/.ssh/known_hosts; umask  077 ; echo $SSH_KEY | base64 -d > ~/.ssh/id_rsa)
            # Set up fflib-apex-mocks repo and checkout master
            - git clone git@github.com:$BITBUCKET_REPO_OWNER/fflib-apex-mocks.git fflib-apex-mocks
            # Set up fflib-apex-common repo and checkout master
            - git clone git@github.com:$BITBUCKET_REPO_OWNER/fflib-apex-common.git fflib-apex-common
            # Send metadata to server
            - ant -buildfile build/build.xml deployCode -Dsfdc.username=$SFDC_USERNAME -Dsfdc.password=$SFDC_PASS$SFDC_TOKEN_PROD -Dsfdc.serverurl=https://$SFDC_SERVERURL_PROD -DrunTests=on -DnoDepend=off
    test:
      - step:
          script:
            # Set up SSH key; follow instructions at https://confluence.atlassian.com/display/BITBUCKET/Set+up+SSH+for+Bitbucket+Pipelines
            - (mkdir -p ~/.ssh ; cat my_known_hosts >> ~/.ssh/known_hosts; umask  077 ; echo $SSH_KEY | base64 -d > ~/.ssh/id_rsa)
            # Set up fflib-apex-mocks repo and checkout master
            - git clone git@github.com:$BITBUCKET_REPO_OWNER/fflib-apex-mocks.git fflib-apex-mocks
            # Set up fflib-apex-common repo and checkout master
            - git clone git@github.com:$BITBUCKET_REPO_OWNER/fflib-apex-common.git fflib-apex-common
            # Send metadata to server
            - ant -buildfile build/build.xml deployCode -Dsfdc.username=$SFDC_USERNAME$SFDC_USERNAME_SUFFIX_TEST -Dsfdc.password=$SFDC_PASS$SFDC_TOKEN_TEST -Dsfdc.serverurl=https://$SFDC_SERVERURL -DrunTests=on -DnoDepend=off
    dev:
      - step:
          script:
            # Set up SSH key; follow instructions at https://confluence.atlassian.com/display/BITBUCKET/Set+up+SSH+for+Bitbucket+Pipelines
            - (mkdir -p ~/.ssh ; cat my_known_hosts >> ~/.ssh/known_hosts; umask  077 ; echo $SSH_KEY | base64 -d > ~/.ssh/id_rsa)
            # Set up fflib-apex-mocks repo and checkout master
            - git clone git@github.com:$BITBUCKET_REPO_OWNER/fflib-apex-mocks.git fflib-apex-mocks
            # Set up fflib-apex-common repo and checkout master
            - git clone git@github.com:$BITBUCKET_REPO_OWNER/fflib-apex-common.git fflib-apex-common
            # Send metadata to server
            - ant -buildfile build/build.xml deployCode -Dsfdc.username=$SFDC_USERNAME$SFDC_USERNAME_SUFFIX_DEV -Dsfdc.password=$SFDC_PASS$SFDC_TOKEN_DEV -Dsfdc.serverurl=https://$SFDC_SERVERURL -DrunTests=on -DnoDepend=off
    prod-changes:
      - step:
          script:
            # Set up SSH key; follow instructions at https://confluence.atlassian.com/display/BITBUCKET/Set+up+SSH+for+Bitbucket+Pipelines
            - (mkdir -p ~/.ssh ; cat my_known_hosts >> ~/.ssh/known_hosts; umask  077 ; echo $SSH_KEY | base64 -d > ~/.ssh/id_rsa)
            # Read update_to_trigger_pipelines.txt into commitmsg variable
            - commitmsg="$(<update_to_trigger_pipelines.txt)"
            # Set up repo and checkout master
            - git remote set-url origin git@bitbucket.org:$BITBUCKET_REPO_OWNER/$BITBUCKET_REPO_SLUG.git
            - git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/*
            - git fetch
            - git checkout master
            # Get metadata from server
            - ant -buildfile build/build.xml getCode -Dsfdc.username=$SFDC_USERNAME -Dsfdc.password=$SFDC_PASS$SFDC_TOKEN_PROD -Dsfdc.serverurl=https://$SFDC_SERVERURL_PROD
            # Commit any changes to master
            - git add src/*
            - git config user.name "$GIT_USERNAME"
            - git config user.email "$GIT_EMAIL"
            - if [[ -n $(git status -s) ]] ; then filelist=`git status -s` ; git commit -a -m "$commitmsg" -m "$filelist" ; git push origin master:master ; else echo "No changes detected"; fi
    test-changes:
      - step:
          script:
            # Set up SSH key; follow instructions at https://confluence.atlassian.com/display/BITBUCKET/Set+up+SSH+for+Bitbucket+Pipelines
            - (mkdir -p ~/.ssh ; cat my_known_hosts >> ~/.ssh/known_hosts; umask  077 ; echo $SSH_KEY | base64 -d > ~/.ssh/id_rsa)
            # Read update_to_trigger_pipelines.txt into commitmsg variable
            - commitmsg="$(<update_to_trigger_pipelines.txt)"
            # Set up repo and checkout master
            - git remote set-url origin git@bitbucket.org:$BITBUCKET_REPO_OWNER/$BITBUCKET_REPO_SLUG.git
            - git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/*
            - git fetch
            - git checkout test
            # Get metadata from server
            - ant -buildfile build/build.xml getCode -Dsfdc.username=$SFDC_USERNAME$SFDC_USERNAME_SUFFIX_TEST -Dsfdc.password=$SFDC_PASS$SFDC_TOKEN_TEST -Dsfdc.serverurl=https://$SFDC_SERVERURL
            # Commit any changes to master
            - git add src/*
            - git config user.name "$GIT_USERNAME"
            - git config user.email "$GIT_EMAIL"
            - if [[ -n $(git status -s) ]] ; then filelist=`git status -s` ; git commit -a -m "$commitmsg" -m "$filelist" ; git push origin test:test ; else echo "No changes detected"; fi
    dev-changes:
      - step:
          script:
            # Set up SSH key; follow instructions at https://confluence.atlassian.com/display/BITBUCKET/Set+up+SSH+for+Bitbucket+Pipelines
            - (mkdir -p ~/.ssh ; cat my_known_hosts >> ~/.ssh/known_hosts; umask  077 ; echo $SSH_KEY | base64 -d > ~/.ssh/id_rsa)
            # Read update_to_trigger_pipelines.txt into commitmsg variable
            - commitmsg="$(<update_to_trigger_pipelines.txt)"
            # Set up repo and checkout master
            - git remote set-url origin git@bitbucket.org:$BITBUCKET_REPO_OWNER/$BITBUCKET_REPO_SLUG.git
            - git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/*
            - git fetch
            - git checkout dev
            # Get metadata from server
            - ant -buildfile build/build.xml getCode -Dsfdc.username=$SFDC_USERNAME$SFDC_USERNAME_SUFFIX_DEV -Dsfdc.password=$SFDC_PASS$SFDC_TOKEN_DEV -Dsfdc.serverurl=https://$SFDC_SERVERURL
            # Commit any changes to master
            - git add src/*
            - git config user.name "$GIT_USERNAME"
            - git config user.email "$GIT_EMAIL"
            - if [[ -n $(git status -s) ]] ; then filelist=`git status -s` ; git commit -a -m "$commitmsg" -m "$filelist" ; git push origin dev:dev ; else echo "No changes detected"; fi
    prod-destroy/*:
      - step:
          script:
            # Run Destructive Changes
            - ant -buildfile build/build.xml undeployCode -Dsfdc.username=$SFDC_USERNAME -Dsfdc.password=$SFDC_PASS$SFDC_TOKEN_PROD -Dsfdc.serverurl=https://$SFDC_SERVERURL_PROD
            # Update metadata; should be the same as the save-changes Pipeline
            # Set up SSH key; follow instructions at https://confluence.atlassian.com/display/BITBUCKET/Set+up+SSH+for+Bitbucket+Pipelines
            - (mkdir -p ~/.ssh ; cat my_known_hosts >> ~/.ssh/known_hosts; umask  077 ; echo $SSH_KEY | base64 -d > ~/.ssh/id_rsa)
            # Use last commit message as the commit message for master
            - commitmsg="$(git log -1 --pretty=%B)"
            # Set up repo and checkout master
            - git remote set-url origin git@bitbucket.org:$BITBUCKET_REPO_OWNER/$BITBUCKET_REPO_SLUG.git
            - git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/*
            - git fetch
            - git checkout master
            # Get metadata from server
            - ant -buildfile build/build.xml getCode -Dsfdc.username=$SFDC_USERNAME -Dsfdc.password=$SFDC_PASS$SFDC_TOKEN_PROD -Dsfdc.serverurl=https://$SFDC_SERVERURL_PROD
            # Commit any changes to master
            - git add src/*
            - git config user.name "$GIT_USERNAME"
            - git config user.email "$GIT_EMAIL"
            - if [[ -n $(git status -s) ]] ; then filelist=`git status -s` ; git commit -a -m "$commitmsg" -m "$filelist" ; git push origin master:master ; else echo "No changes detected"; fi
    test-destroy/*:
      - step:
          script:
            # Run Destructive Changes
            - ant -buildfile build/build.xml undeployCode -Dsfdc.username=$SFDC_USERNAME$SFDC_USERNAME_SUFFIX_TEST -Dsfdc.password=$SFDC_PASS$SFDC_TOKEN_TEST -Dsfdc.serverurl=https://$SFDC_SERVERURL
            # Update metadata; should be the same as the save-changes Pipeline
            # Set up SSH key; follow instructions at https://confluence.atlassian.com/display/BITBUCKET/Set+up+SSH+for+Bitbucket+Pipelines
            - (mkdir -p ~/.ssh ; cat my_known_hosts >> ~/.ssh/known_hosts; umask  077 ; echo $SSH_KEY | base64 -d > ~/.ssh/id_rsa)
            # Use last commit message as the commit message for master
            - commitmsg="$(git log -1 --pretty=%B)"
            # Set up repo and checkout master
            - git remote set-url origin git@bitbucket.org:$BITBUCKET_REPO_OWNER/$BITBUCKET_REPO_SLUG.git
            - git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/*
            - git fetch
            - git checkout test
            # Get metadata from server
            - ant -buildfile build/build.xml getCode -Dsfdc.username=$SFDC_USERNAME$SFDC_USERNAME_SUFFIX_TEST -Dsfdc.password=$SFDC_PASS$SFDC_TOKEN_TEST -Dsfdc.serverurl=https://$SFDC_SERVERURL
            # Commit any changes to master
            - git add src/*
            - git config user.name "$GIT_USERNAME"
            - git config user.email "$GIT_EMAIL"
            - if [[ -n $(git status -s) ]] ; then filelist=`git status -s` ; git commit -a -m "$commitmsg" -m "$filelist" ; git push origin test:test ; else echo "No changes detected"; fi
    dev-destroy/*:
      - step:
          script:
            # Run Destructive Changes
            - ant -buildfile build/build.xml undeployCode -Dsfdc.username=$SFDC_USERNAME$SFDC_USERNAME_SUFFIX_DEV -Dsfdc.password=$SFDC_PASS$SFDC_TOKEN_DEV -Dsfdc.serverurl=https://$SFDC_SERVERURL
            # Update metadata; should be the same as the save-changes Pipeline
            # Set up SSH key; follow instructions at https://confluence.atlassian.com/display/BITBUCKET/Set+up+SSH+for+Bitbucket+Pipelines
            - (mkdir -p ~/.ssh ; cat my_known_hosts >> ~/.ssh/known_hosts; umask  077 ; echo $SSH_KEY | base64 -d > ~/.ssh/id_rsa)
            # Use last commit message as the commit message for master
            - commitmsg="$(git log -1 --pretty=%B)"
            # Set up repo and checkout master
            - git remote set-url origin git@bitbucket.org:$BITBUCKET_REPO_OWNER/$BITBUCKET_REPO_SLUG.git
            - git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/*
            - git fetch
            - git checkout dev
            # Get metadata from server
            - ant -buildfile build/build.xml getCode -Dsfdc.username=$SFDC_USERNAME$SFDC_USERNAME_SUFFIX_DEV -Dsfdc.password=$SFDC_PASS$SFDC_TOKEN_DEV -Dsfdc.serverurl=https://$SFDC_SERVERURL
            # Commit any changes to master
            - git add src/*
            - git config user.name "$GIT_USERNAME"
            - git config user.email "$GIT_EMAIL"
            - if [[ -n $(git status -s) ]] ; then filelist=`git status -s` ; git commit -a -m "$commitmsg" -m "$filelist" ; git push origin dev:dev ; else echo "No changes detected"; fi

Now that I look back at it, I realize there are a couple of ant parameters we are using that would not to be in there either. So, you can remove the -DnoDepend and -DrunTests bits as well.

They just give us an easy way to tell ant to deploy dependencies or not and run org tests or not.

Hi Darrin!

Mark Klinskiposted this stub repo: bitbucket.org/mklinski/salesforce-bitbucket-pipelines, which has the yaml files. 

 

The link is no longer valid. Did it move?

Suggest an answer

Log in or Join to answer
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

716 views 0 4
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot