openfaas / python-flask-template

HTTP and Flask-based OpenFaaS templates for Python 3
MIT License
85 stars 86 forks source link

Make TEST_ENABLED conditional syntax POSIX friendly #54

Closed rgschmitz1 closed 2 years ago

rgschmitz1 commented 2 years ago

Signed-off-by: Bob Schmitz III schmitzr1984@gmail.com

Description

Motivation and Context

This fixes a syntax error occurring in Debian based image templates which uses dash as the default shell.

Closes #53

How Has This Been Tested?

  1. Created stripped Dockerfiles for both python:3.7-alpine and python:3.7-slim-buster (see https://gist.github.com/rgschmitz1/1cc3f375e582433dc80191b87d2e103e for detailed log).
  2. Issued docker build command for both base images.
  3. Tested fix in templates using the openfaas documentation for creating new functions, verified TEST_ENABLED works as described in documentation when set to "false".

CLI: commit: b1c09c0243f69990b6c81a17d7337f0fd23e7542 version: 0.14.2


* Docker version `docker version` (e.g. Docker 17.0.05 ):

Docker version 20.10.14, build a224086


* Operating System and version (e.g. Linux, Windows, MacOS):

NAME="Ubuntu" VERSION="20.04.4 LTS (Focal Fossa)" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu 20.04.4 LTS" VERSION_ID="20.04" HOME_URL="https://www.ubuntu.com/" SUPPORT_URL="https://help.ubuntu.com/" BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" VERSION_CODENAME=focal UBUNTU_CODENAME=focal



<!--- see how your change affects other areas of the code, etc. -->

## Types of changes
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)

## Checklist:
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
- [x] My code follows the code style of this project.
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [x] I've read the [CONTRIBUTION](https://github.com/openfaas/faas/blob/master/CONTRIBUTING.md) guide
- [x] I have signed-off my commits with `git commit -s`
- [ ] I have added tests to cover my changes.
- [x] All new and existing tests passed.
LucasRoesler commented 2 years ago

@alexellis this is :+1: but i can't merge it myself, I think you are the only one that can.

alexellis commented 2 years ago

Thanks for the PR and review.

A good time to get eyes on PRs and requests like this would be at our weekly community call, feel free to see the pinned issue at: https://github.com/openfaas/faas/issues

Alex