Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Promoting Code from Lower Environment to Higher Environment in a Headless CI/CD Setup #13368

Closed
rohit3d2003 opened this issue Oct 26, 2023 · 5 comments
Labels
headless Headless mode for CI/CD pending-response Issue is pending response from the issue author pending-triage Issue is pending triage question General question

Comments

@rohit3d2003
Copy link

rohit3d2003 commented Oct 26, 2023

Amplify CLI Version

5.6.1

Question

I'm facing challenges in establishing the correct sequence of steps for promoting code from a lower environment to a higher environment in a headless CI/CD setup. To provide context, here's what I've attempted and the issues encountered:

Steps Taken:

  • Created a development (dev) environment on Amplify using CLI commands and successfully deployed it.
  • Integrated authentication methods (email, Google, and Apple), a database (DB), storage, and a GraphQL API into the dev environment.
  • Using CLI commands, I created another environment called 'main'. During this setup, I was prompted to enter authentication-related settings (IDs and secrets), but Amplify did not yet contain any auth settings. Instead, only the team-provider-info.json had an entry for the 'main' environment.
  • Attempted to implement a CI/CD pipeline for automatic code promotion.
  • For the dev environment, I'm only pulling the Amplify configuration before creating an artifact, which I believe is the correct approach.
  • For the 'main' environment, my understanding is that I should first switch to the 'main' environment and then push the changes, expecting it to automatically include all the configurations from the dev environment.

Issues Encountered:

  1. Initially, I tried changing the configuration to point to the 'main' environment using the 'amplify configure project' command, but this didn't work as expected.
  2. I attempted to use 'amplify init', but it asked for authentication configurations again, resulting in the error message, "auth headless is missing the following input parameters: googleAppIdUserPool, googleAppSecretUserPool." I'm unsure how to specify these settings in addition to the existing Apple and email-based configurations.

Questions:

  1. Is the approach I've outlined the correct one for my objectives? My goal is for developers to make changes in the 'dev' environment from their local workstations using the Amplify CLI, which should deploy changes to the 'dev' environment. When a pull request is merged from 'dev' to 'main', I want the CI/CD pipeline to automatically deploy all the changes configured in the 'dev' environment to the 'main' environment, assuming that all settings (auth, storage, etc.) remain the same between these environments.
  2. Can you please guide me through the proper steps and provide sample code to achieve this objective?

Your insights and assistance are highly appreciated. Thank you.

@rohit3d2003 rohit3d2003 added pending-triage Issue is pending triage question General question labels Oct 26, 2023
@josefaidt
Copy link
Contributor

Hey @rohit3d2003 👋 thanks for raising this! Out of curiosity what CI/CD solution are you using? Merging changes via PR's is enough to initialize the project in the runner for the "main" environment and push like normal. Please keep in mind some of the metadata for this env are captured after a successful push. If this is your first time pushing to this "main" env you will likely want to commit this back to your repo

@josefaidt josefaidt added pending-response Issue is pending response from the issue author headless Headless mode for CI/CD labels Oct 26, 2023
@rohit3d2003
Copy link
Author

@josefaidt - I am using CogeMagic for CI/CD. I did notice that some metadata got added after a successful local workstation based push to 'main'. What should I include in the CI/CD toolchain when PR is merged? Amplify init, amplify pull, amplify push?

@github-actions github-actions bot removed the pending-response Issue is pending response from the issue author label Oct 26, 2023
@josefaidt
Copy link
Contributor

Hey @rohit3d2003 you should be able to run either init or pull in your CI/CD to initialize the project in the runner, then push

@josefaidt josefaidt added the pending-response Issue is pending response from the issue author label Oct 31, 2023
@josefaidt
Copy link
Contributor

Closing due to inactivity

@josefaidt josefaidt closed this as not planned Won't fix, can't repro, duplicate, stale Feb 2, 2024
Copy link

github-actions bot commented Feb 2, 2024

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
headless Headless mode for CI/CD pending-response Issue is pending response from the issue author pending-triage Issue is pending triage question General question
Projects
None yet
Development

No branches or pull requests

2 participants