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

Feat/add custom workspace #56

Closed

Conversation

Lewiscowles1986
Copy link

@Lewiscowles1986 Lewiscowles1986 commented Oct 22, 2020

Requirements

Addresses #16 by re-approaching #30

Description of the Change

#16 is about having the code to push to the plugin repository in a separate folder to the git repo root.

This is a pattern I am familiar with through https://github.com/Lewiscowles1986/WordPressSVGPlugin

WordPress does not use or support Composer, so I ship my plugin with it's own autoloader and vendor folder.

I Like to keep the code separate to the vendor folder.

Also guards (WiP) the image subversion attribute change to cut down chatty logs

Alternate Designs

  1. I could approach by asking myself and a number of other plugin authors to re-approach their repository design.
    • Means they would be shipping tests
    • Means any files in a repo, for it's release are shipped with plugins (I don't feel like this is ideal)
  2. The PR at Add possibility to use custom workspace #30 is a slight variation of this one, where .wordpress-org (default asset folder), .gitattributes or it's analogue file are not part of the repo root either.
    • This seemed to be doing more than we had to.
    • This could result in confusion browsing repositories.
    • I can see why not all source code and files should be deployed.
    • I cannot see why moving all the conventional paths makes sense, and the concatenation of paths I could see causing problems

Benefits

  • Less files to compress, push via SVN
  • Developer freedom to support intricate build processes (Gutenberg plugins...)
  • Simple environment variable

Possible Drawbacks

Technical complexity. A Thing is less easy to think about like this. People may enter paths that do not exist (possible future iteration).

Verification Process

I have not verified this, although I would be happy to think about how to do that. It's currently holding back a PR 😂

Checklist:

  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

I would like help with these two if it is available... (I appeased shellcheck 😉 )

  • I have added tests to cover my change.
  • All new and existing tests passed.

https://github.com/Lewiscowles1986/WordPressSVGPlugin/runs/1294128965 shows this as working.

Applicable Issues

#16

Changelog Entry

  • Added new ENV arg to re-target the plugin-directory base path WORKSPACE_DIR

Edits from original assume that assets & ignore list are in project root
Only code to be committed to Plugin repo are placed elsewhere.
entrypoint.sh Outdated Show resolved Hide resolved
@Lewiscowles1986
Copy link
Author

Lewiscowles1986 commented Oct 22, 2020

Annoyingly this is not exporting my vendor folder (super annoying)

I have tried

  • using sed to comment out the vendor folder from .gitignore
  • committing the vendor folder to git in a similar way to .gitattributes using the -f flag to force adding...

@Lewiscowles1986
Copy link
Author

Lewiscowles1986 commented Oct 22, 2020

This was used to deploy https://wordpress.org/plugins/enable-svg-uploads/#description using https://github.com/Lewiscowles1986/WordPressSVGPlugin/blob/main/.github/workflows/release.yml

Currently I'm fine using the fork, but ping if this is of interest, and I'll try to address any concerns.

There was a bit of pain in working out I need to git commit generated files from this action for example. This will impact anyone bundling vendor dependencies using composer and then adding to their SVN deploy step as it will not be included in git archive

@jeffpaul jeffpaul added this to the Future Release milestone Mar 22, 2021
@jeffpaul jeffpaul linked an issue Jan 5, 2022 that may be closed by this pull request
@jeffpaul jeffpaul modified the milestones: Future Release, 2.1.0 Jan 5, 2022
@jeffpaul jeffpaul linked an issue Jan 5, 2022 that may be closed by this pull request
echo "➤ Copying files..."
if [[ -e "$GITHUB_WORKSPACE/.distignore" ]]; then
echo "ℹ︎ Using .distignore"
# Copy from current branch to /trunk, excluding dotorg assets
# The --delete flag will delete anything in destination that no longer exists in source
rsync -rc --exclude-from="$GITHUB_WORKSPACE/.distignore" "$GITHUB_WORKSPACE/" trunk/ --delete --delete-excluded
rsync -rc --exclude-from="$GITHUB_WORKSPACE/.distignore" "$WORKSPACE_DIR/" trunk/ --delete --delete-excluded
Copy link
Collaborator

Choose a reason for hiding this comment

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

At this point, we're in the $SNV_DIR, if $WORKSPACE_DIR is set to a relative path, this this command will fail.

Copy link
Author

Choose a reason for hiding this comment

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

This and my other PR have been working since 2020. Thank you for your input. I am closing this PR.

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.

Repo with no images gets SVN error Deploy a specific directory within repository
4 participants