这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@josegonzalez
Copy link
Member

These are helper plugins that mimic the repo plugin: https://github.com/heroku/heroku-repo

The following commands will remain unimplemented:

  • clone: not useful for the host client to clone
  • download: currently not possible for us to "host" a tarball of the repo
  • reset: we still store files in the repo (though we shouldn't) so we cannot easily reinitialize the repository.

Also fixes a potential race condition if two separate processes create an application's $CACHE_DIR.

Closes #1570

@michaelshobbs
Copy link
Member

Do we need this given that we only clone a depth of 1? Also, tests.

local APP="$2"; local CACHE_DIR="$DOKKU_ROOT/$APP/cache"
verify_app_name "$APP"

find "$CACHE_DIR" -mindepth 1 -exec rm -rf {}
Copy link
Member

Choose a reason for hiding this comment

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

Does this work? Check the apps pre-delete trigger. We mount a container to rm this in that case due to permissions.

@michaelshobbs
Copy link
Member

Couldn't we implement download with an inline tar pipeline?

@josegonzalez
Copy link
Member Author

  • Yeah I think so, given that it's the repo you push to.
  • I don't write tests. You do, remember?
  • Probably? Not sure how that would work...

@michaelshobbs
Copy link
Member

Oh yeah that's fair. We clone a depth of one but each subsequent push will add to that history.

@michaelshobbs
Copy link
Member

Thinking further, download would either need a client or we could tar up to a directory and just echo out the path for the user to scp. Not sure how much it's worth to do though.

Also, write some damn tests. 😜

@josegonzalez
Copy link
Member Author

No, u.

@michaelshobbs
Copy link
Member

You could prevent the race condition by using flock like we do for deploys.

@josegonzalez
Copy link
Member Author

I figure the -p is good enough.

@michaelshobbs
Copy link
Member

👍

@josegonzalez
Copy link
Member Author

How do I test the gc call? I know how to test the purge-cache, but don't know about the gc call. Maybe neither is necessary?

@michaelshobbs
Copy link
Member

Rebased from master and added tests

@michaelshobbs michaelshobbs removed their assignment Apr 26, 2016
@josegonzalez
Copy link
Member Author

Uhh that's not a rebase ;)

@michaelshobbs
Copy link
Member

michaelshobbs commented Apr 26, 2016

Hrm what happened there? I did git rebase master in this branch.

@michaelshobbs
Copy link
Member

I think that fixed it. Maybe those showed up because we're merging squashed commits when we merge PRs?

@michaelshobbs
Copy link
Member

I cherry-picked that last commit from master. Not sure why github shows it as a change since the files match....

josegonzalez and others added 2 commits June 9, 2016 20:05
These are helper plugins that mimic the repo plugin: https://github.com/heroku/heroku-repo

The following commands will remain unimplemented:

- `clone`: not useful for the host client to clone
- `download`: currently not possible for us to "host" a tarball of the repo
- `reset`: we still store files in the repo (though we shouldn't) so we cannot easily reinitialize the repository.

Also fixes a potential race condition if two separate processes create an application's `$CACHE_DIR`.

Closes #1570
@michaelshobbs michaelshobbs merged commit 8e30722 into master Jun 16, 2016
@michaelshobbs michaelshobbs deleted the 1570-repo-plugin branch June 16, 2016 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for purging the npm cache

3 participants