Commit 61fa45c8 authored by Reza Sahebgharan's avatar Reza Sahebgharan

fix(update gitlabci): update gitlab ci and docker-compose

parent cf33a022
Pipeline #874 passed with stages
in 21 seconds
...@@ -40,7 +40,7 @@ build_in_staging: ...@@ -40,7 +40,7 @@ build_in_staging:
- $env:TAG_VERSION=(git describe --tag --abbrev=0) - $env:TAG_VERSION=(git describe --tag --abbrev=0)
- $env:BRANCHFULLNAME=(git name-rev --name-only HEAD) - $env:BRANCHFULLNAME=(git name-rev --name-only HEAD)
- $env:BRANCHNAME=$env:BRANCHFULLNAME.Split('/')[$env:BRANCHFULLNAME.Split('/').length - 1] - $env:BRANCHNAME=$env:BRANCHFULLNAME.Split('/')[$env:BRANCHFULLNAME.Split('/').length - 1]
- echo $env:BRANCHNAME.Split('_')[1] - $env:CONTAINERNAME=$env:BRANCHNAME.Split('_')[1]
- docker login -u reza.s -p aA123456 repo.marcopacs.com - docker login -u reza.s -p aA123456 repo.marcopacs.com
stage: build_in_staging stage: build_in_staging
tags: tags:
...@@ -54,17 +54,20 @@ build_in_staging: ...@@ -54,17 +54,20 @@ build_in_staging:
- Copy-Item -Path .\docker\windows\Dockerfile -Destination C:\output\bundle - Copy-Item -Path .\docker\windows\Dockerfile -Destination C:\output\bundle
- Copy-Item -Path .\scripts\command.bat -Destination C:\output\bundle - Copy-Item -Path .\scripts\command.bat -Destination C:\output\bundle
- cd C:\output\bundle\programs\server - cd C:\output\bundle\programs\server
- npm install - npm install
- cd ../.. - cd ../..
- docker build -t karname-app:$env:TAG_VERSION . - docker build -t karname-app:$env:TAG_VERSION .
- docker push repo.marcopacs.com/karname/karname-app:$env:TAG_VERSION
- echo y | plink -ssh administrator@staging.karname.ir "exit" - echo y | plink -ssh administrator@staging.karname.ir "exit"
- docker save -o ./karname-app.tar karname-app:$env:TAG_VERSION # save docker in scripts folder # - docker save -o ./karname-app.tar karname-app:$env:TAG_VERSION # save docker in scripts folder
- echo y | pscp.exe -batch -l administrator -pw $env:StagingPass ./karname-app.tar staging.karname.ir:c:/Users/administrator/karname-app.tar # save docker in remote server # - echo y | pscp.exe -batch -l administrator -pw $env:StagingPass ./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 | 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 - 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" - Set-Variable -Name "envtext" -Value "TAG_VERSION=$env:TAG_VERSION"
- New-Item -Path '.\.env' -ItemType File - New-Item -Path '.\.env' -ItemType File
- Add-Content .\.env "$envtext" - Add-Content .\.env "$envtext"
- Set-Variable -Name "envtext1" -Value "CONTAINERNAME=$env:CONTAINERNAME"
- Add-Content .\.env "$envtext1"
- 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 | 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 ./command.bat - echo y | plink -batch -ssh administrator@staging.karname.ir -pw $env:StagingPass -m ./command.bat
# - ./scripts/command.ps1 # - ./scripts/command.ps1
...@@ -74,6 +77,8 @@ build_in_staging: ...@@ -74,6 +77,8 @@ build_in_staging:
only: only:
- /^.*staging_.*/ - /^.*staging_.*/
build_in_master: build_in_master:
before_script: before_script:
- $env:TAG_VERSION=(git describe --tag --abbrev=0) - $env:TAG_VERSION=(git describe --tag --abbrev=0)
......
...@@ -2,9 +2,9 @@ version: "3" ...@@ -2,9 +2,9 @@ version: "3"
services: services:
app: app:
container_name: karname-app container_name: ${CONTAINERNAME} #karname-app
restart: always restart: always
image: "karname-app:${TAG_VERSION}" image: repo.marcopacs.com/karname/karname-app:${TAG_VERSION} #"karname-app:${TAG_VERSION}"
# ports: # ports:
# - "80:3000" # - "80:3000"
# depends_on: # depends_on:
......
...@@ -30,8 +30,6 @@ if (Meteor.isClient || Meteor.isCordova) { ...@@ -30,8 +30,6 @@ if (Meteor.isClient || Meteor.isCordova) {
collections[collName] = new Mongo.Collection(collName); collections[collName] = new Mongo.Collection(collName);
} }
}); });
} }
export default collections; export default collections;
\ 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