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

Jenkins test #991

Closed
wants to merge 2 commits into from
Closed
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
89 changes: 79 additions & 10 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,36 @@
void buildAssetsForEachEnv(env) {
script {
// Check for semantic-release commit
// if ("$GIT_COMMIT_MESSAGE".contains('chore(release):')) {
if ("$GIT_COMMIT_MESSAGE".contains('testBuild:')) {
echo 'stage $env assets'
withCredentials([usernamePassword(credentialsId: 'web-cli-creds', passwordVariable: 'SVC_ACC_PASSWORD', usernameVariable: 'SVC_ACC_USERNAME')]) {
sh '''
npm run build:$env
OUTPUT=$(web stage --json --tag $STAGE_TAG)
web notify $STAGE_TAG
'''
}
}
return;
}
}

void deployAssetsForEachEnv(env) {
when {
// branch 'release'
branch 'jenkinsTest'
}
script {
if ($env ==== "production"); {
dir="js"
}
sh '''
echo Deploying $env
'''
}
}

pipeline {
agent {
label 'mesos'
Expand Down Expand Up @@ -35,7 +68,8 @@ pipeline {
stage('Stage Tag') {
when {
not {
branch 'release'
// branch 'release'
branch 'jenkinsTest'
}
}
steps {
Expand All @@ -49,17 +83,52 @@ pipeline {
}

// For release, stage existing build assets and send notification
stage('Deploy') {
stage('Parallel Build') {
when {
branch 'release'
// branch 'release'
branch 'jenkinsTest'
}
steps {
withCredentials([usernamePassword(credentialsId: 'web-cli-creds', passwordVariable: 'SVC_ACC_PASSWORD', usernameVariable: 'SVC_ACC_USERNAME')]) {
sh '''
OUTPUT=$(web stage --json --tag $STAGE_TAG)
web notify $STAGE_TAG
'''
}
parallel {
stage('Build Stage') {
steps{
buildAssetsForEachEnv(stage)
}
},
stage('Build Sandbox') {
steps{
buildAssetsForEachEnv(sandbox)
}
},
stage('Build Production') {
steps{
buildAssetsForEachEnv(production)
}
},
}
},

// For release, deploy existing build assets
stage('Parallel Deploy') {
when {
// branch 'release'
branch 'jenkinsTest'
}
parallel {
stage('Deploy Stage') {
steps {
deployAssetsForEachEnv(stage)
}
},
stage('Deploy Sandbox') {
steps {
deployAssetsForEachEnv(sandbox)
}
},
stage('Deploy Production') {
steps {
deployAssetsForEachEnv(production)
}
},
}
}
}
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
[![Compare Snapshots](https://github.com/paypal/paypal-messaging-components/actions/workflows/snapshotCompare.yml/badge.svg)](https://github.com/paypal/paypal-messaging-components/actions/workflows/snapshotCompare.yml) [![dependencies Status](https://david-dm.org/paypal/paypal-messaging-components/status.svg)](https://david-dm.org/paypal/paypal-messaging-components) [![devDependencies Status](https://david-dm.org/paypal/paypal-messaging-components/dev-status.svg)](https://david-dm.org/paypal/paypal-messaging-components?type=dev)

A messaging component allowing easy integration of PayPal Credit Messages onto your site.
1

## Dev Docs

Expand Down
Loading