From efccafed3b322eae5e9a6510a692268c5a51ad82 Mon Sep 17 00:00:00 2001 From: Pavel Dmitriev Date: Thu, 12 May 2022 17:35:29 +0300 Subject: [PATCH] Added CI --- .agola/config.yml | 44 ++++++++++++++++++ Dockerfile | 28 +++++------ build.sh | 3 -- localtime => rootfs/etc/localtime | Bin nginx.conf => rootfs/etc/nginx/nginx.conf | 0 .../etc/nginx/proxy-params.conf | 0 .../etc/supervisor/conf.d/supervisord.conf | 0 timezone => rootfs/etc/timezone | 0 8 files changed, 55 insertions(+), 20 deletions(-) create mode 100644 .agola/config.yml delete mode 100755 build.sh rename localtime => rootfs/etc/localtime (100%) rename nginx.conf => rootfs/etc/nginx/nginx.conf (100%) rename proxy-params.conf => rootfs/etc/nginx/proxy-params.conf (100%) rename supervisord.conf => rootfs/etc/supervisor/conf.d/supervisord.conf (100%) rename timezone => rootfs/etc/timezone (100%) diff --git a/.agola/config.yml b/.agola/config.yml new file mode 100644 index 0000000..fb68e72 --- /dev/null +++ b/.agola/config.yml @@ -0,0 +1,44 @@ +version: v0 +runs: + - name: Build image + docker_registries_auth: + 'mxfox.ru': + username: + from_variable: mxfoxDockerLogin + password: + from_variable: mxfoxDockerSecret + tasks: + - name: build docker image + runtime: + containers: + - image: mxfox.ru/mxfox/docker-dind.buildx:latest + privileged: true + #shell: /busybox/sh + working_dir: /workspace + environment: + DOCKERLOGIN: + from_variable: mxfoxDockerLogin + DOCKERPASS: + from_variable: mxfoxDockerSecret + steps: + - clone: + - run: + name: buildX prepare + command: buildx-bgstart.sh + + - run: + name: buildX build + command: | + case ${AGOLA_GIT_BRANCH} in + master) + export xBuildSuffix=" -t mxfox.ru/mxfox/fox-proxy-lessl:latest --push" + ;; + test) + export xBuildSuffix=" -t mxfox.ru/mxfox/fox-proxy-lessl:test --push" + ;; + *) + export xBuildSuffix="" + ;; + esac + docker login mxfox.ru -u ${DOCKERLOGIN} -p ${DOCKERPASS} + docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 . ${xBuildSuffix} \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 9a2cd1d..045f246 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,22 +1,16 @@ -FROM ubuntu +FROM ubuntu:21.10 -#COPY apt-add-repos /usr/local/sbin -COPY timezone /etc/timezone -COPY localtime /etc/localtime +RUN apt-get update -y \ + && apt-get install -y \ + nginx \ + supervisor \ + certbot \ + python3-certbot-nginx \ + cron \ + && rm -rf /tmp/* \ + && rm -rf /var/lib/apt/lists/* -RUN apt update -y \ - && apt-get install nginx supervisor -y - -RUN apt-get install certbot python-certbot-nginx cron -y - -#RUN rm -rf /var/www/html -COPY nginx.conf /etc/nginx/ -COPY proxy-params.conf /etc/nginx/ -#COPY fox-web /var/www/html - -#RUN a2enmod rewrite - -COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf +COPY ./rootfs / EXPOSE 80 EXPOSE 443 diff --git a/build.sh b/build.sh deleted file mode 100755 index 064294d..0000000 --- a/build.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -docker build --tag=git.mxfox.ru/fox-proxy-lessl . diff --git a/localtime b/rootfs/etc/localtime similarity index 100% rename from localtime rename to rootfs/etc/localtime diff --git a/nginx.conf b/rootfs/etc/nginx/nginx.conf similarity index 100% rename from nginx.conf rename to rootfs/etc/nginx/nginx.conf diff --git a/proxy-params.conf b/rootfs/etc/nginx/proxy-params.conf similarity index 100% rename from proxy-params.conf rename to rootfs/etc/nginx/proxy-params.conf diff --git a/supervisord.conf b/rootfs/etc/supervisor/conf.d/supervisord.conf similarity index 100% rename from supervisord.conf rename to rootfs/etc/supervisor/conf.d/supervisord.conf diff --git a/timezone b/rootfs/etc/timezone similarity index 100% rename from timezone rename to rootfs/etc/timezone