Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Actually automate network template to mezzanine network-api deploys #115

Closed
Pomax opened this issue Apr 10, 2017 · 5 comments
Closed

Actually automate network template to mezzanine network-api deploys #115

Pomax opened this issue Apr 10, 2017 · 5 comments
Assignees

Comments

@Pomax
Copy link
Contributor

Pomax commented Apr 10, 2017

We finished the autogeneration step in the network repo, so we'll have to figure out the automation step that kicks in on a build to copy over any new template generated to mezzanine. Ideally only when the diff says there's a difference, but it won't hurt to just blinding copy it due to its small size.

@Pomax Pomax added this to the April 21, 2017 milestone Apr 10, 2017
@simonwex simonwex modified the milestone: April 21, 2017 Apr 13, 2017
@Pomax Pomax added this to the April 21, 2017 milestone Apr 13, 2017
@simonwex
Copy link
Contributor

From @cadecairos:

  • When we merge into master on network repo
  • Trigger staging build on jenkins
  • Add post-build step to jenkins that commits file directly to github repo

@cadecairos
Copy link
Contributor

This is complete.

I've set this up like so:

  1. A staging build of the network site completes, the generated template file is archived in the build's folder.
  2. A new job (copy-network-templates-to-mezzanine) is set up to watch for completed builds of "Network (staging)" and begins executing.
  3. It copies the archived template file from $JENKINS_HOME/jobs/Network (staging)/builds/lastStableBuild/archive into the workspace (which is a clean version of network-api@master)
  4. It commits the change.
  5. The master branch in the workspace is pushed to mozilla/network-api@master

@cadecairos
Copy link
Contributor

One thing to note: The build is being marked as failed if there aren't any changes to commit... I'm investigating whether this can be worked around.

@cadecairos
Copy link
Contributor

Fixed this by adding set +e to the top of the shell script step, so that it doesn't bail at the first non-zero exit code.

I separated the commit from the copy, so that if the copy fails, the build will fail. It's okay if we don't have anything to commit.

@cadecairos
Copy link
Contributor

marking this resolved.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants