Comments (9)
Hi @Burnett01,
Wauw, thanks for your feedback! The git diff approach seems perfect!
Don't feel obliged, but when you would have some time to write such a script, that would be totally awesome!
Let's keep in touch.
// T
from rsync-deployments.
Hey, unfortunately I haven't had a chance to get my hands on this. I didn't forget about it so I just wanted to give you an update.
I hope I can find some spare time and simulate your use case.
from rsync-deployments.
Hey @timocouckuyt thanks for reaching out.
Your approach to getting the .gitignore file recognized by Rsync would be using some sort of conversion. I think you'd write a small shell script that translates the git paths to rsync-filter rules so that
my/file.txt
!other.stuff
would translate to:
+ my/file.txt
- other.stuff
- *
With awk and sed this could be quickly achieved for some basic conversion.
You would then add a new step for that, right before calling the action:
name: Convert .gitignore to filter
run: ./github/converter.sh .gitgnore ./github/myfilter.conf
Script synopsis: converter.sh [inputfile] [outputfile]
Then you could pass the resulting filter to the action:
--delete --filter="merge .github/myfilter.conf"
Let me know if this helps and if you need assistance :)
Greetings Steve
from rsync-deployments.
Oh, great, thanks a lot for the input!
I don't know anything about shell scripting, but I could dive into it, for sure.
Am I correct when I assume that your line in 'run: ' is storing the converted lines into a .conf file? Is there any way of returning the same result inside the --filter
option, but without first writing a conf file? So rather inline inside the option value?
Thanks a lot, once again!
// T
from rsync-deployments.
Another take on this: Accounting for .gitignore
could be a pain when other companies/freelancers add files and folders to the remote folder over time that should not be deleted and would never be stated in the .gitignore
file. In fact, better would be that rsync compares the 2 last commits and performs only these changes.
For example:
- If there's only 1 commit, rsync should create all files and folders appearing in the repo, no deletions.
- 2 files are updated in the repo: rsync only updates these files.
- 1 folder is created, containing 1 file: rsync only creates the folder and adds the file.
- That same folder is removed from the repo, including the file: rsync should only perform a delete of that folder and the file.
- A folder gets renamed: rsync should only account for that renaming.
- etc.
In fact the repo commits should be mirrored into the same actions. But I don't know if that would ever be possible with rsync?
Thanks a lot for your input!
// T
from rsync-deployments.
Hey @timocouckuyt thanks for your replies.
Yes, basically it should be possible to get Rsync behave the way you described, but not without using some sort of script that prepares everything for --filter. A filter is not required when using the --include and --exclude switches, but then you could hit a limit of max allowed cmd-arg characters. Creating and using an intermediary filter config is thus much neater and reliable. But a filter conf might not be required after all if rsync allows for piping the output of the script to the --filter switch. I gotta do some research on that.
For the script you would take the output of git diff (changed paths only + states like M,D,A) and convert these to rsync filter rules (+/-) and have it create a temporary filter conf (unless the output could be piped to rsync directly).
This issue seems related to #20, so when we have a solution for your issue, the other one will be solved too 😃
If you need help, I can get my hands dirty and write such script in the next week when I'm back at my hometown for a short vacation.
Greetings Steve
from rsync-deployments.
I haven’t had a chance to look into this as of yet but I‘ll see if I can simulate this scenario in a container.
from rsync-deployments.
Great, @Burnett01 !
from rsync-deployments.
No worries @Burnett01, take your time, I'm glad that you're even considering it.
from rsync-deployments.
Related Issues (20)
- Syntax error in command? HOT 2
- Job doesn't fail if SSH Key Passphrase is wrong HOT 1
- rsync deployment resulting in fail because received data is less than sent data HOT 2
- kex_exchange_identification: Connection closed by remote host HOT 1
- Run with rsh option fails HOT 2
- Fails inside containers due to reliance on $GITHUB_WORKSPACE HOT 1
- Permission denied HOT 1
- Passing an empty Github Action variable to `remote_path` circumvents validation and targets the root `/` directory HOT 2
- Rsync missing HOT 1
- (GitTea) No files are copied HOT 6
- I receive rsync: connection unexpectedly closed (0 bytes received so far) [sender] when using the library HOT 1
- Unable to negotiate with *** port ***: no matching host key type found. HOT 4
- Support teleport connection
- How can I connect to the local IP? There is no public IP.
- sync HOT 3
- Permission denied HOT 12
- rsync: [sender] link_stat "/github/workspace/rsync" failed: No such file or directory HOT 1
- rsync Not Found? HOT 1
- Support rsync protocol HOT 1
- Base image drinternet/rsync as first party code HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rsync-deployments.