Skip to content

Instantly share code, notes, and snippets.

@jblac jblac/Jenkinsfile Secret
Created Mar 27, 2017

Embed
What would you like to do?
build() {
docker-compose $BUILD_MODE build
}
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
You can’t perform that action at this time.