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:
- $env:TAG_VERSION=(git describe --tag --abbrev=0)
- $env:BRANCHFULLNAME=(git name-rev --name-only HEAD)
- $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
stage: build_in_staging
tags:
......@@ -57,14 +57,17 @@ build_in_staging:
- npm install
- cd ../..
- 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"
- 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 | plink -batch -ssh administrator@staging.karname.ir -pw $env:StagingPass docker load -i c:/Users/administrator/karname-app.tar -q
# - 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 | 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"
- 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 | plink -batch -ssh administrator@staging.karname.ir -pw $env:StagingPass -m ./command.bat
# - ./scripts/command.ps1
......@@ -74,6 +77,8 @@ build_in_staging:
only:
- /^.*staging_.*/
build_in_master:
before_script:
- $env:TAG_VERSION=(git describe --tag --abbrev=0)
......
......@@ -2,9 +2,9 @@ version: "3"
services:
app:
container_name: karname-app
container_name: ${CONTAINERNAME} #karname-app
restart: always
image: "karname-app:${TAG_VERSION}"
image: repo.marcopacs.com/karname/karname-app:${TAG_VERSION} #"karname-app:${TAG_VERSION}"
# ports:
# - "80:3000"
# depends_on:
......
......@@ -30,8 +30,6 @@ if (Meteor.isClient || Meteor.isCordova) {
collections[collName] = new Mongo.Collection(collName);
}
});
}
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