feat(artifacts): demo scripts for bitrix and upload dirs backup #1

parent 65d4df8b
#!/bin/bash
export ARTIFACTS_PATH="$HOME/localartifacts/$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME/$CI_PIPELINE_ID/"
mkdir -p $ARTIFACTS_PATH
tar -czf bitrix.tar.gz www/bitrix/ www/upload/
mv bitrix.tar.gz $ARTIFACTS_PATH
...@@ -9,18 +9,14 @@ variables: ...@@ -9,18 +9,14 @@ variables:
save_user_data: save_user_data:
stage: startup stage: startup
script: script:
- echo 'Create artifacts for Bitrix core' - bash backup_bitrix.sh
# - export
variables: variables:
GIT_STRATEGY: none GIT_STRATEGY: none
cache: cache:
paths: paths:
- www/bitrix/ - www/bitrix/
- www/upload/ - www/upload/
artifacts:
paths:
- www/bitrix/
- www/upload/
expire_in: 1 day
startup: startup:
stage: startup stage: startup
...@@ -43,6 +39,7 @@ startup: ...@@ -43,6 +39,7 @@ startup:
.migrations: .migrations:
stage: build stage: build
script: script:
- bash restore_bitrix.sh
- docker-compose exec -T bitrix bash -c 'composer update' - docker-compose exec -T bitrix bash -c 'composer update'
- docker-compose exec -T bitrix bash -c 'php migrator migrate' - docker-compose exec -T bitrix bash -c 'php migrator migrate'
cache: cache:
...@@ -52,7 +49,9 @@ startup: ...@@ -52,7 +49,9 @@ startup:
deploy: deploy:
stage: deploy stage: deploy
script: script:
- bash restore_bitrix.sh
- echo 'Get all artifacts from previous stages, so site working properly' - echo 'Get all artifacts from previous stages, so site working properly'
# - export
.restore_bitrix: .restore_bitrix:
stage: build stage: build
......
#!/bin/bash
export ARTIFACTS_PATH="$HOME/localartifacts/$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME/$CI_PIPELINE_ID/"
cp $ARTIFACTS_PATH/bitrix.tar.gz .
tar -xzvf bitrix.tar.gz
rm -f bitrix.tar.gz
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