Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 4b2a969e9510ad6161a564c208be024110e8f577 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
configurations {
	archives
	updates
}

dependencies {
	archives project(path: ':plugins:org.eclipse.etrice.generator.c', configuration: 'archive')
	archives project(path: ':plugins:org.eclipse.etrice.generator.cpp', configuration: 'archive')
	archives project(path: ':plugins:org.eclipse.etrice.generator.java', configuration: 'archive')
	archives project(path: ':plugins:org.eclipse.etrice.generator.doc', configuration: 'archive')
	
	updates project(path: ':releng:org.eclipse.etrice.site', configuration: 'archive')
}

def versionDir = scmVersion.version.endsWith('SNAPSHOT') ? 'nightly' : scmVersion.version
def downloadDir = '/home/data/httpd/download.eclipse.org/etrice'
def promoteDir = "$downloadDir/$versionDir"
def assembleDir = "$buildDir/$versionDir"

remotes {
	projectsStorage {
		host = 'projects-storage.eclipse.org'
		user = 'genie.etrice'
	}
}

ssh.settings {
	agent = true
	fileTransfer = 'scp'
}

task assembleArtifacts(type: Sync) {
	from([configurations.archives, configurations.updates]) {
		into 'archives'
	}
	if(!configurations.updates.empty) {
		from(zipTree(configurations.updates.singleFile)) {
			into 'updates'
		}
	} else {
		doFirst {
			throw new GradleException("etrice update site is missing - execute tycho/maven 'package' first")
		}
	}
	into assembleDir
}

assemble.dependsOn assembleArtifacts

task promote {
	dependsOn assembleArtifacts
	doLast {
		ssh.run {
			session(remotes.projectsStorage) {
				logger.info "clean download area"
				remove promoteDir
				execute "mkdir $promoteDir"
				
				logger.info "promote archives"
				put from: "$assembleDir/archives", into: promoteDir
				
				logger.info "promote update site"
				put from: "$assembleDir/updates", into: promoteDir
			}
		}
	}
}

Back to the top