diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 55754776..48ce3315 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -30,6 +30,12 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + - name: Install Latest Docker + run: | + curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - + sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" + sudo apt-get update + sudo apt-get install docker-ce - name: Run Integration Tests run: bash ./run_integration_tests.sh - name: Rename logs diff --git a/postgres.Dockerfile b/postgres.Dockerfile index 5c69fc74..7f57ed17 100644 --- a/postgres.Dockerfile +++ b/postgres.Dockerfile @@ -13,4 +13,4 @@ # limitations under the License. FROM postgres:15 -COPY postgres_init.sh /docker-entrypoint-initdb.d/ +COPY --chmod=755 postgres_init.sh /docker-entrypoint-initdb.d/ diff --git a/run_integration_tests.sh b/run_integration_tests.sh index 8ffe761e..0c0e7ea0 100755 --- a/run_integration_tests.sh +++ b/run_integration_tests.sh @@ -15,7 +15,7 @@ # update pip version python3 -m pip install --user --upgrade pip setuptools wheel -# Create test venv +# create test venv ENV_NAME=".tightlock_integration_test_venv" python3 -m venv $ENV_NAME @@ -24,11 +24,11 @@ PY3=$ENV_NAME/bin/python $PY3 -m pip install -r integration_tests/test_requirements.txt -# Create env -./create_env.sh non-interactive test +# create env +./create_env.sh non-interactive test -# Remove potentially running containers and run integration tests -docker-compose down +# remove potentially running containers and run integration tests +docker-compose down -v $PY3 -m pytest -s --no-header -vv --docker-compose=docker-compose.yaml integration_tests/ # get return value of integration tests run diff --git a/run_tightlock.sh b/run_tightlock.sh index 75be7174..1aeea337 100755 --- a/run_tightlock.sh +++ b/run_tightlock.sh @@ -25,9 +25,12 @@ esac done -# Create env +# create env bash ./create_env.sh $INTERACTIVE_FLAG $ENV_FLAG $PROVIDED_API_KEY +# enable docker buildkit +export DOCKER_BUILDKIT=1 + # define which docker-compose command to use based on the environment if [ $ENV_FLAG == "prod" ]; then COMPOSE_CMD="docker run -v /var/run/docker.sock:/var/run/docker.sock --rm -v $PWD:$PWD -w $PWD docker/compose:1.29.2" @@ -35,5 +38,5 @@ else COMPOSE_CMD='docker-compose' fi -# Run containers +# run containers $COMPOSE_CMD up --build -d