Commit 27a334c6 authored by Reza Sahebgharan's avatar Reza Sahebgharan

test gitrun for windows container karname

parent 28070e6a
Pipeline #459 passed with stages
in 11 minutes and 40 seconds
variables:
TAG_VERSION: ''
REMOTE_USERNAME: 'administrator'
REMOTE_IP: 'WinRun'
stages:
- build_in_branch
- build_in_devel
- cleanup_build
- build_in_master
build_in_branch:
- build_in_devel_windows
build_in_devel:
before_script:
- $env:TAG_VERSION=(git describe --tag --abbrev=0)
- docker login -u reza.s -p aA123456 repo.marcopacs.com
stage: build_in_branch
stage: build_in_devel
tags:
- shell
script:
......@@ -32,9 +31,42 @@ build_in_branch:
- echo y | plink -batch -ssh administrator@staging.karname.ir -pw $env:StagingPass -m ./scripts/command.bat
# - ./scripts/command.ps1
allow_failure: true
except:
- master
- merge_request
only:
- devel
build_in_devel_windows:
before_script:
- $env:TAG_VERSION=(git describe --tag --abbrev=0)
- docker login -u reza.s -p aA123456 repo.marcopacs.com
stage: build_in_devel_windows
tags:
- shell
script:
- echo "starting build in devel-windows"
- npm install
- npm run test-jest
- meteor build ../output --directory --server-only
- Copy-Item -Path .\docker-compose.yml -Destination ..\output\bundle
- Copy-Item -Path .\docker\windows\Dockerfile -Destination ..\output\bundle
- cd ../output/bundle/programs/server
- npm install
- cd ../..
- docker build -t karname/app:$env:TAG_VERSION .
- echo y | plink -ssh administrator@staging.karname.ir "exit"
- docker save -o ./scripts/karname-app.tar karname/app:$env:TAG_VERSION # save docker in scripts folder
- echo y | pscp.exe -batch -l administrator -pw $env:StagingPass ./scripts/karname-app.tar staging.karname.ir:c:/Users/administrator/karname-app.tar # save docker in remote server
- echo y | plink -batch -ssh administrator@staging.karname.ir -pw $env:StagingPass docker load -i c:/Users/administrator/karname-app.tar -q
- echo y | pscp.exe -batch -l administrator -pw $env:StagingPass ./docker-compose.yml staging.karname.ir:c:/Users/administrator/docker-compose.yml # save docker-compose.yml in remote server
- Set-Variable -Name "envtext" -Value "TAG_VERSION=$env:TAG_VERSION"
- New-Item -Path '.\.env' -ItemType File
- Add-Content .\.env "$envtext"
- echo y | pscp.exe -batch -l administrator -pw $env:StagingPass ./.env staging.karname.ir:c:/Users/administrator/.env # save .env in remote server
- echo y | plink -batch -ssh administrator@staging.karname.ir -pw $env:StagingPass -m ./scripts/command.bat
# - ./scripts/command.ps1
allow_failure: true
only:
- devel-windows
build_in_master:
before_script:
......
version: '3'
services:
app:
container_name: karname-app
restart: on-failure
image: "karname/app:${TAG_VERSION}"
ports:
- '80:3000'
depends_on:
- mongo
links:
- mongo
environment:
ROOT_URL: ${APP_ROOT_URL:-http://localhost}
MONGO_URL: mongodb://mongo:27017/karname
PORT: 3000
METEOR_SETTINGS: '{"worklistUrl":"http://192.168.0.163"}'
mongo:
image: repo.marcopacs.com/kelishe/mongo:4.2.0
command:
- --storageEngine=wiredTiger
volumes:
- data:/data/db
volumes:
data:
\ No newline at end of file
......@@ -4,10 +4,7 @@ version: '3'
services:
app:
container_name: karname-app
restart: on-failure
build:
context: .
dockerfile: docker/windows/Dockerfile
restart: always
image: 'karname/app:${TAG_VERSION}'
ports:
- '80:3000'
......@@ -21,11 +18,9 @@ services:
PORT: 3000
METEOR_SETTINGS: '{"worklistUrl":"http://192.168.0.163"}'
mongo:
image: mongo
command:
- --storageEngine=wiredTiger
image: repo.marcopacs.com/karname/mongo-windows
volumes:
- data:D:\mongodata
- C:\data\db:C:\data\db
volumes:
data:
FROM mcr.microsoft.com/windows/nanoserver:1809
RUN curl.exe -o node.zip https://nodejs.org/dist/v12.9.1/node-v12.9.1-win-x64.zip && \
mkdir "C:\\Program Files\\node" && \
tar.exe -xf node.zip -C "C:\\Program Files\\node" --strip-components=1
ENV PATH "C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program Files\\node"
COPY "." "C:\\app"
CMD ["node.exe", "C:\\app\\main.js"]
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment