Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build activation --- # ci range: . #1

Merged
merged 1 commit into from
Dec 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: Pull Requests

on:
pull_request:

jobs:
run:
uses: hiconic-os/hiconic.ci.workflows/.github/workflows/pr.yaml@main
secrets: inherit
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
**/.Trashes
**/ehthumbs.db
**/Thumbs.db
.gradle
5 changes: 0 additions & 5 deletions Jenkinsfile

This file was deleted.

36 changes: 36 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
buildscript {
ext.configureBuildscript = { c -> buildscript c }
apply from: 'buildscript.gradle'

dependencies {
classpath 'com.braintribe.devrock.cicd:devrock-cicd-steps-plugin:1.0+'
classpath 'com.braintribe.devrock.cicd:devrock-cicd-steps:1.0+'
classpath 'com.braintribe.devrock.cicd:github-notification:1.0+'
}
}

apply plugin: 'devrock-cicd-steps'

import devrock.cicd.model.api.*

defaultTasks 'build-artifacts'

steps {

step InitializeExchange.T

step EnrichExchangeContext.T

step AnalyzeCodebase.T

step BuildArtifacts.T, { equip { handler = { ant it.folderName, 'install', 'candidateInstall' } } }

step CheckLinking.T, { equip { handler = { ant it.folderName, 'check-linking' } } }

step RunTests.T, { equip { handler = { ant it.folderName, 'test' } } }

step RaiseAndMergeArtifacts.T // commit + merge

step PublishArtifacts.T

}
39 changes: 39 additions & 0 deletions buildscript.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// setup buildscript dependencies based on the libFolder to make RepositoryConfigurations helper available on classpath
buildscript {
// Determines devrock sdk home directory either by environment variable or by assuming that
// the projectDir lies relatively like that DEVROCK_SDK_HOME/env/dev-env/git/group
String devrockSdkRootVar = System.getenv('DEVROCK_SDK_HOME')
ext.devrockSdkRoot = devrockSdkRootVar != null?
new File(devrockSdkRootVar):
new File(projectDir, '../../../..').toPath().toAbsolutePath().normalize().toFile()

File libFolder = new File(devrockSdkRoot, 'tools/ant-libs');
dependencies { classpath files(fileTree(dir: libFolder.absolutePath, include: '*.jar')) }
}

// load and check the repository configuration
File repoConfig = new File(devrockSdkRoot, 'conf/repository-configuration-devrock.yaml');
def configMaybe = devrock.repository.configuration.RepositoryConfigurations.load repoConfig

if (configMaybe.unsatisfied)
throw new GradleException("Error while loading repository configuration for buildscript: " + configMaybe.whyUnsatisfied().stringify())

// transpose the repository configuration to gradle style and pass to to the callers buildscript
configureBuildscript {

repositories {
for (def repo: configMaybe.get().getRepositories()) {
if (repo instanceof com.braintribe.devrock.model.repository.MavenHttpRepository)
maven {
url repo.url
if (repo.user != null) credentials {
username repo.user
password repo.password
}
}
else if (repo instanceof com.braintribe.devrock.model.repository.MavenFileSystemRepository)
maven { url uri("file://${repo.rootPath}") }
}
}

}
27 changes: 27 additions & 0 deletions repository-configuration-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
!com.braintribe.devrock.model.repository.RepositoryConfiguration {
cachePath: "${config.dir}/../repo",

installRepository: &install-repo !com.braintribe.devrock.model.repository.MavenFileSystemRepository {
name: "install",
rootPath: "${config.dir}/../inst",
dominanceFilter: !com.braintribe.devrock.model.repository.filters.AllMatchingArtifactFilter {},
cachable: false,
},

uploadRepository: &hiconic-dev !com.braintribe.devrock.model.repository.IndexedMavenHttpRepository {
name: "hiconic-dev",
url: "https://maven.pkg.github.com/hiconic-os/maven-repo-dev",
user: "${env.DEVROCK_PIPELINE_UPLOAD_USER}",
password: "${env.DEVROCK_PIPELINE_UPLOAD_PASSWORD}",
dominanceFilter: !com.braintribe.devrock.model.repository.filters.AllMatchingArtifactFilter {},
},

repositories: [
*install-repo,
*hiconic-dev,
!com.braintribe.devrock.model.repository.MavenHttpRepository {
name: "third-party",
url: "https://repo1.maven.org/maven2/",
},
]
}