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

Automate build system #1428

Closed
wants to merge 22 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
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ k3d
kubectl
**/v8-*
node_modules/
build/*
!build/.gitkeep
openshift
!services/api/src/resources/openshift
.loopback
Expand All @@ -24,3 +22,5 @@ docs/_build
yarn-debug.log*
yarn-error.log*
site
/.docker.mk
/pull-report.json
16 changes: 10 additions & 6 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,13 @@ node {
env.GIT_COMMIT = checkout["GIT_COMMIT"]
}

stage ('pull base images') {
sh "make build:pull"
sh "cat pull-report.json"
}

stage ('build images') {
sh "make -O${SYNC_MAKE_OUTPUT} -j6 build"
sh "make -O${SYNC_MAKE_OUTPUT} -j6 build:all"
}

try {
Expand All @@ -63,7 +68,7 @@ node {
try {
sh 'make minishift/cleanall || echo'
sh "make minishift MINISHIFT_CPUS=16 MINISHIFT_MEMORY=32GB MINISHIFT_DISK_SIZE=50GB MINISHIFT_VERSION=${minishift_version} OPENSHIFT_VERSION=${openshift_version}"
sh "make -O${SYNC_MAKE_OUTPUT} push-minishift -j5"
sh "make -O${SYNC_MAKE_OUTPUT} build:push-minishift -j5"
sh "make -O${SYNC_MAKE_OUTPUT} openshift-tests -j7"
} catch (e) {
echo "Something went wrong, trying to cleanup"
Expand Down Expand Up @@ -95,7 +100,7 @@ node {
try {
if (env.SKIP_IMAGE_PUBLISH != 'true') {
sh 'docker login -u amazeeiojenkins -p $PASSWORD'
sh "make -O${SYNC_MAKE_OUTPUT} -j4 publish-amazeeiolagoon-baseimages publish-amazeeiolagoon-serviceimages BRANCH_NAME=${SAFEBRANCH_NAME}"
sh "make -O${SYNC_MAKE_OUTPUT} -j4 publish:amazeeiolagoon-baseimages publish:amazeeiolagoon-serviceimages BRANCH_NAME=${SAFEBRANCH_NAME}"
} else {
sh 'echo "skipped because of SKIP_IMAGE_PUBLISH env variable"'
}
Expand All @@ -118,14 +123,14 @@ node {
stage ('publish-amazeeio') {
withCredentials([string(credentialsId: 'amazeeiojenkins-dockerhub-password', variable: 'PASSWORD')]) {
sh 'docker login -u amazeeiojenkins -p $PASSWORD'
sh "make -O${SYNC_MAKE_OUTPUT} -j4 publish-amazeeio-baseimages"
sh "make -O${SYNC_MAKE_OUTPUT} -j4 publish:amazeeio-baseimages"
}
}
}

if (env.BRANCH_NAME == 'master' && env.SKIP_IMAGE_PUBLISH != 'true') {
stage ('save-images-s3') {
sh "make -O${SYNC_MAKE_OUTPUT} -j8 s3-save"
sh "make -O${SYNC_MAKE_OUTPUT} -j8 build:s3-save"
}
}

Expand All @@ -147,7 +152,6 @@ def cleanup() {
sh "make down || true"
sh "make kill"
sh "make down"
sh "make clean"
} catch (error) {
echo "cleanup failed, ignoring this."
}
Expand Down
Loading