Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
gfournieriExec committed Jul 10, 2024
1 parent fe90abe commit e57165d
Showing 1 changed file with 34 additions and 23 deletions.
57 changes: 34 additions & 23 deletions Jenkinsfile_Subgraph_generic
Original file line number Diff line number Diff line change
@@ -1,48 +1,59 @@
//Readme @ http://gitlab.iex.ec:30000/iexec/jenkins-library

@Library('[email protected]') _

def userInput

node {
docker.image('node:20-alpine').inside('--user root') {
// stage('Setup') {
// checkout scm
// }
stage('Deployement form') {
stage('Setup') {
checkout scm
}
stage('Deployment form') {
timeout(time: 5, unit: 'MINUTES') {
userInput = input(
id: 'select-deployment',
message: 'Select environment & service',
parameters: [
string(name: 'network', description: 'The network name you want to deploy your subgraph'),
string(name: 'targetRemoteHost', description: 'The host you want to deploy the subgraph'),

]
)
}
println "Selected network: '$userInput.network'"
println "Selected service name: '$userInput.targetRemoteHost'"
println "Selected network: '${userInput.network}'"
println "Selected service name: '${userInput.targetRemoteHost}'"
}
stage('Setup Docker image') {
sh 'apk add jq'
}
stage('Building subgraph') {
checkout scm
sh "./generate_subgraph.sh '$userInput.network'"
stage('Building subgraph') {
// Print working directory and list files for debugging
sh 'pwd'
sh 'ls -la'

// Ensure the script is executable
sh 'chmod +x ./generate_subgraph.sh'

// Run the script
sh "./generate_subgraph.sh '${userInput.network}'"

// Check if the subgraph file was generated
sh """
FILE=./subgraph.'$userInput.network}'.yaml
if test -f "$FILE"; then
FILE=./subgraph.${userInput.network}.yaml
if test -f "\$FILE"; then
echo "Subgraph file generated successfully"
else
echo "Failed to generate subgraph file"
exit 1
fi
"""
"""
}
stage('Deploy SubGraph') {
deploySubGraph(
targetRemoteHost: "${userInput.targetRemoteHost}",
subgraphFolder: './',
subgraphFilename: "subgraph.${userInput.network}.yaml",
subgraphVersionLabel: 'v1.0.0-rc.1',
subgraphLabel: "${userInput.network}/poco-v5"
)
}
deploySubGraph(
targetRemoteHost : "'$userInput.targetRemoteHost}'",
subgraphFolder: './',
subgraphFilename: "subgraph.'$userInput.network}'.yaml",
subgraphVersionLabel: 'v1.0.0-rc.1',
subgraphLabel: "'$userInput.network}'/poco-v5"
)
}
}
}

0 comments on commit e57165d

Please sign in to comment.