improved makefile; updated teamcity imakes

This commit is contained in:
Anatolii Zimovskii 2022-03-21 13:25:32 +03:00
parent 135622b939
commit 1d4298ba80
Signed by: stam
GPG Key ID: AA3A575AB99E8469
10 changed files with 234 additions and 36 deletions

View File

@ -1,4 +1,4 @@
VERSION = "2022.03.01"
VERSION = "2022.03.21"
AUTHOR = "EpicMorg"
MODIFIED = "AlexZ"
DOCKER_SCAN_SUGGEST = false
@ -53,19 +53,35 @@ advanced-images:
@echo "======================================="
@echo "===== Building third-party images ====="
@echo "======================================="
make advanced-mattermost-images
make advanced-nextcloud-latest-images
make advanced-teamcity-server-images
make advanced-redash-images
make advanced-zabbix-images
make advanced-nextcloud-images
make advanced-nextcloud-patched-images
advanced-mattermost-images:
cd `pwd`/linux/advanced/mattermost && pwd && make
advanced-nextcloud-latest-images:
cd `pwd`/linux/advanced/nextcloud/pure/latest && pwd && make
cd `pwd`/linux/advanced/nextcloud/patched/latest && pwd && make
advanced-teamcity-server-images:
cd `pwd`/linux/advanced/teamcity/server && pwd && make
advanced-redash-images:
cd `pwd`/linux/advanced/redash && pwd && make
advanced-zabbix-images:
cd `pwd`/linux/advanced/zabbix/agent && pwd && make
cd `pwd`/linux/advanced/zabbix/java-gateway && pwd && make
cd `pwd`/linux/advanced/zabbix/proxy && pwd && make
cd `pwd`/linux/advanced/zabbix/server && pwd && make
cd `pwd`/linux/advanced/zabbix/web && pwd && make
cd `pwd`/linux/advanced/mattermost && pwd && make
cd `pwd`/linux/advanced/nextcloud/pure/latest && pwd && make
cd `pwd`/linux/advanced/nextcloud/patched/latest && pwd && make
cd `pwd`/linux/advanced/teamcity/server && pwd && make
cd `pwd`/linux/advanced/redash && pwd && make
advanced-nextcloud-images:
cd `pwd`/linux/advanced/nextcloud/pure/14 && pwd && make
cd `pwd`/linux/advanced/nextcloud/pure/15 && pwd && make
cd `pwd`/linux/advanced/nextcloud/pure/16 && pwd && make
@ -77,6 +93,7 @@ advanced-images:
cd `pwd`/linux/advanced/nextcloud/pure/22 && pwd && make
cd `pwd`/linux/advanced/nextcloud/pure/23 && pwd && make
advanced-nextcloud-patched-images:
cd `pwd`/linux/advanced/nextcloud/patched/14 && pwd && make
cd `pwd`/linux/advanced/nextcloud/patched/15 && pwd && make
cd `pwd`/linux/advanced/nextcloud/patched/16 && pwd && make
@ -92,7 +109,22 @@ ecosystem-images:
@echo "======================================="
@echo "===== Building EpicMorg images ====="
@echo "======================================="
make ecosystem-prod-images
make ecosystem-edge-images
make ecosystem-devel-images
make ecosystem-php-images
make ecosystem-apache2-images
make ecosystem-testrail-images
make ecosystem-torrserver-images
make ecosystem-nodejs-images
make ecosystem-qbittorrent-images
make ecosystem-vk2discord-images
make ecosystem-postgres-images
make ecosystem-teamcity-agent-images
make ecosystem-nginx-images
make ecosystem-vscode-server-images
ecosystem-prod-images:
cd `pwd`/linux/ecosystem/epicmorg/prod/main && pwd && make
cd `pwd`/linux/ecosystem/epicmorg/prod/jdk6 && pwd && make
cd `pwd`/linux/ecosystem/epicmorg/prod/jdk7 && pwd && make
@ -100,6 +132,7 @@ ecosystem-images:
cd `pwd`/linux/ecosystem/epicmorg/prod/jdk11 && pwd && make
cd `pwd`/linux/ecosystem/epicmorg/prod/jdk16 && pwd && make
ecosystem-edge-images:
cd `pwd`/linux/ecosystem/epicmorg/edge/main && pwd && make
cd `pwd`/linux/ecosystem/epicmorg/edge/jdk6 && pwd && make
cd `pwd`/linux/ecosystem/epicmorg/edge/jdk7 && pwd && make
@ -107,6 +140,7 @@ ecosystem-images:
cd `pwd`/linux/ecosystem/epicmorg/edge/jdk11 && pwd && make
cd `pwd`/linux/ecosystem/epicmorg/edge/jdk16 && pwd && make
ecosystem-devel-images:
cd `pwd`/linux/ecosystem/epicmorg/devel/main && pwd && make
cd `pwd`/linux/ecosystem/epicmorg/devel/jdk6 && pwd && make
cd `pwd`/linux/ecosystem/epicmorg/devel/jdk7 && pwd && make
@ -114,24 +148,29 @@ ecosystem-images:
cd `pwd`/linux/ecosystem/epicmorg/devel/jdk11 && pwd && make
cd `pwd`/linux/ecosystem/epicmorg/devel/jdk16 && pwd && make
ecosystem-php-images:
cd `pwd`/linux/ecosystem/php/latest && pwd && make
cd `pwd`/linux/ecosystem/php/php7.2 && pwd && make
cd `pwd`/linux/ecosystem/php/php7.3 && pwd && make
cd `pwd`/linux/ecosystem/php/php7.4 && pwd && make
cd `pwd`/linux/ecosystem/php/php8.0 && pwd && make
ecosystem-apache2-images:
cd `pwd`/linux/ecosystem/apache2/latest && pwd && make
cd `pwd`/linux/ecosystem/apache2/php7.2 && pwd && make
cd `pwd`/linux/ecosystem/apache2/php7.3 && pwd && make
cd `pwd`/linux/ecosystem/apache2/php7.4 && pwd && make
cd `pwd`/linux/ecosystem/apache2/php8.0 && pwd && make
ecosystem-testrail-images:
cd `pwd`/linux/ecosystem/testrail/latest && pwd && make
cd `pwd`/linux/ecosystem/testrail/ad && pwd && make
cd `pwd`/linux/ecosystem/testrail/ldap && pwd && make
ecosystem-torrserver-images:
cd `pwd`/linux/ecosystem/torrserver && pwd && make
ecosystem-nodejs-images:
cd `pwd`/linux/ecosystem/nodejs/current && pwd && make
cd `pwd`/linux/ecosystem/nodejs/lts && pwd && make
cd `pwd`/linux/ecosystem/nodejs/node10 && pwd && make
@ -143,6 +182,14 @@ ecosystem-images:
cd `pwd`/linux/ecosystem/nodejs/node16 && pwd && make
cd `pwd`/linux/ecosystem/nodejs/node17 && pwd && make
ecosystem-vk2discord-images:
cd `pwd`/linux/ecosystem/vk2discord && pwd && make
ecosystem-qbittorrent-images:
cd `pwd`/linux/ecosystem/qbittorrent/latest && pwd && make
cd `pwd`/linux/ecosystem/qbittorrent/stable && pwd && make
ecosystem-postgres-images:
cd `pwd`/linux/ecosystem/postgres/latest && pwd && make
cd `pwd`/linux/ecosystem/postgres/8.2 && pwd && make
cd `pwd`/linux/ecosystem/postgres/8.3 && pwd && make
@ -160,13 +207,8 @@ ecosystem-images:
cd `pwd`/linux/ecosystem/postgres/13 && pwd && make
cd `pwd`/linux/ecosystem/postgres/14 && pwd && make
cd `pwd`/linux/ecosystem/qbittorrent/latest && pwd && make
cd `pwd`/linux/ecosystem/qbittorrent/stable && pwd && make
cd `pwd`/linux/ecosystem/vk2discord && pwd && make
ecosystem-teamcity-agent-images:
cd `pwd`/linux/ecosystem/teamcity/agent/latest && pwd && make
cd `pwd`/linux/ecosystem/teamcity/agent/amxx-sdk && pwd && make
cd `pwd`/linux/ecosystem/teamcity/agent/android-sdk && pwd && make
cd `pwd`/linux/ecosystem/teamcity/agent/atlassian-sdk && pwd && make
@ -175,16 +217,19 @@ ecosystem-images:
cd `pwd`/linux/ecosystem/teamcity/agent/node14 && pwd && make
cd `pwd`/linux/ecosystem/teamcity/agent/node15 && pwd && make
cd `pwd`/linux/ecosystem/teamcity/agent/node16 && pwd && make
cd `pwd`/linux/ecosystem/teamcity/agent/node17 && pwd && make
cd `pwd`/linux/ecosystem/teamcity/agent/php7.2 && pwd && make
cd `pwd`/linux/ecosystem/teamcity/agent/php7.3 && pwd && make
cd `pwd`/linux/ecosystem/teamcity/agent/php7.4 && pwd && make
cd `pwd`/linux/ecosystem/teamcity/agent/php8.0 && pwd && make
cd `pwd`/linux/ecosystem/teamcity/agent/steam-sdk && pwd && make
ecosystem-nginx-images:
cd `pwd`/linux/ecosystem/nginx/latest/main && pwd && make
cd `pwd`/linux/ecosystem/nginx/latest/php && pwd && make
cd `pwd`/linux/ecosystem/nginx/latest/rtmp-hls && pwd && make
ecosystem-vscode-server-images:
cd `pwd`/linux/advanced/vscode-server/latest && pwd && make build && make deploy
cd `pwd`/linux/advanced/vscode-server/devops && pwd && make build && make deploy
cd `pwd`/linux/advanced/vscode-server/amxx && pwd && make build && make deploy

