Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

.yaml files from Dreamforce 16

Derwood February 23, 2017

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

0 votes
Melanie Wright
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 24, 2017

Hi Darrin!

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

 

Binh Do April 21, 2017

The link is no longer valid. Did it move?

0 votes
Tory Netherton February 24, 2017

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
Tory Netherton February 24, 2017

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.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events