Gray Wolf Blog

In a recent Adobe Experience Manager project, there were multiple security restrictions with access, so we enabled a repository for each team to work on the project and enable every organization to manage the permissions.

Additionaly, in AEM as a Cloud Service, there is also a Cloud Manager repository that needs to be kept in sync to trigger the deployment to the managed instances.

We used a continuous integration pipeline to ensure the code repositories were in sync. Below is a diagram with the workflow that was implemented:

To make it work we enabled bitbucket pipelines, configured the repository variables and updated the content of the bitbucket-pipelines.yml file:

image: atlassian/default-image:3

definitions:
  steps:
    - step: &sync-remote-adobe
        name: Push to Adobe Experience cloud
        script:
          - if [[ $ADOBE_CM_GIT_SLUG ]]; then
          - git remote add adobe https://$ADOBE_CM_USERNAME:$ADOBE_CM_PASSWORD@git.cloudmanager.adobe.com/$ADOBE_CM_GIT_SLUG
          - git pull adobe $BITBUCKET_BRANCH --tags
          - git push adobe $BITBUCKET_BRANCH --tags
          - else
          - echo "Step skipped, ADOBE_CM_GIT_SLUG variable not configured"
          - fi

    - step: &push-bitbucket-mirror
        name: Push to Bitbucket Mirror
        script:
          - if [[ $MIRROR_GIT_SLUG ]]; then
          - git remote add mirror https://x-token-auth:$MIRROR_TOKEN@bitbucket.org/$MIRROR_GIT_SLUG
          - git push mirror $BITBUCKET_BRANCH --tags
          - else
          - echo "Step skipped, MIRROR_GIT_SLUG variable not configured"
          - fi

pipelines:
    branches:
      develop:
        - step: *push-bitbucket-mirror
        - step: *sync-remote-adobe
      master:
        - step: *push-bitbucket-mirror
        - step: *sync-remote-adobe

Bonus: Sync repositories using github actions

If you’re looking on how to keep different repositories in sync but and the repositories are hosted on github, you can use the mirror-repository action.

Below is a template to configure it with only 2 steps:

1. Commit a file with the configuration:

.github/workflows/mirror-repo-sync.yml

on:
  push:
    branches:
      - develop

jobs:
  sync_to_mirror:
    runs-on: ubuntu-20.04
    steps:

    steps:
      - uses: actions/checkout@v3
        with:
          fetch-depth: 0
      - uses: yesolutions/mirror-action@master
        with:
          REMOTE: ${{ secrets.GIT_REPO }}
          GIT_USERNAME: ${{ secrets.GIT_USERNAME }}
          GIT_PASSWORD: ${{ secrets.GIT_PASSWORD }}

2. Create the secrets in the settings screen:

Over the last few months our AWS cost had been going up, so we created a plan to optimize our spening as much as possible.

After implementing the optimization plan, we were able to reduce our spending by 80%.

Here is a summary of the steps we took to get there:

  1. Created a directory of all the resources and how they were being used.

  2. Added tags to those resources to identify environment (dev, qa, prod) and the project name.

  3. We used the Billing & Cost Management Console to identify areas of opportunity.

  4. Created a projecy plan with specific tasks and owners and kept track of the progress.

  5. Repeated steps 3-4 until we reached an acceptable threshold.

Some examples of the actions that we took:

  • Simplifying architecture to remove unnecessary elements,
  • Down size EC2 instances with low utilization.
  • Consolidate compute resources to increase instance usage.
  • Created and scheduled lambda functions to auto-stop EC2 instances during off-hours.
  • Setup alerts & budgets to be more efficient moving forward.

If you are using EC2 instances, the first thing you can try is AWS Cost Explorer rightzising recommendations to help you identify opportunities to downsize or terminate instances that are being underutilized to reduce costs.

Below is a recommendation example I got to modify an instance:

To enable rightsizing recommendations

  1. Open the AWS Cost Management at https://console.aws.amazon.com/cost-management/home

  2. In the navigation pane, choose Preferences.

  3. In the Recommendations section, choose Receive Amazon EC2 resource recommendations.

  4. Choose Save preferences.

To access rightsizing recommendations

  1. Sign in to the AWS Management Console and open the AWS Cost Management console at https://console.aws.amazon.com/cost-management/home

  2. In the navigation pane, choose Rightsizing recommendations.