View File

@ -5,6 +5,9 @@ ARG DEBIAN_FRONTEND=noninteractive
##################################################################
# Node.js 12.x
##################################################################
RUN groupadd --gid 1000 node \
&& useradd --uid 1000 --gid node --shell /bin/bash --create-home node
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash - && \
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - && \
echo "deb https://nightly.yarnpkg.com/debian/ nightly main" > /etc/apt/sources.list.d/yarn.list && \

View File

@ -5,6 +5,9 @@ ARG DEBIAN_FRONTEND=noninteractive
##################################################################
# Node.js 14.x
##################################################################
RUN groupadd --gid 1000 node \
&& useradd --uid 1000 --gid node --shell /bin/bash --create-home node
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - && \
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - && \
echo "deb https://nightly.yarnpkg.com/debian/ nightly main" > /etc/apt/sources.list.d/yarn.list && \

View File

@ -5,6 +5,9 @@ ARG DEBIAN_FRONTEND=noninteractive
##################################################################
# Node.js 15.x
##################################################################
RUN groupadd --gid 1000 node \
&& useradd --uid 1000 --gid node --shell /bin/bash --create-home node
RUN curl -sL https://deb.nodesource.com/setup_15.x | bash - && \
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - && \
echo "deb https://nightly.yarnpkg.com/debian/ nightly main" > /etc/apt/sources.list.d/yarn.list && \

