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

Update deploy_version job to additionally also deploy $MAJOR_VERSION #702

Merged
merged 3 commits into from
Apr 27, 2020

Conversation

oshi97
Copy link
Contributor

@oshi97 oshi97 commented Apr 20, 2020

When a commit is made, circle ci runs the following jobs

on non-master branches:
build
unit_test
deploy_branch

on master:
build
unit_test
hold
deploy_latest (deploys to https://assets.sitescdn.net/answers/)

on tags starting with "v":
build
unit_test
hold
deploy_version
(deploys to https://assets.sitescdn.net/answers/$MINOR_VERSION, i.e. v0.13)

This commit changes the deploy_version job to also deploy to $MAJOR_VERSION, i.e. for v0.13.3
https://assets.sitescdn.net/answers/v0/

TEST=manual
set $CIRCLE_TAG in local bash and tested that
echo "export MAJOR_VERSION="$(echo "${CIRCLE_TAG}" | cut -d '.' -f 1)""
printed out
export MAJOR_VERSION=1

@oshi97 oshi97 changed the title Update circle ci deploy to also update major version Update circle ci deploy_version to deploy major_version and circle_tag Apr 20, 2020
@oshi97 oshi97 changed the title Update circle ci deploy_version to deploy major_version and circle_tag Update deploy_version job to deploy major_version and circle_tag Apr 20, 2020
Copy link
Contributor

@nbramblett nbramblett left a comment

Choose a reason for hiding this comment

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

Shell script is a pain to read/debug, but as far as I can tell this is correct.

@nbramblett
Copy link
Contributor

nbramblett commented Apr 20, 2020

Could you quickly verify that v0.x is correctly tagged as well? (just to confirm that minor version is still ok)

@oshi97
Copy link
Contributor Author

oshi97 commented Apr 20, 2020

Could you quickly verify that v0.x is correctly tagged as well? (just to confirm that minor version is still ok)

minor version should still work, since it hasn't been touched and has been working (see https://assets.sitescdn.net/answers/v0.13/answers.min.js)

@oshi97
Copy link
Contributor Author

oshi97 commented Apr 20, 2020

holding off on merging until we decide exactly what we want the cdn behavior to be

@oshi97 oshi97 changed the title Update deploy_version job to deploy major_version and circle_tag Update deploy_version job to additionally also deploy major_version Apr 24, 2020
@oshi97 oshi97 changed the title Update deploy_version job to additionally also deploy major_version Update deploy_version job to additionally also deploy $MAJOR_VERSION Apr 24, 2020
@oshi97 oshi97 changed the base branch from v0.13.3 to v1.0.0 April 24, 2020 23:01
Copy link
Collaborator

@tmeyer2115 tmeyer2115 left a comment

Choose a reason for hiding this comment

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

I think we should confirm desired behavior with @bryanreed. To confirm, with this change we have folders for every major version and one for every ${MAJOR}.${MINOR} permutation? So we'll have branches like: /v0/ and /v0.13/? I think it would be more straightforward to have directories structured like:

${MAJOR}/${MINOR}

So we'd have /v0/, /v0/12, /v0/13, etc. If you pointed only to /v0/answers.js, you'd get the answers.js for the most recent minor version. Additionally, we'll need to consider patches/hot-fixes here. I think that would look like:

${MAJOR}/${MINOR}/${HOTFIX}

If you only specified ${MAJOR}/${MINOR} in your CDN URL, you'd get the resources from that minor version's most recent patch. Were we maintaining a flat directory structure (top-level folders for /v0/ and /v0.13/) for backwards compatibility reasons? Let's chat with Bryan and make sure we're all on the same page about what the CDN folders should look like.

@tmeyer2115 tmeyer2115 self-requested a review April 27, 2020 20:47
@oshi97 oshi97 changed the base branch from v1.0.0 to v1.0.1 April 27, 2020 20:49
When deploying a tagged commit, also create and override the major version
for that commit.

TEST=manual
set $CIRCLE_TAG in local bash and tested that was able to export $MAJOR_VERSION
@oshi97 oshi97 force-pushed the major-minor-version-deploy branch from a86b1e2 to 985081c Compare April 27, 2020 20:51
@oshi97 oshi97 merged commit 5fc7601 into v1.0.1 Apr 27, 2020
@oshi97 oshi97 deleted the major-minor-version-deploy branch April 27, 2020 20:51
tmeyer2115 pushed a commit that referenced this pull request Apr 27, 2020
…702)

* Update circle ci deploy to also update major version

When deploying a tagged commit, also create and override the major version
for that commit. In other words previously we only stored v1.0 and v1.0.0, now also store v1

TEST=manual
set $CIRCLE_TAG in local bash and tested that was able to export $MAJOR_VERSION
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants