Skip to content
This repository has been archived by the owner on Mar 24, 2023. It is now read-only.

Backup install directory #123

Merged
merged 2 commits into from
Jun 21, 2018
Merged

Backup install directory #123

merged 2 commits into from
Jun 21, 2018

Conversation

dexhorthy
Copy link
Member

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/

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)
@dexhorthy dexhorthy requested a review from laverya June 20, 2018 17:03
@codeclimate
Copy link

codeclimate bot commented Jun 20, 2018

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
Copy link
Member

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

Copy link
Member Author

@dexhorthy dexhorthy Jun 21, 2018

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"
Copy link
Member

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?

Copy link
Member Author

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 {
Copy link
Member

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

Copy link
Member Author

Choose a reason for hiding this comment

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

good call.

@dexhorthy dexhorthy merged commit 73b043c into replicatedhq:master Jun 21, 2018
@dexhorthy dexhorthy deleted the dex/ch11353/backup-installer branch July 17, 2018 23:16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants