]> gerrit.simantics Code Review - simantics/sysdyn.git/commitdiff
Fix directories in sysdyn product package & ttest dind installer build
authorTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Mon, 31 Aug 2020 06:16:23 +0000 (09:16 +0300)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Mon, 31 Aug 2020 06:16:23 +0000 (09:16 +0300)
gitlab #79

.gitlab-ci.yml
releng/inno-setup/sysdyn.iss
releng/org.simantics.sysdyn.rcp.product/pom.xml
releng/org.simantics.sysdyn.tycho.configuration/pom.xml

index e4f6f675a68cab5c8ea8cd6aa08a089f157f1c7f..473d3853762fc90db4c0aa251a64685bb11148b6 100644 (file)
@@ -12,7 +12,7 @@ variables:
 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
@@ -24,6 +24,11 @@ stages:
   - 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:
@@ -37,13 +42,14 @@ build:
   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
@@ -58,12 +64,14 @@ publish:
   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
@@ -71,11 +79,14 @@ publish:
 
 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
@@ -87,10 +98,11 @@ publish-installer:
   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
 
@@ -103,4 +115,4 @@ pages:
     paths:
       - public
   rules:
-    - if: '$CI_COMMIT_BRANCH == "master"'
\ No newline at end of file
+    - if: '$CI_COMMIT_BRANCH == "master"'
index 23642e0f49d6a33c54be7c0b583f481bbc00a364..4e28f831f27931ded19f8556fd6b6d4fc3878509 100644 (file)
@@ -14,7 +14,7 @@ WizardSmallImageFile=sysdyn.bmp
 OutputDir=output
 
 [Files]
-Source: "sysdyn/*"; DestDir: "{app}"; Flags: recursesubdirs createallsubdirs
+Source: "simantics-sysdyn/*"; DestDir: "{app}"; Flags: recursesubdirs createallsubdirs
 
 [Icons]
 Name: "{group}\Simantics System Dynamics"; Filename: "{app}\Simantics-Sysdyn.exe"
index 58ebe1833d27fe5668f8f0d45e24334016c514d3..db9351c09e28b88005ca22c61871b615267ab412 100644 (file)
                                                        <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
index 5e3fb45d52a9e2c2d9320b0f5472ba17487e91b4..278f757fdf7c24914b8fd141cc2d2bcd4b9f1cc8 100644 (file)
@@ -13,6 +13,7 @@
                <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
                <branch-spec>master</branch-spec>
                <simantics-download-site>http://www.simantics.org/download</simantics-download-site>
+               <build.tag>SNAPSHOT</build.tag>
        </properties>
 
        <repositories>