Skip to content

Commit

Permalink
Merge branch 'main' into gitlab_docs
Browse files Browse the repository at this point in the history
  • Loading branch information
matt- authored May 17, 2024
2 parents ac63e14 + 33c5a4b commit 3439fea
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 17 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/docker_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: Manual Docker Build and Publish

on:
workflow_dispatch: # This enables manual trigger from GitHub UI or API
push:
branches:
- main

jobs:
build_and_publish:
Expand Down Expand Up @@ -48,4 +51,4 @@ jobs:
context: "{{defaultContext}}:docker"
file: ./Dockerfile
push: true
tags: pixeematt/pixee-cli:latest, pixeematt/pixee-cli:${{ steps.bump-semver.outputs.new_version }}
tags: codemodder/pixee-cli:latest, codemodder/pixee-cli:${{ steps.bump-semver.outputs.new_version }}
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: pre-commit/[email protected].0
- uses: pre-commit/[email protected].1
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,15 @@ To simply scan some code and see possible changes to make:
pixee fix /my/project/directory/
```

## Docker Usage

Pixee can also be run in a Docker container. This is useful if you want to run Pixee on an oerating system that does not support brew, or a CI/CD pipeline or in a containerized environment.

```
docker run --rm -it -v "${PWD}:/src" codemodder/pixee-cli fix /src
```

## F.A.Q.

### What languages are supported for fixes?
Expand Down
2 changes: 1 addition & 1 deletion ci/bitbucket/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM codemodder/pixee-cli:0.0.1
FROM codemodder/pixee-cli:0.8.5
COPY . /pixee/bitbucket
WORKDIR /pixee/bitbucket
RUN pip install whatthepatch load_dotenv
Expand Down
1 change: 1 addition & 0 deletions ci/examples/bitbucket-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
image: atlassian/default-image:4


pipelines:
pull-requests:
'**': # This will run for pull requests targeting any branch
Expand Down
2 changes: 1 addition & 1 deletion ci/gitlab/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM codemodder/pixee-cli:0.0.1
FROM codemodder/pixee-cli:0.8.5
COPY . /pixee/gitlab
WORKDIR /pixee/gitlab
RUN pip install -r requirements.txt
2 changes: 2 additions & 0 deletions ci/gitlab/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@


# GitLab settings

gitlab_url = os.environ.get("GITLAB_API_URL", "https://gitlab.com")

api_token = os.environ.get("GITLAB_API_TOKEN_PIXEE")
project_id = os.environ.get("CI_MERGE_REQUEST_PROJECT_ID") or os.environ.get(
"CI_PROJECT_ID"
Expand Down
20 changes: 8 additions & 12 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
FROM python:3.11-rc-bullseye
WORKDIR /pixee

RUN apt-get update
ENV CODEMODDER_JAVA_VERSION=0.75.1

# Install Python 3, pip and wget
RUN apt-get install -y wget unzip openjdk-17-jre

RUN ln -s /usr/bin/python3 /usr/bin/python && \
java -version && \
python --version && \
python3 -m pip install semgrep==1.15.0 && \
python3 -m pip install codemodder

RUN wget https://github.com/pixee/codemodder-java/releases/download/v0.72.2/codemodder-java-codemods-0.72.2.zip
RUN unzip codemodder-java-codemods-0.72.2.zip
RUN apt-get update && apt-get --no-install-recommends install -y wget unzip openjdk-17-jre && apt-get clean && rm -rf /var/lib/apt/lists/*
RUN wget --max-redirect=1 "https://github.com/pixee/codemodder-java/releases/download/v${CODEMODDER_JAVA_VERSION}/codemodder-java-codemods-${CODEMODDER_JAVA_VERSION}.zip"
RUN unzip codemodder-java-codemods-*.zip && rm codemodder-java-codemods-*.zip

RUN python3 -m pip install pixee

COPY bin ./bin
ENV PATH="${PATH}:/pixee/bin"

WORKDIR /src

ENTRYPOINT ["pixee"]
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ readme = "README.md"
license = {file = "LICENSE"}
description = "Pixee CLI"
dependencies = [
"codemodder==0.91.0",
"codemodder==0.100.0",
"click",
"prompt-toolkit",
"questionary~=2.0.0",
Expand Down

0 comments on commit 3439fea

Please sign in to comment.