Skip to content

Commit

Permalink
Merge 9b7881b into d7ee4d5
Browse files Browse the repository at this point in the history
  • Loading branch information
mageddo authored Feb 20, 2023
2 parents d7ee4d5 + 9b7881b commit 8062b99
Show file tree
Hide file tree
Showing 33 changed files with 842 additions and 291 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
**/node_modules
build
#*
#!build/*-runner
#!build/*-runner.jar
Expand Down
70 changes: 37 additions & 33 deletions .github/workflows/actions-deploy.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
name: CD
#on:
# push:
# branches:
# - master

on:
push:
branches:
- master
pull_request:

permissions:
contents: write
Expand All @@ -24,37 +27,38 @@ jobs:
fetch-depth: '0'

- name: Deploy
run: ./builder.bash deploy-ci
run: docker-compose -f docker-compose-deploy.yml up --force-recreate --exit-code-from deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# github token to deploy the binary
REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}

- name: Docs Generate
id: docs_generate
uses: peaceiris/actions-hugo@v2
with:
hugo-version: '0.91.2'
- name: Build docs
run: |
./builder.bash docs /tmp/build &&\
echo "VERSION=$(cat VERSION | awk -F '.' '{ print $1"."$2}')" >> "${GITHUB_OUTPUT}"
- name: Docs Deploy - Latest
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build/docs/latest
destination_dir: latest
keep_files: true
commit_message: Releasing the docs for latest

- name: Docs Deploy - Minor
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: './build/docs/${{ steps.docs_generate.outputs.VERSION }}'
destination_dir: '${{ steps.docs_generate.outputs.VERSION }}'
keep_files: true
commit_message: 'Releasing the docs: ${{ steps.docs_generate.outputs.VERSION }}'
#
# - name: Docs Generate
# id: docs_generate
# uses: peaceiris/actions-hugo@v2
# with:
# hugo-version: '0.91.2'
# - name: Build docs
# run: |
# ./builder.bash docs /tmp/build &&\
# echo "VERSION=$(cat VERSION | awk -F '.' '{ print $1"."$2}')" >> "${GITHUB_OUTPUT}"
#
# - name: Docs Deploy - Latest
# uses: peaceiris/actions-gh-pages@v3
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# publish_dir: ./build/docs/latest
# destination_dir: latest
# keep_files: true
# commit_message: Releasing the docs for latest
#
# - name: Docs Deploy - Minor
# uses: peaceiris/actions-gh-pages@v3
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# publish_dir: './build/docs/${{ steps.docs_generate.outputs.VERSION }}'
# destination_dir: '${{ steps.docs_generate.outputs.VERSION }}'
# keep_files: true
# commit_message: 'Releasing the docs: ${{ steps.docs_generate.outputs.VERSION }}'

15 changes: 8 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ jobs:
tests:
runs-on: ubuntu-latest
steps:
- name: Explain
run: |
echo "This workflow will run the basic tests on pull requests, merges into master and all tags."
- name: Checkout code
uses: actions/checkout@v3
- name: Run tests
run: docker-compose rm -f && docker-compose up --build tests
- uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '19'
distribution: 'adopt'
- name: Build and Tests
run: ./gradlew build test -i
18 changes: 17 additions & 1 deletion README.alpha.md → DRAFT.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

## Build project

Binary using Native Image
Expand All @@ -6,6 +7,22 @@ $ ./gradlew build -Dquarkus.package.type=native &&\
./build/dns-proxy-server-*-runner --server-port 8053
```

CD
```
docker-compose build build-frontend
```


## Generate binaries
```
native-image -H:+ReportExceptionStackTraces -H:Class=com.mageddo.dnsproxyserver.App build/dns-proxy-server-3.0.0-alpha.jar
```
libfreetype-dev
sudo apt-get install build-essential



# Drafts

## Run a container for testing
Expand Down Expand Up @@ -55,4 +72,3 @@ java -cp './build/dns-proxy-server-3.0.0-alpha-runner.jar:../annotation-process
docker-compose -f docker-compose-tmp.yml up --build


Implementing: https://www.ietf.org/rfc/rfc1035.txt
13 changes: 11 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
FROM docker.io/defreitas/tools_graalvm-22.3_java-19_debian-9:0.1.1 AS BUILDER
COPY ./ /app
WORKDIR /app
RUN ./gradlew clean build -Dquarkus.package.type=native -i &&\
cd build &&\
ls -lha &&\
mkdir -p artifacts &&\
mv $(ls -p ./ | grep -v / | grep dns-proxy-server) ./artifacts/

FROM debian:10-slim
ADD build/dns-proxy-server-linux-amd64*.tgz /app/
COPY --from=BUILDER /app/build/artifacts/* /app/dns-proxy-server
WORKDIR /app
LABEL dps.container=true
VOLUME ["/var/run/docker.sock", "/var/run/docker.sock"]
CMD ["bash", "-c", "/app/dns-proxy-server"]
ENTRYPOINT "/app/dns-proxy-server"
19 changes: 0 additions & 19 deletions Dockerfile.builder

This file was deleted.

11 changes: 11 additions & 0 deletions Dockerfile.builder.frontend
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM node:12-alpine AS FRONTEND
COPY app /app
WORKDIR /app
ENV PUBLIC_URL=/static
RUN npm install &&\
npm run build &&\
rm -f `find ./build -name *.map`

FROM scratch AS ARTIFACTS
COPY --from=FRONTEND /app/build /static
ENTRYPOINT cat
4 changes: 4 additions & 0 deletions Dockerfile.deploy
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM docker.io/defreitas/tools-generic-cd:0.1.1
COPY . /app
COPY ./builder.bash /bin/builder.bash
WORKDIR /app
7 changes: 0 additions & 7 deletions Dockerfile.go.builder

This file was deleted.

3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ PING dns.mageddo (172.17.0.4) 56(84) bytes of data.
* [Running it documentation](http://mageddo.github.io/dns-proxy-server/latest/en/1-getting-started/running-it/)
* [Examples](https://github.com/mageddo/dns-proxy-server/tree/master/examples)
* [Coding at the DPS](http://mageddo.github.io/dns-proxy-server/latest/en/5-developing/)
* [RFC1035][1]

### Donation
Help me to keep DPS up to date
Expand All @@ -52,3 +53,5 @@ Via PayPal
Or via QR code

![](https://i.imgur.com/LmN7g2j.png)

[1]: https://www.ietf.org/rfc/rfc1035.txt
4 changes: 4 additions & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### 3.0.1-beta
* DPS has your code totally refactored by maintaining the previous features, it's a structuring for new features
See details at [DNS Proxy Server 3 #267](https://github.com/mageddo/dns-proxy-server/issues/267)

### 2.19.0
* Support for absolute paths on config files (#188)

Expand Down
6 changes: 6 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ repositories {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17

configurations.all {
resolutionStrategy {
force 'net.java.dev.jna:jna:5.13.0'
}
}
dependencies {

compileOnly group: 'org.projectlombok', name: 'lombok', version: '1.18.+'
Expand Down Expand Up @@ -55,6 +60,7 @@ dependencies {
test {
systemProperty "java.util.logging.manager", "org.jboss.logmanager.LogManager"
}

compileJava {
options.encoding = 'UTF-8'
options.compilerArgs << '-parameters'
Expand Down
Loading

0 comments on commit 8062b99

Please sign in to comment.