moving ci/cd over to forgejo
This commit is contained in:
parent
0ebdb34601
commit
3c9edb1e0b
|
@ -1,15 +1,18 @@
|
||||||
name: Build and Publish Docker Image
|
name: Docker Build & Publish
|
||||||
|
|
||||||
on:
|
on:
|
||||||
release:
|
release:
|
||||||
types: [created]
|
types: [created]
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
REGISTRY: ghcr.io
|
CTR_REGISTRY: git.nickorlow.com
|
||||||
IMAGE_NAME: ${{ github.repository }}
|
IMAGE_NAME: "anthracite"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
packages: write
|
packages: write
|
||||||
|
@ -30,11 +33,11 @@ jobs:
|
||||||
echo Building with version number $RELEASE_VERSION
|
echo Building with version number $RELEASE_VERSION
|
||||||
echo $RELEASE_VERSION > src/build/version.txt
|
echo $RELEASE_VERSION > src/build/version.txt
|
||||||
|
|
||||||
- name: Log into registry ${{ env.REGISTRY }}
|
- name: Log into registry ${{ env.CTR_REGISTRY }}
|
||||||
if: github.event_name != 'pull_request'
|
if: github.event_name != 'pull_request'
|
||||||
uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c
|
uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c
|
||||||
with:
|
with:
|
||||||
registry: ${{ env.REGISTRY }}
|
registry: ${{ env.CTR_REGISTRY }}
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
@ -42,7 +45,7 @@ jobs:
|
||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
|
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
|
||||||
with:
|
with:
|
||||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
images: ${{ env.CTR_REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||||
|
|
||||||
- name: Build and push Docker image
|
- name: Build and push Docker image
|
||||||
id: build-and-push
|
id: build-and-push
|
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,2 +1,3 @@
|
||||||
build/
|
build/
|
||||||
build_supp/version.cpp
|
build_supp/version.cpp
|
||||||
|
.cache/
|
||||||
|
|
|
@ -15,23 +15,11 @@ add_custom_target(build-version
|
||||||
|
|
||||||
add_custom_target(build-supplemental
|
add_custom_target(build-supplemental
|
||||||
COMMAND cd ../build_supp && python3 ./error_gen.py
|
COMMAND cd ../build_supp && python3 ./error_gen.py
|
||||||
COMMAND cp -r ../www .
|
COMMAND mkdir www && cp -r ../default_www/regular/* ./www/
|
||||||
DEPENDS build_supp/version.txt www/* build_supp/error_gen.py build-version
|
DEPENDS build_supp/version.txt ../default_www/regular/* build_supp/error_gen.py build-version
|
||||||
COMMENT "Generated supplemental build files (default www dir + error pages)"
|
COMMENT "Generated supplemental build files (default www dir + error pages)"
|
||||||
)
|
)
|
||||||
|
|
||||||
add_custom_target(lint
|
|
||||||
COMMAND clang-tidy *.cpp
|
|
||||||
)
|
|
||||||
|
|
||||||
add_custom_target(lint-fix
|
|
||||||
COMMAND clang-tidy *.cpp -fix -fix-errors
|
|
||||||
)
|
|
||||||
|
|
||||||
add_custom_target(build-docker
|
|
||||||
COMMAND docker build .. -t anthracite
|
|
||||||
)
|
|
||||||
|
|
||||||
add_custom_target(run
|
add_custom_target(run
|
||||||
COMMAND anthracite-bin
|
COMMAND anthracite-bin
|
||||||
DEPENDS anthracite-bin
|
DEPENDS anthracite-bin
|
||||||
|
|
21
Dockerfile
21
Dockerfile
|
@ -1,14 +1,21 @@
|
||||||
FROM alpine as build-env
|
FROM alpine as build-env
|
||||||
|
|
||||||
RUN apk add --no-cache build-base python3 cmake
|
RUN apk add --no-cache build-base python3 cmake
|
||||||
COPY ./src/ .
|
COPY ./src ./src
|
||||||
RUN rm -rf CMakeCache.txt CMakeFiles
|
COPY ./lib ./lib
|
||||||
RUN cmake -DCMAKE_BUILD_TYPE=Release .
|
COPY ./default_www ./default_www
|
||||||
|
COPY ./build_supp ./build_supp
|
||||||
|
COPY ./CMakeLists.txt .
|
||||||
|
|
||||||
|
|
||||||
|
RUN mkdir build
|
||||||
|
WORKDIR build
|
||||||
|
RUN cmake -DCMAKE_BUILD_TYPE=Release ..
|
||||||
RUN make anthracite-bin
|
RUN make anthracite-bin
|
||||||
|
|
||||||
FROM alpine
|
FROM alpine
|
||||||
RUN apk add --no-cache build-base
|
RUN apk add --no-cache libgcc libstdc++
|
||||||
COPY --from=build-env /anthracite /anthracite
|
COPY --from=build-env /build/anthracite-bin /anthracite-bin
|
||||||
COPY --from=build-env /www /www
|
COPY --from=build-env /build/error_pages /error_pages
|
||||||
COPY --from=build-env /error_pages /error_pages
|
COPY /default_www/docker /www
|
||||||
CMD ["/anthracite-bin"]
|
CMD ["/anthracite-bin"]
|
||||||
|
|
|
@ -15,7 +15,7 @@ Create a `build/` directory, run `cmake ..`, and then `make` to build.
|
||||||
- [x] Multithreading
|
- [x] Multithreading
|
||||||
- [x] HTTP/1.1
|
- [x] HTTP/1.1
|
||||||
- [x] Enhance logging
|
- [x] Enhance logging
|
||||||
- [-] Build out module-based backend system for handling requests
|
- [x] Create library that can be used to implement custom backends (i.e. webapi, fileserver, etc)
|
||||||
- [ ] Faster parsing
|
- [ ] Faster parsing
|
||||||
- [ ] HTTP/2
|
- [ ] HTTP/2
|
||||||
- [ ] Improve benchmarking infrastructure
|
- [ ] Improve benchmarking infrastructure
|
||||||
|
|
BIN
default_www/docker/favicon.ico
Normal file
BIN
default_www/docker/favicon.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 319 B |
9
default_www/docker/index.html
Normal file
9
default_www/docker/index.html
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
<head>
|
||||||
|
<title>Anthracite</title>
|
||||||
|
<link rel="icon" type="image/x-icon" href="/favicon.ico">
|
||||||
|
</head>
|
||||||
|
<center>
|
||||||
|
<h1>Anthracite is Running in Docker!</h1>
|
||||||
|
<p>If you are seeing this page, then Anthracite is configured correctly!</p>
|
||||||
|
<p>Add files to the "www" directory in your build step to begin serving your website.</p>
|
||||||
|
</center>
|
BIN
default_www/docker_compose/favicon.ico
Normal file
BIN
default_www/docker_compose/favicon.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 319 B |
9
default_www/docker_compose/index.html
Normal file
9
default_www/docker_compose/index.html
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
<head>
|
||||||
|
<title>Anthracite</title>
|
||||||
|
<link rel="icon" type="image/x-icon" href="/favicon.ico">
|
||||||
|
</head>
|
||||||
|
<center>
|
||||||
|
<h1>Anthracite is Running in Docker Compose!</h1>
|
||||||
|
<p>If you are seeing this page, then Anthracite is configured correctly!</p>
|
||||||
|
<p>Bind-mount a directory to "/www" to begin serving your website.</p>
|
||||||
|
</center>
|
BIN
default_www/regular/favicon.ico
Normal file
BIN
default_www/regular/favicon.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 319 B |
|
@ -1,6 +1,6 @@
|
||||||
<head>
|
<head>
|
||||||
<title>Anthracite</title>
|
<title>Anthracite</title>
|
||||||
<link rel="icon" type="image/x-icon" href="/images/favicon.ico">
|
<link rel="icon" type="image/x-icon" href="/favicon.ico">
|
||||||
</head>
|
</head>
|
||||||
<center>
|
<center>
|
||||||
<h1>Anthracite is Running!</h1>
|
<h1>Anthracite is Running!</h1>
|
9
docker-compose.yml
Normal file
9
docker-compose.yml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
services:
|
||||||
|
anthracite-web:
|
||||||
|
build: .
|
||||||
|
ports:
|
||||||
|
- "8080:80"
|
||||||
|
volumes:
|
||||||
|
- type: bind
|
||||||
|
source: ./default_www/docker_compose/
|
||||||
|
target: /www
|
|
@ -11,6 +11,8 @@
|
||||||
|
|
||||||
namespace anthracite::socket {
|
namespace anthracite::socket {
|
||||||
|
|
||||||
|
const struct timeval anthracite_socket::timeout_tv = { .tv_sec = 5, .tv_usec = 0};
|
||||||
|
|
||||||
anthracite_socket::anthracite_socket(int port, int max_queue)
|
anthracite_socket::anthracite_socket(int port, int max_queue)
|
||||||
: server_socket(::socket(AF_INET, SOCK_STREAM, 0))
|
: server_socket(::socket(AF_INET, SOCK_STREAM, 0))
|
||||||
, client_ip("")
|
, client_ip("")
|
||||||
|
|
Loading…
Reference in a new issue