I want to use a bash script to push to a "build repository" for my Symfony app, which can then be deployed directly to a server. I have the following so far:
#!/bin/bash
cd ..
rm -rf api-analyzer-build
git clone https://$OAUTH_TOKEN:x-oauth-basic@github.com/patrickmustermann/api-analyzer-build.git
cd www
composer install
rsync -avr --exclude='.git' --exclude='.env.local' --exclude='.gitignore' ./ ../api-analyzer-build
cd ../api-analyzer-build
git add *
git commit -m "Update"
git config --global user.email "$EMAIL"
git config --global user.name "$USER_NAME"
# Now I want to commit changes to my private api-analyzer-build.git build repository
This script successfully clones my private build repository from GitHub, installs all PHP dependencies via composer and clones the fully fleshed-out app back to the build folder.
Now I'm stuck on the last step: Pushing to my private build repository programmatically. Is there a one-liner I can use to push to the build repository, using my OAUTH_TOKEN
value from within my bash script? Something similar to how I'm currently cloning from the repository?