diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7dea775aedf2d07c13d205fe0b726d4560ff4e6c..36b6dfdcf5f73962b41333a0c1b8cf2213ab8699 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -12,13 +12,17 @@ variables: # when running from the command line. # `installAtEnd` and `deployAtEnd`are only effective with recent version of the corresponding plugins. MAVEN_CLI_OPTS: "--batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true -Dmaven.repo.local=/tmp/.m2/repository" - #-Dmaven.repo.local=$HOME/.m2/repository + + UPDATE_SITE_MOUNT_DIR: "/tmp/www_us" + UPDATE_SITE_PROD_TARGET_DIR: "html/tools/aida_est" + UPDATE_SITE_DEVEL_TARGET_DIR: "${UPDATE_SITE_PROD_TARGET_DIR}_devel" + REPOSITORY_TO_COPY: "org.polarsys.chess.parent/releng/eu.fbk.tools.aida.chess.repository/target/repository" stages: - build_sde - build_est - test -#- deploy +- deploy #- documentation #- release @@ -40,7 +44,7 @@ est_build_test_job: script: - "curl -X POST -F token=951497a03a4073902aa28ab8d9c2d3 -F ref=master https://gitlab.fbk.eu/api/v4/projects/1159/trigger/pipeline" -build_test_job: +maven_build_and_test: only: - master @@ -48,3 +52,45 @@ build_test_job: environment: staging script: - "export DISPLAY=:0.0; cd org.polarsys.chess.parent; mvn $MAVEN_CLI_OPTS -P Neon-Java8,DevelopmentUpdateSite clean install" + +deploy_to_development_update_site: + dependencies: + - maven_build_and_test + variables: + GIT_STRATEGY: none + stage: deploy + environment: staging + script: + - echo "Deploy to development update site" + - mkdir -p $UPDATE_SITE_MOUNT_DIR + - sshfs -o nonempty -o umask=0777 es@es-static.fbk.eu:/ $UPDATE_SITE_MOUNT_DIR + - mkdir -p $UPDATE_SITE_MOUNT_DIR/$UPDATE_SITE_DEVEL_TARGET_DIR + - cp -r ${REPOSITORY_TO_COPY}/* $UPDATE_SITE_MOUNT_DIR/$UPDATE_SITE_DEVEL_TARGET_DIR + - chmod -R 0777 $UPDATE_SITE_MOUNT_DIR/$UPDATE_SITE_DEVEL_TARGET_DIR + - fusermount -uz $UPDATE_SITE_MOUNT_DIR + when: manual +# allow_failure: false + only: + - master + + +deploy_to_production_update_site: + dependencies: + - maven_build_and_test + variables: + GIT_STRATEGY: none + stage: deploy + environment: staging + script: + - echo "Deploy to production update site" + - mkdir -p $UPDATE_SITE_MOUNT_DIR + - sshfs -o nonempty -o umask=0777 es@es-static.fbk.eu:/ $UPDATE_SITE_MOUNT_DIR + - mkdir -p $UPDATE_SITE_MOUNT_DIR/$UPDATE_SITE_PROD_TARGET_DIR + - cp -r ${REPOSITORY_TO_COPY}/* $UPDATE_SITE_MOUNT_DIR/$UPDATE_SITE_PROD_TARGET_DIR + - chmod -R 0777 $UPDATE_SITE_MOUNT_DIR/$UPDATE_SITE_PROD_TARGET_DIR + - fusermount -uz $UPDATE_SITE_MOUNT_DIR + when: manual +# allow_failure: false + only: + - master +