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

refactor pipeline for share source code sequentially for each stage #48

Merged
merged 17 commits into from
Oct 17, 2024

Conversation

raylrui
Copy link
Contributor

@raylrui raylrui commented Oct 9, 2024

No description provided.

@raylrui raylrui added the feature New feature or request label Oct 9, 2024
@raylrui raylrui self-assigned this Oct 9, 2024
@raylrui raylrui marked this pull request as ready for review October 9, 2024 12:29
@raylrui
Copy link
Contributor Author

raylrui commented Oct 9, 2024

Refer: #45 (comment)
our previous logic can not handle asset consistency issue when deploy lag behind of code commit, new logic will use cross-account bucket to share the source artefacts sequentially
image

Copy link
Member

@williamputraintan williamputraintan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this could work too, but I think #29 still stands for a cleaner approach.

I suppose this chains assets between the stage deployment, so each stage relies heavily on the previous stage deploy.

commands: ['node -v', 'corepack enable', 'yarn --version', 'yarn install --immutable'],
commands: [
'aws s3 rm s3://${VITE_BUCKET_NAME}/ --recursive',
'aws s3 sync ./ s3://${VITE_BUCKET_NAME}/${SOURCE_BUCKET_ARTIFACT_PATH} --dryrun',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose the --dryrun flag should be gone?

Copy link
Contributor Author

@raylrui raylrui Oct 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--dryrun can be removed.

For 'chains assets between the stage deployment', it will keep what we want, just deploy what we have in the last stage.

I am thinking if we just use the deployment in bastion, we still need to face the problem, which version of code we need retrieve? as we alway just retrieve the code from the "latest context" and build the original atrtifact for each stage. I am not find a proper way to have commit SHA in the checking out codestar source code, only from github link or use lambda. I will keep checking...
So I am think kind of store each stage artifact in each stage bucket and keep the version we have in the previous stage...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the build is in the bastion account and deployed to its respective (cloudfront) bucket, it could use the same source artifact for each stage deployment within the code pipeline trigger (commit). I suppose code pipeline will keep its artifact version for each trigger.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, if we are in one pipeline, sure, because there will always be a new build if new commit come in to trigger the build. but the bucket not. So I am think use that artifacts bucket
Later, I will refactor it again to fit it in the one pipeline in the bastion account.

Copy link
Member

@williamputraintan williamputraintan Oct 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we are in one pipeline,

We are only using one pipeline right?

but the bucket not.

What do you mean the bucket is not? What I had in mind is for every stage the build should source from the artifact (github commit) that trigger the pipeline, build the React and send it off to its respective cf (deployment) bucket.

@raylrui raylrui marked this pull request as draft October 10, 2024 04:02
@raylrui raylrui marked this pull request as ready for review October 17, 2024 05:58
@raylrui
Copy link
Contributor Author

raylrui commented Oct 17, 2024

merge now, for new pipeline testing .......

@raylrui raylrui merged commit 62a7837 into main Oct 17, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants