generated from azmisahin/azmisahin-software-repository-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from azmisahin/stage
Stage
- Loading branch information
Showing
13 changed files
with
290 additions
and
66 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
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
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 @@ | ||
build |
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,14 @@ | ||
# product | ||
ENV="production" | ||
NAME="connector" | ||
CONTAINER="linux" | ||
|
||
# build | ||
WORK_DIR="/connector" | ||
BUILD_DIR="build" | ||
DIST_DIR="dist" | ||
|
||
# application | ||
REMOTE_IP_ADDRESS="198.41.0.4" | ||
REMOTE_PORT="53" | ||
CLIENT_MESSAGE="-1" |
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,58 @@ | ||
# base operation system image | ||
FROM ubuntu:latest AS production | ||
|
||
# Metadata indicating an image maintainer. | ||
LABEL maintainer="Azmi ŞAHİN <[email protected]>" | ||
|
||
# product arguments | ||
ARG ENV="production" | ||
ARG NAME="connector" | ||
|
||
# default arguments for build | ||
ARG WORK_DIR="/connector" | ||
ARG BUILD_DIR="build" | ||
ARG DIST_DIR="dist" | ||
|
||
# default arguments for application | ||
ARG REMOTE_IP_ADDRESS="198.41.0.4" | ||
ARG REMOTE_PORT="53" | ||
ARG CLIENT_MESSAGE="0" | ||
|
||
# product environment | ||
ENV ENV=${ENV} | ||
ENV NAME=${NAME} | ||
|
||
# default envionment for build | ||
ENV WORK_DIR=${WORK_DIR} | ||
ENV BUILD_DIR=${BUILD_DIR} | ||
ENV DIST_DIR=${DIST_DIR} | ||
|
||
# default environment for application | ||
ENV REMOTE_IP_ADDRESS=${REMOTE_IP_ADDRESS} | ||
ENV REMOTE_PORT=${REMOTE_PORT} | ||
ENV CLIENT_MESSAGE=${CLIENT_MESSAGE} | ||
|
||
# make the 'application' folder the current working directory | ||
WORKDIR ${WORK_DIR} | ||
|
||
# copy project file the working directory | ||
COPY . . | ||
|
||
# install project dependencies | ||
RUN apt-get update | ||
RUN apt-get -y install build-essential | ||
RUN apt-get -y install clang | ||
RUN apt-get -y install cmake | ||
|
||
# build | ||
RUN mkdir ${BUILD_DIR} && \ | ||
cd ${BUILD_DIR} && \ | ||
cmake .. &&\ | ||
make &&\ | ||
mkdir ${DIST_DIR} && \ | ||
mkdir ${DIST_DIR}_test && \ | ||
cp ./${NAME} ${DIST_DIR} && \ | ||
cp ./${NAME}_test ${DIST_DIR}_test | ||
|
||
# test | ||
CMD ["bash", "-c", "${WORK_DIR}/${BUILD_DIR}/${DIST_DIR}_test/${NAME}_test ${REMOTE_IP_ADDRESS} ${REMOTE_PORT} \"${CLIENT_MESSAGE}\""] |
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,58 @@ | ||
# base operation system image | ||
FROM mcr.microsoft.com/windows/servercore:ltsc2019 as production | ||
|
||
# Metadata indicating an image maintainer. | ||
LABEL maintainer="Azmi ŞAHİN <[email protected]>" | ||
|
||
# product arguments | ||
ARG ENV="production" | ||
ARG NAME="connector" | ||
|
||
# default arguments for build | ||
ARG WORK_DIR="/connector" | ||
ARG BUILD_DIR="build" | ||
ARG DIST_DIR="dist" | ||
|
||
# default arguments for application | ||
ARG REMOTE_IP_ADDRESS="198.41.0.4" | ||
ARG REMOTE_PORT="53" | ||
ARG CLIENT_MESSAGE="0" | ||
|
||
# product environment | ||
ENV ENV=${ENV} | ||
ENV NAME=${NAME} | ||
|
||
# default envionment for build | ||
ENV WORK_DIR=${WORK_DIR} | ||
ENV BUILD_DIR=${BUILD_DIR} | ||
ENV DIST_DIR=${DIST_DIR} | ||
|
||
# default environment for application | ||
ENV REMOTE_IP_ADDRESS=${REMOTE_IP_ADDRESS} | ||
ENV REMOTE_PORT=${REMOTE_PORT} | ||
ENV CLIENT_MESSAGE=${CLIENT_MESSAGE} | ||
|
||
# make the 'application' folder the current working directory | ||
WORKDIR ${WORK_DIR} | ||
|
||
# copy project file the working directory | ||
COPY . . | ||
|
||
# install project dependencies | ||
# update | ||
# install build tools | ||
# install clang | ||
# install cmake | ||
|
||
# build | ||
RUN mkdir %BUILD_DIR% && \ | ||
cd %BUILD_DIR% && \ | ||
echo cmake .. &&\ | ||
echo make &&\ | ||
mkdir %DIST_DIR% && \ | ||
mkdir %DIST_DIR%_test && \ | ||
echo copy ./%NAME%.exe %DIST_DIR% && \ | ||
echo copy ./%NAME%_test.exe %DIST_DIR%_test.exe | ||
|
||
# test | ||
RUN echo %WORK_DIR%/%BUILD_DIR%/%DIST_DIR%_test/%NAME%_test.exe %REMOTE_IP_ADDRESS% %REMOTE_PORT% "%CLIENT_MESSAGE%" |
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,39 @@ | ||
version: '3.8' | ||
services: | ||
application: | ||
build: | ||
context: . | ||
# load operating system container | ||
dockerfile: Dockerfile.${CONTAINER} | ||
args: | ||
# build | ||
NAME: ${NAME} | ||
WORK_DIR: ${WORK_DIR} | ||
BUILD_DIR: ${BUILD_DIR} | ||
DIST_DIR: ${DIST_DIR} | ||
|
||
# application | ||
REMOTE_IP_ADDRESS: ${REMOTE_IP_ADDRESS} | ||
REMOTE_PORT: ${REMOTE_PORT} | ||
CLIENT_MESSAGE: ${CLIENT_MESSAGE} | ||
labels: | ||
com.azmisahin.description: ${NAME} | ||
com.azmisahin.department: "DEVOPS" | ||
# stage | ||
target: ${ENV} | ||
container_name: ${NAME}-${CONTAINER} | ||
environment: | ||
# build | ||
NAME: ${NAME} | ||
WORK_DIR: ${WORK_DIR} | ||
BUILD_DIR: ${BUILD_DIR} | ||
DIST_DIR: ${DIST_DIR} | ||
|
||
# application | ||
REMOTE_IP_ADDRESS: ${REMOTE_IP_ADDRESS} | ||
REMOTE_PORT: ${REMOTE_PORT} | ||
CLIENT_MESSAGE: ${CLIENT_MESSAGE} | ||
networks: | ||
default: null | ||
restart: "no" | ||
tty: true |
This file was deleted.
Oops, something went wrong.
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
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
Oops, something went wrong.