Skip to content

Instantly share code, notes, and snippets.

@steffenk
Created January 1, 2018 11:15
Show Gist options
  • Save steffenk/9b981e78192741c7bae4ba0e0f71d2bd to your computer and use it in GitHub Desktop.
Save steffenk/9b981e78192741c7bae4ba0e0f71d2bd to your computer and use it in GitHub Desktop.
# This is a sample build configuration for Other.
# Check our guides at https://confluence.atlassian.com/x/5Q4SMw for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image:
name: pxdeployment/pipelines
username: $DOCKERHUB_USER_ALT
password: $DOCKERHUB_PASS_ALT
email: xxx@xxx.de
pipelines:
default:
- step:
caches:
- node
script:
# this runs on every branch that is pushed
- chmod 755 -R *
- export NODE_ENV=development
- node -v
- npm install grunt -g && npm install grunt
- npm install
- grunt jenkins
branches:
staging:
- step:
caches:
- node
script:
- chmod 755 -R *
- export NODE_ENV=development
- node -v
- npm install grunt -g && npm install grunt
- npm install
- grunt jenkins
- tar -zcf package.tar.gz ./www/typo3conf/ext ./www/typo3conf/l10n ./www/typo3conf/realurl_conf.php
# copy the package from the docker container to the remote server
- scp -o StrictHostKeyChecking=no -C ./package.tar.gz jenkins@"$STAGING:"
- ssh -T jenkins@"$STAGING" "mv ./package.tar.gz $STAGING_PATH && cd $STAGING_PATH && sudo chmod -R 755 * && sudo tar -xzf package.tar.gz && sudo chown -R www-data:webadm /var/www/website.de/www/* && sudo rm -rf typo3temp/* && sudo rm -f /var/www/website.de/package.tar.gz"
live:
- step:
caches:
- node
script:
- chmod 755 -R *
- export NODE_ENV=production
- node -v
- npm install grunt -g && npm install grunt
- npm install
- grunt jenkins
- tar -zcf package.tar.gz ./www/typo3conf/ext ./www/typo3conf/l10n ./www/typo3conf/realurl_conf.php
# copy the package from the docker container to the remote server
- scp -o StrictHostKeyChecking=no -C ./package.tar.gz jenkins@"$LIVE:"
- ssh -T jenkins@"$LIVE" "sudo mv ./package.tar.gz $LIVE_PATH && cd $LIVE_PATH && sudo chmod -R 755 * && sudo tar -xzf package.tar.gz && sudo chown -R www-data:webadm /var/www/deploy.website.de/www/* && sudo /var/www/deploy.website/deployment/post-build.sh live && sudo rm -rf typo3temp/* && sudo rm -f /var/www/deploy.website.de/package.tar.gz"
custom:
(STAGING)_from_(master)_to_(staging):
- step:
script:
- git fetch origin
- git checkout staging
- git reset --hard origin/master
- git push --force origin HEAD:staging
(LIVE)_from_(stable)_to_(live):
- step:
script:
- git fetch origin
- git checkout live
- git reset --hard origin/stable
- git push --force origin HEAD:live
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment