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

CHORE: Add git safe directories #30

Merged
merged 5 commits into from
Jun 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
11 changes: 7 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ on: [pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
version: [7.4, 8.0, 8.1, 8.2]
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.release.target_commitish }}
- run: docker build . --build-arg PHP_VERSION=8
- uses: actions/checkout@v2
with:
ref: ${{ github.event.release.target_commitish }}
- run: docker build . --build-arg PHP_VERSION=${{ matrix.version }}
10 changes: 8 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ARG PHP_VERSION
FROM php:${PHP_VERSION} as standards-runtime

RUN apt-get update
RUN apt-get install -y unzip libpng-dev libicu-dev libxslt-dev jq git libzip-dev wget
RUN apt-get install -y unzip libpng-dev libicu-dev libxslt-dev jq git libzip-dev wget python3-venv
RUN apt-get clean

RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
Expand All @@ -22,6 +22,12 @@ RUN apt-get clean
COPY pipe /
RUN chmod a+x /pipe.py
COPY requirements.txt /
RUN python3 -m pip install --no-cache-dir -r /requirements.txt
RUN python3 -m venv /venv
RUN /venv/bin/pip install --no-cache-dir -r /requirements.txt

# Allow git access to mounted build directories
RUN git config --global --add safe.directory /build
RUN mkdir -p /opt/atlassian/pipelines/agent/build
RUN git config --global --add safe.directory /opt/atlassian/pipelines/agent/build

ENTRYPOINT ["/pipe.py"]
3 changes: 1 addition & 2 deletions pipe/pipe.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#!/usr/bin/env python3
#!/venv/bin/python

from operator import sub
import os
import shutil
from sre_constants import SUCCESS
import subprocess
from sys import stdout
import sys
Expand Down