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

Force publish if there are modifications in base directory #365

Merged
merged 2 commits into from
Jan 25, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ jobs:

- uses: actions/checkout@v2

- uses: dorny/paths-filter@v2
id: changes
with:
filters: |
base:
- 'base/**'

- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
Expand All @@ -52,10 +59,15 @@ jobs:
working-directory: base

- name: Base Images > Docker Build & Push
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && steps.changes.outputs.base != 'true' }}
run: ./docker_tags.sh -p
working-directory: base

- name: Base Images > Docker Build & Push
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && steps.changes.outputs.base == 'true' }}
run: ./docker_tags.sh -p -f
working-directory: base

- name: Install dependencies
run: pip install -r requirements.txt

Expand Down
1 change: 1 addition & 0 deletions base/config_files/ps-extractor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ if [[ -n "$folder" ]]; then
fi

chown www-data:www-data -R $folder/prestashop/
# Copy all files (included .env files)
cp -n -R -T -p $folder/prestashop/ /var/www/html
else
echo "Missing folder to move"
Expand Down
9 changes: 7 additions & 2 deletions base/docker_tags.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,15 @@ else
PS_VERSIONS_FILE="$1";
fi

while getopts ":p" option; do
FORCE=false
while getopts ":fp" option; do
case $option in
p)
PUSH=true
;;
f)
FORCE=true
;;
esac
done

Expand All @@ -22,8 +26,9 @@ docker_tag_exists() {

docker_image()
{
if docker_tag_exists prestashop/base ${version}; then
if ! $FORCE && docker_tag_exists prestashop/base ${version}; then
echo "Docker Image already pushed : prestashop/base:$version"
return
else
echo "Docker build & tag : prestashop/base:$version"
id=$(echo $(docker build --quiet=true images/${version} 2>/dev/null) | awk '{print $NF}')
Expand Down
Loading