Commit 8b98160a authored by Илья Рассадин's avatar Илья Рассадин
Browse files

Merge branch 'ir-ce-rsync32-fix' into 'master'

Fix composer deploy

See merge request boilerplate/ci!9
parents 87215be9 bbaab49d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@
    echo "RUNNING rsync -L -avz $RSYNC_PARAMS" \
      "--chown=$user:$group -e ssh" \
      "$CI_PROJECT_DIR/$COMPOSER_ARTIFACTS_DIR $DEPLOY_HOST_PATH/$COMPOSER_SERVER_DIR"
    rsync -L -avz $RSYNC_PARAMS --chown=$user:$group -e "ssh $SSH_OPTS" $CI_PROJECT_DIR/$COMPOSER_ARTIFACTS_DIR $DEPLOY_HOST_PATH/$COMPOSER_SERVER_DIR;
    rsync $RSYNC_ADMIN_PARAMS $RSYNC_PARAMS  -e "ssh $SSH_OPTS" $CI_PROJECT_DIR/$COMPOSER_ARTIFACTS_DIR $DEPLOY_HOST_PATH/$COMPOSER_SERVER_DIR;
  fi

.deploy_composer_files_to_server:
+1 −1
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@ COPY tests/integration/keys/id_ed25519 /root/.ssh/deploy.key
RUN chmod 0400 /root/.ssh/deploy.key

# CI YAML templates for script extraction
COPY before_script.yml .deploy_code_to_server.yml /ci-repo/
COPY before_script.yml .deploy_code_to_server.yml .deploy_composer_files_to_server.yml /ci-repo/

# rsync filter files used by tests and served by the mock curl
COPY rsync-filter* /ci-repo/
+9 −0
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@ Writes shell scripts to OUTPUT_DIR (default /tmp/generated):
  set_path_vars.sh                      — from before_script.yml anchor
  deploy_code_to_server.sh              — from .deploy_code_to_server script:
  deploy_code_to_server_with_delete.sh  — from .deploy_code_to_server_with_delete script:
  upload_composer_files.sh              — from .deploy_composer_files_to_server.yml anchor
"""
import os
import sys
@@ -40,6 +41,14 @@ def main(output_dir):
            f.write(join_script(deploy[job]['script']))
        print(f'Written {path}')

    with open(os.path.join(REPO_ROOT, '.deploy_composer_files_to_server.yml')) as f:
        composer = yaml.safe_load(f)

    path = os.path.join(output_dir, 'upload_composer_files.sh')
    with open(path, 'w') as f:
        f.write(composer['.upload_composer_files'])
    print(f'Written {path}')


if __name__ == '__main__':
    main(sys.argv[1] if len(sys.argv) > 1 else '/tmp/generated')
+4 −0
Original line number Diff line number Diff line
<?php
namespace Acme;

class Foo {}
+3 −0
Original line number Diff line number Diff line
<?php
// Composer autoloader stub
require_once __DIR__ . '/acme/Foo.php';
Loading