View File

@ -5,6 +5,9 @@ ARG DEBIAN_FRONTEND=noninteractive
##################################################################
# Node.js 16.x
##################################################################
RUN groupadd --gid 1000 node \
&& useradd --uid 1000 --gid node --shell /bin/bash --create-home node
RUN curl -sL https://deb.nodesource.com/setup_16.x | bash - && \
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - && \
echo "deb https://nightly.yarnpkg.com/debian/ nightly main" > /etc/apt/sources.list.d/yarn.list && \

View File

@ -0,0 +1,38 @@
FROM epicmorg/teamcity-agent:latest
LABEL maintainer="EpicMorg DevTeam, developer@epicm.org"
ARG DEBIAN_FRONTEND=noninteractive
##################################################################
# Node.js 17.x
##################################################################
RUN groupadd --gid 1000 node \
&& useradd --uid 1000 --gid node --shell /bin/bash --create-home node
RUN curl -sL https://deb.nodesource.com/setup_17.x | bash - && \
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - && \
echo "deb https://nightly.yarnpkg.com/debian/ nightly main" > /etc/apt/sources.list.d/yarn.list && \
apt-get update && \
apt-get install -y nodejs yarn
# curl -L https://www.npmjs.com/install.sh | sh
# npm install -g npm
RUN echo "=============================================" && \
echo node $(node --version) && \
echo npm $(npm --version) && \
echo yarn $(yarn --version) && \
echo "============================================="
##################################################################
# cleaninig up
##################################################################
RUN apt clean -y && \
apt-get clean all && \
apt autoclean -y && \
rm -rfv /var/lib/apt/lists/* && \
rm -rfv /var/cache/apt/archives/*.deb && \
rm -rfv /tmp/deb/* && \
rm -rfv /tmp/composer-setup.php && \
rm -rfv /tmp/amxx_base_latest.tar.gz && \
rm -rfv /tmp/atlassian-plugin-sdk.deb && \
rm -rfv /tmp/addons

View File

@ -0,0 +1,19 @@
all: app
app:
make build
make deploy
make clean
build:
docker-compose build --compress --parallel
deploy:
docker-compose push
clean:
docker container prune -f
docker image prune -f
docker network prune -f
docker volume prune -f
docker system prune -af

View File

@ -0,0 +1,93 @@
## TeamCity Minimal Build Agent
[<img src="http://jb.gg/badges/official.svg" height="20"/>](https://confluence.jetbrains.com/display/ALL/JetBrains+on+GitHub)
This is an official [JetBrains TeamCity](https://www.jetbrains.com/teamcity/) minimal build agent image.
<img src="https://raw.githubusercontent.com/JetBrains/teamcity-docker-images/master/logo/GitHub.png" height="20" align="center"/> More details about tags and components are [here](https://github.com/JetBrains/teamcity-docker-images/blob/master/generated/teamcity-minimal-agent.md).
The [TeamCity build agent](https://www.jetbrains.com/help/teamcity/build-agent.html) connects to the TeamCity server and spawns the actual build processes.
You can use the ```jetbrains/teamcity-server``` image to run a TeamCity server.
This minimal image adds just a TeamCity agent without any tools like VCS clients, etc. It is suitable for simple builds and can serve as a base for your custom images. For Java or .NET development we recommend using the default build agent image [jetbrains/teamcity-agent](https://hub.docker.com/r/jetbrains/teamcity-agent/).
## How to Use This Image
Pull the TeamCity minimal image from the Docker Hub Repository:
```
jetbrains/teamcity-minimal-agent
```
&nbsp;
and use the following command to start a container with TeamCity agent running inside
a Linux container:
```
docker run -it -e SERVER_URL="<url to TeamCity server>" \
-v <path to agent config folder>:/data/teamcity_agent/conf \
jetbrains/teamcity-minimal-agent
```
&nbsp;
or a Windows container:
```
docker run -it -e SERVER_URL="<url to TeamCity server>"
-v <path to agent config folder>:C:/BuildAgent/conf
jetbrains/teamcity-minimal-agent
```
where `<url to TeamCity server>` is the full URL for TeamCity server, accessible by the agent. Note that `localhost` will not generally not work as it will refer to the `localhost` inside the container.
`<path to agent config folder>` is the host machine directory to serve as the TeamCity agent config directory. We recommend providing this binding in order to persist the agent configuration, e.g. authorization on the server. Note that you should map a different folder for every new agent you create.
Since version 2020.1, TeamCity agent Docker images __run under a non-root user__. Refer to our [upgrade notes](https://www.jetbrains.com/help/teamcity/upgrade-notes.html#UpgradeNotes-AgentDockerimagesrunundernon-rootuser) for information on possible affected use cases.
When you run the agent for the first time, you should authorize it via the TeamCity server UI: go to the **Unauthorized Agents** page in your browser. See [more details](https://www.jetbrains.com/help/teamcity/build-agent.html).
All information about agent authorization is stored in agent's configuration folder. If you stop the container with the agent and then start a new one with the same config folder, the agent's name and authorization state will be preserved.
TeamCity agent does not need manual upgrade: it will upgrade itself automatically on connecting to an upgraded server.
### Agent Image Environment Variables
- **SERVER_URL** - URL of the TeamCity server agent will connect to
- **AGENT_NAME** - (optional) Name of the agent in TeamCity UI, autogenerated if omitted
- **AGENT_TOKEN** - (optional) Agent authorization token, if unset, the agent should be [authorized](https://www.jetbrains.com/help/teamcity/build-agent.html#BuildAgent-BuildAgentStatus) via TeamCity UI.
- **OWN_ADDRESS** - (optional, linux only) IP address build agent binds to, autodetected
- **OWN_PORT** - (optional, linux only) Port build agent binds to, 9090 by default
### Windows Containers Limitations
The details on the known problems in Windows containers are available in the [TeamCity documentation](https://www.jetbrains.com/help/teamcity/known-issues.html#KnownIssues-WindowsDockerContainers).
## Customization
You can customize the image via the usual Docker procedure:
1. Run the image
```
docker run -it -e SERVER_URL="<url to TeamCity server>" \
-v <path to agent config folder>:/data/teamcity_agent/conf \
--name="my-customized-agent" \
jetbrains/teamcity-minimal-agent \
```
2. Enter the container
```
docker exec -it my-customized-agent bash
```
3. Change whatever you need
4. Exit and [create a new image](https://docs.docker.com/engine/reference/commandline/commit/) from the container
```
docker commit my-customized-agent <the registry where you what to store the image>
```
## License
The image is available under the [TeamCity license](https://www.jetbrains.com/teamcity/buy/license.html).
TeamCity is free for perpetual use with the limitation of 100 build configurations (jobs) and 3 agents. [Licensing details](https://www.jetbrains.com/help/teamcity/licensing-policy.html).
## Feedback
Report issues of suggestions to the official TeamCity [issue tracker](https://youtrack.jetbrains.com/issues/TW).
## Other TeamCity Images
* [TeamCity Server](https://hub.docker.com/r/jetbrains/teamcity-server/)
* [Build Agent](https://hub.docker.com/r/jetbrains/teamcity-agent/)

View File

@ -0,0 +1,6 @@
version: '3.9'
services:
app:
image: "epicmorg/teamcity-agent:node17"
build:
context: .

View File

@ -1,36 +1,20 @@
FROM epicmorg/devel AS builder
FROM epicmorg/nodejs:node17
LABEL maintainer="EpicMorg DevTeam, developer@epicm.org"
ARG DEBIAN_FRONTEND=noninteractive
WORKDIR /tmp
RUN git clone https://github.com/MrZillaGold/VK2Discord.git vk2discord
FROM epicmorg/edge
LABEL maintainer="EpicMorg DevTeam, developer@epicm.org"
ARG DEBIAN_FRONTEND=noninteractive
##################################################################
# Node.js 16.x
##################################################################
RUN curl -sL https://deb.nodesource.com/setup_16.x | bash - && \
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - && \
echo "deb https://nightly.yarnpkg.com/debian/ nightly main" > /etc/apt/sources.list.d/yarn.list && \
apt-get update && \
apt-get install -y nodejs yarn
##################################################################
# Installing vk2discord
##################################################################
WORKDIR /usr/src/vk2discord
RUN git clone https://github.com/MrZillaGold/VK2Discord.git /tmp/vk2discord
COPY --from=builder /tmp/vk2discord/package*.json /usr/src/vk2discord/
RUN cp -rvf /tmp/vk2discord/package*.json /usr/src/vk2discord/
RUN npm install -g
RUN npm config set engine-strict false && \
npm install -g
COPY --from=builder /tmp/vk2discord/* /usr/src/vk2discord/
RUN cp -rfv /tmp/vk2discord/* /usr/src/vk2discord/
##################################################################
# cleaninig up
@ -39,6 +23,7 @@ RUN apt clean -y && \
apt-get clean all && \
apt autoclean -y && \
rm -rfv /var/lib/apt/lists/* && \
rm -rfv /tmp/vk2discord/* && \
rm -rfv /var/cache/apt/archives/*.deb
CMD npm start