Skip to content

Add Jenkins Pipeline to test the project automatically#165

Open
justinyeh1995 wants to merge 114 commits intoSimIntToolkit:developfrom
justinyeh1995:develop
Open

Add Jenkins Pipeline to test the project automatically#165
justinyeh1995 wants to merge 114 commits intoSimIntToolkit:developfrom
justinyeh1995:develop

Conversation

@justinyeh1995
Copy link

What's added

  • JenkinsFile
  • Dockerfile
  • gradle.properties
  • experiment_wrapper.sh

Additional context

Adding a Webhook in this repository is recommended.

Further testing can only be made after merging.

zip

#install Gradle
ARG GRADLE_VERSION=7.5
Copy link
Contributor

@hnine999 hnine999 Dec 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if this is needed -- the gradle-wrapper (gradle wrapper --gradle-version=8.0) should accomplish that same thing. You just need to use ./gradlew instead of gradle when executing gradle

Let's also use gradle 8.0

val snapshotsRepoUrl = "http://$archivaHostId:$archivaPort/repository/snapshots"
url = uri(if (version.toString().endsWith("SNAPSHOT")) snapshotsRepoUrl else internalRepoUrl)

val internalRepoUrl = "http://localhost:8080/repository/internal"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

archivaHostId and archivaPort shouldn't be hardcoded.
If the gradle.properties file isn't working, you should be able to provide them on the command-line of ./gradlew via -PachivaHostId=localhost and -ParchivaPort=8080

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment is fixed and the changes result in a successful build.


gradle wrapper --gradle-version=7.5

ARCHIVA_REPO_URL="http://localhost:8080/repository/snapshots/0.7.0-SNAPSHOT/"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to find some way of making the version consistent -- should be 0.8.0-SNAPSHOT

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment is fixed and the changes result in a successful build.

archivaPassword=adminpass123
archivaHostId=localhost
archivaPort=8080
version=0.7.0-SNAPSHOT
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be 0.8.0-SNAPSHOT

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment is fixed and the changes result in a successful build.

echo "archiva launched"

# create admin user
curl --no-progress-meter -X POST -H "Content-Type: application/json" -H "Origin: http://localhost:8080" -d @- \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part should probably go in the docker somehow -- perhaps with a script that:

  • starts archiva
  • waits for it to go online
  • sets up the admin user
  • shuts down archiva


# run the HelloWorldJava example
cd /home/cpswt/cpswt-core/examples/HelloWorldJava
gradle wrapper --gradle-version=7.5
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's go with gradle 8.0

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment is fixed and the changes result in a successful build.

git clone https://github.com/SimIntToolkit/cpswt-core.git
cd cpswt-core/cpswt-core

gradle wrapper --gradle-version=7.5
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's use gradle 8.0

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment is fixed and the changes result in a successful build.

@justinyeh1995
Copy link
Author

I am now moving these files into .jenkins/ to make the project more readable and manageable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants