forked from sqlmapproject/sqlmap
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Add CI/CD workflow for Docker image builds
- Loading branch information
Lê Phương Hiếu
committed
May 26, 2024
1 parent
507c719
commit 23fc329
Showing
6 changed files
with
120 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
version: "1" | ||
rules: | ||
- base: master | ||
upstream: sqlmapproject:master | ||
mergeMethod: rebase |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
name: CI to Docker hub | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- 'upstream-master' | ||
pull_request: | ||
branches: | ||
- 'upstream-master' | ||
pull_request_review_comment: | ||
types: [created, edited] | ||
|
||
|
||
permissions: read-all | ||
|
||
jobs: | ||
docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: master | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: 'sqlmapproject/sqlmap' | ||
ref: master | ||
path: 'sqlmap' | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to DockerHub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKER_HUB_USERNAME }} | ||
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | ||
- name: Run shell | ||
run: |- | ||
ls -la; | ||
pwd | ||
cp Dockerfile ./sqlmap/ | ||
cp Dockerfile-alpine ./sqlmap/ | ||
cp Dockerfile-tor ./sqlmap/ | ||
cp entrypoint.sh ./sqlmap/ | ||
- name: Build and push | ||
id: docker_build | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: ./sqlmap/ | ||
push: true | ||
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/sqlmap:latest | ||
|
||
- name: Image digest | ||
run: echo ${{ steps.docker_build.outputs.digest }} | ||
|
||
- name: Build and push | ||
id: docker_build_alpine | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: ./sqlmap/ | ||
file: ./Dockerfile-alpine | ||
push: true | ||
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/sqlmap:latest-alpine | ||
|
||
- name: Image digest | ||
run: echo ${{ steps.docker_build_alpine.outputs.digest }} | ||
|
||
- name: Build and push | ||
id: docker_build_tor | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: ./sqlmap/ | ||
file: ./Dockerfile-tor | ||
push: true | ||
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/sqlmap:latest-tor | ||
|
||
- name: Image digest | ||
run: echo ${{ steps.docker_build_tor.outputs.digest }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
FROM python:3 | ||
COPY . sqlmap-dev | ||
RUN apt update && apt install -y tor | ||
ENTRYPOINT ["python","sqlmap-dev/sqlmap.py"] | ||
CMD ["-h"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
FROM python:3-alpine | ||
COPY . sqlmap-dev | ||
RUN apk update && apk add tor | ||
ENTRYPOINT ["python3","sqlmap-dev/sqlmap.py"] | ||
CMD ["-h"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
FROM python:3 | ||
ARG DEBIAN_FRONTEND=noninteractive | ||
COPY . /sqlmap-dev | ||
RUN apt clean; apt update; apt install -y tor systemd; \ | ||
# sed -i 's/#SocksPort.*/SocksPort 0.0.0.0:9050/g' /etc/tor/torrc; \ | ||
sed -i 's/#CookieAuthentication 1/CookieAuthentication 0/g' /etc/tor/torrc; \ | ||
sed -i 's/#CookieAuthFileGroupReadable 1/CookieAuthFileGroupReadable 0/g' /etc/tor/torrc; \ | ||
sed -i 's/#RunAsDaemon 1/RunAsDaemon 1/g' /etc/tor/torrc; \ | ||
/etc/init.d/tor restart | ||
|
||
WORKDIR /sqlmap-dev | ||
ENTRYPOINT ["bash", "/sqlmap-dev/entrypoint.sh"] | ||
CMD ["-h"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/env bash | ||
|
||
/etc/init.d/tor start | ||
|
||
python ./sqlmap.py $@ |