image: registry.simupedia.com/ci-images/maven-eclipse-adoptopenjdk-11:latest
-.common_before_script: &common_before_script
+.initialize_ssh_connection: &initialize_ssh_connection
# 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
- build-installer
- deploy
+# Workflow enforcement which forces the pipeline to run only if changes are pushed to branches
+workflow:
+ rules:
+ - if: '$CI_COMMIT_BRANCH'
+
review:
stage: build
script:
stage: build
script:
- mvn ${MAVEN_CLI_OPTS} -B clean verify -Dbuild-products=true
- - export UNPACKED_PRODUCT_DIR=releng/org.simantics.sysdyn.rcp.product/target/products/Simantics-Sysdyn/win32/win32/x86_64
- - export ZIP_PATH=Simantics-Sysdyn-win64.zip
- curl -s http://www.simantics.org/download/jre/$BUNDLED_JRE_VERSION.zip -o $BUNDLED_JRE_VERSION.zip
- 7z x -bd $BUNDLED_JRE_VERSION.zip
- rm $BUNDLED_JRE_VERSION.zip
- - mv $BUNDLED_JRE_VERSION/win32.x86_64 $UNPACKED_PRODUCT_DIR/jre
- - 7z a -bd -tzip "${ZIP_PATH}" "${UNPACKED_PRODUCT_DIR}" > /dev/null
+ - export UNPACKED_PRODUCT_DIR=releng/org.simantics.sysdyn.rcp.product/target/products/Simantics-Sysdyn/win32/win32/x86_64
+ - export ZIP_PATH=${CI_PROJECT_DIR}/Simantics-Sysdyn-win64.zip
+ - mv $BUNDLED_JRE_VERSION/win32.x86_64 $UNPACKED_PRODUCT_DIR/simantics-sysdyn/jre
+ - pushd ${UNPACKED_PRODUCT_DIR}
+ - 7z a -bd -tzip "${ZIP_PATH}" simantics-sysdyn > /dev/null
artifacts:
paths:
- releng/org.simantics.sysdyn.repository/target/repository
stage: deploy
needs: [build]
before_script:
- - *common_before_script
+ - *initialize_ssh_connection
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}"
- - rsync -e "ssh -i $GITLAB_PRIVATE_KEY" -v releng/org.simantics.sysdyn.repository/target/repository/* $GITLAB_USERNAME@$PUBLISH_ADDRESS:${PUBLISH_P2_DIR}/
- - rsync -e "ssh -i $GITLAB_PRIVATE_KEY" -v *.zip $GITLAB_USERNAME@$PUBLISH_ADDRESS:${PUBLISH_PRODUCT_DIR}/
+ - echo "${PUBLISH_P2_DIR}"
+ - echo "${PUBLISH_PRODUCT_DIR}"
+ #- 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}"
+ #- rsync -e "ssh -i $GITLAB_PRIVATE_KEY" -v releng/org.simantics.sysdyn.repository/target/repository/* $GITLAB_USERNAME@$PUBLISH_ADDRESS:${PUBLISH_P2_DIR}/
+ #- rsync -e "ssh -i $GITLAB_PRIVATE_KEY" -v *.zip $GITLAB_USERNAME@$PUBLISH_ADDRESS:${PUBLISH_PRODUCT_DIR}/
rules:
- if: '$CI_COMMIT_BRANCH == "master" || $CI_COMMIT_BRANCH =~ /^(release|feature|private)\/.*$/ || $CI_COMMIT_TAG =~ /^v.*$/'
when: on_success
build-installer:
stage: build-installer
+ image: docker:dind
needs: [build]
script:
- pushd releng/inno-setup
- docker run --rm -i -v $PWD:/work amake/innosetup sysdyn.iss
- - mv releng/inno-setup/*.exe ${CI_PROJECT_DIR}/
+ - mv output/*.exe ${CI_PROJECT_DIR}/
+ tags:
+ - dind
artifacts:
paths:
- ./*.exe
stage: deploy
needs: [build-installer]
before_script:
- - *common_before_script
+ - *initialize_ssh_connection
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}/
+ - echo "${PUBLISH_PRODUCT_DIR}"
+ #- 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}/
rules:
- when: manual
paths:
- public
rules:
- - if: '$CI_COMMIT_BRANCH == "master"'
\ No newline at end of file
+ - if: '$CI_COMMIT_BRANCH == "master"'
<goal>materialize-products</goal>\r
</goals>\r
</execution>\r
- <execution>\r
- <id>archive-products</id>\r
- <goals>\r
- <goal>archive-products</goal>\r
- </goals>\r
- </execution>\r
</executions>\r
+ <configuration>\r
+ <products>\r
+ <product>\r
+ <id>Simantics-Sysdyn</id>\r
+ <archiveFileName>simantics-sysdyn</archiveFileName>\r
+ <rootFolder>simantics-sysdyn</rootFolder>\r
+ </product>\r
+ </products>\r
+ </configuration>\r
</plugin>\r
</plugins>\r
</build>\r
\r
+ <profiles>\r
+ <profile>\r
+ <id>archive-products</id>\r
+ <activation>\r
+ <property>\r
+ <name>archive-products</name>\r
+ <value>!false</value>\r
+ </property>\r
+ </activation>\r
+ <build>\r
+ <plugins>\r
+ <plugin>\r
+ <groupId>org.eclipse.tycho</groupId>\r
+ <artifactId>tycho-p2-director-plugin</artifactId>\r
+ <version>${tycho.version}</version>\r
+ <executions>\r
+ <execution>\r
+ <id>archive-products</id>\r
+ <goals>\r
+ <goal>archive-products</goal>\r
+ </goals>\r
+ </execution>\r
+ </executions>\r
+ </plugin>\r
+ </plugins>\r
+ </build>\r
+ </profile>\r
+ </profiles>\r
+\r
</project>\r