-
Notifications
You must be signed in to change notification settings - Fork 70
Backup install directory #123
Backup install directory #123
Conversation
What I Did ------------ Fixed an issue with un-tarring certain assets when running ship multiple time consecutively. How I Did it ------------ Have `render` step back up any existing installation directory before executing a plan. This happens after the plan is built. How to verify it ------------ Run ship multiple times in the same directory. You should see `installer.XXXXX.bak` and `installer` directories Description for the Changelog ------------ If ship is run twice from the same directory, any previous asset directories generated at `installer/` will be backed up to `installer.TIMESTAMP.bak/` ![](https://rnli.org/-/media/rnli/images/findmynearest/lifeboatstation/42941-helvick-head-b-class-atlantic-85-lifeboat-nicholas-leach-16x9.jpg?w=920&h=518&hash=CCD7B3207D66F21E474634A9CD6484C81743E884)
Code Climate has analyzed commit 5689e93 and detected 0 issues on this pull request. The test coverage on the diff in this pull request is 40.0% (50% is the threshold). This pull request will bring the total coverage in the repository to 48.5% (-0.2% change). View more on Code Climate. |
Gopkg.toml
Outdated
@@ -22,6 +22,7 @@ | |||
[prune] | |||
go-tests = true | |||
unused-packages = true | |||
non-go = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would not be surprised if this broke things
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unit and integration tests pass. it seems to have removed a lot of readmes and test fixtures. Gonna see if I can get things running without this though.
@@ -0,0 +1,3 @@ | |||
package constants | |||
|
|||
const InstallerPrefix = "installer" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we move all the other constants here eventually?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think yes, this was an experiment
@@ -102,3 +114,21 @@ func (r *Renderer) Execute(ctx context.Context, release *api.Release, step *api. | |||
|
|||
return nil | |||
} | |||
|
|||
func (r *Renderer) backupIfPresent(basePath string) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd feel a little better with a unit test for this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good call.
What I Did
Fixed an issue with un-tarring certain assets when running ship multiple time consecutively.
How I Did it
Have
render
step back up any existing installation directory before executing a plan. This happens after the plan is built.How to verify it
Run ship multiple times in the same directory. You should see
installer.XXXXX.bak
andinstaller
directoriesDescription for the Changelog
If ship is run twice from the same directory, any previous asset directories generated at
installer/
will be backed up toinstaller.TIMESTAMP.bak/