From 8600cf99d4ff0a135665169d0749526aa748b115 Mon Sep 17 00:00:00 2001 From: Tuukka Lehtonen Date: Sat, 29 Aug 2020 02:23:22 +0300 Subject: [PATCH] Fix pages and publishing gitlab #79 --- .gitlab-ci.yml | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 967eef02..c39c6ba5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -11,9 +11,17 @@ variables: image: registry.simupedia.com/ci-images/maven-eclipse-adoptopenjdk-11:latest + +.common_before_script: &common_before_script + # Needed because ssh doesn't accept the private key unless it has 600 permissions + - chmod 600 "$GITLAB_PRIVATE_KEY" + # Initialize SSH connectivity to publish target + # StrictHostKeyChecking=no needed on first connection, because .ssh/known_hosts doesn't contain the target host key. + - ssh -o StrictHostKeyChecking=no -i $GITLAB_PRIVATE_KEY $GITLAB_USERNAME@$PUBLISH_ADDRESS echo + stages: - build - - build2 + - build-installer - deploy review: @@ -49,6 +57,8 @@ build: publish: stage: deploy needs: [build] + before_script: + - *common_before_script script: - ssh -i $GITLAB_PRIVATE_KEY $GITLAB_USERNAME@$PUBLISH_ADDRESS mkdir -p "${PUBLISH_P2_DIR}" - ssh -i $GITLAB_PRIVATE_KEY $GITLAB_USERNAME@$PUBLISH_ADDRESS mkdir -p "${PUBLISH_PRODUCT_DIR}" @@ -60,7 +70,7 @@ publish: - when: never build-installer: - stage: build2 + stage: build-installer needs: [build] script: - pushd releng/inno-setup @@ -76,6 +86,8 @@ build-installer: publish-installer: stage: deploy needs: [build-installer] + before_script: + - *common_before_script script: - ssh -i $GITLAB_PRIVATE_KEY $GITLAB_USERNAME@$PUBLISH_ADDRESS mkdir -p "${PUBLISH_PRODUCT_DIR}" - rsync -e "ssh -i $GITLAB_PRIVATE_KEY" -v *.exe $GITLAB_USERNAME@$PUBLISH_ADDRESS:${PUBLISH_PRODUCT_DIR}/ @@ -84,11 +96,10 @@ publish-installer: pages: stage: deploy - needs: [build] script: - - echo "Publishing wiki" + - cp -r bundles/org.simantics.sysdyn.wiki public artifacts: paths: - - org.simantics.sysdyn.wiki + - public rules: - if: '$CI_COMMIT_BRANCH == "master"' \ No newline at end of file -- 2.47.1