| stage('Setup') { | |
| try { | |
| echo "pulling in master branch" | |
| git branch: '${BRANCH_NAME}', credentialsId: '3741f9e1-0a6c-41cb-981d-a0a5c1dcac6a', url: 'git@git.com:company/app.git' | |
| env.IMAGE_TAG='latest' | |
| sh """ | |
| docker-compose -f docker/env.yml run --rm app php ./init --env=Production --overwrite=Yes | |
| npm install | |
| ./app.sh gulp less | |
| ./app.sh -b composer-install | |
| """ | |
| } catch (error) { | |
| throw error | |
| } | |
| } | |
| stage('Build') { | |
| try { | |
| echo 'building docker image' | |
| sh './app.sh -b build' | |
| echo 'docker image built: tagging new image' | |
| sh "docker tag app/app:build app/app:${BRANCH_NAME}-${BUILD_NUMBER}" | |
| sh 'docker push app/app:build' | |
| } catch (error) { | |
| throw error | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment