Need help with Elastic Beanstalk / git connection

0

good afternoon, we inherited a project involving Elastic Beanstalk connection with Github.

the git repo has a workflow that contains code to push to AWS, but I'm not clear if Elastic Beanstalk is "reaching into" github to pull changes or if the workflow is pushing from git to AWS. i know that there is an EB widget that you can install in github so you don't use workflows anymore, but the repo was moved to a different org so I don't have past logs, and I can't see logs in AWS that tell me how it works.

So really its an EB 101, how can I tell how the git / EB connection works? where do i look to see what the flow is?

thanks

John Mott CTO Surgepays.com

asked 9 months ago203 views
1 Answer
0

Hi John! You might as well write a workflow. Here's what mine looks like:

      - name: Generate deployment package
        run: zip -r deploy.zip . -x '*.git*'

      - name: Get Last Commit Hash
        id: last_commit_hash
        run: echo "hash=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT

      - name: Deploy to EB
        uses: einaregilsson/beanstalk-deploy@v21
        timeout-minutes: 5
        with:
          aws_access_key: ${{ secrets.AWS_ACCESS_KEY_ID }}
          aws_secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
          application_name: MYAPP
          environment_name: MYENV
          version_label: app-${{ steps.last_commit_hash.outputs.hash }}
          region: my-eb-region
          deployment_package: deploy.zip

I use the commit hash for the label but you can use tags, or whatever you like. You can check out the einaregilsson/beanstalk-deploy action documentation if you need more info.

Mickael
answered 9 months ago
  • thank you, there is already a work flow, but its not clear to me if its running or not. The repo was moved so that keys were lost. Is there a way that I can tell by looking at EB logs whether or not the EB github gadget had been installed on the old repo? If it weren't for this new gadget it would be clear but now i'm not certain whether or not the workflow is working or not.

  • When a deployment occurs on your environment, it's hard to miss. You'll see a bunch of events, and if the deployment is successful, you should see this: https://i.imgur.com/Du3EVpS.png If you're not seeing any new events, then nothing is active. As for whether the Github App is installed at all, there's no way to know if it's not being used, as this is something happening on Github's side.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions