test Drupal site working on Koality Theme Builder
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.7 KiB

4 years ago
  1. variables:
  2. IMAGE_TAG_RELEASE: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
  3. stages:
  4. - lint
  5. - deploy
  6. lint:
  7. stage: lint
  8. image: donniewest/drupal-node-container:latest
  9. only:
  10. - dev
  11. script:
  12. - cd docroot/themes/custom/THEMENAME && npm install && npm run lint
  13. build-dev:
  14. image: docker:latest
  15. services:
  16. - docker:18-dind
  17. stage: deploy
  18. only:
  19. - master
  20. script:
  21. - docker run -v $PWD:/var/www/html donniewest/drupal-node-container:latest /bin/bash -c "composer install && cd ./docroot/themes/custom/THEMENAME/ && npm install && npm run build && npm run compile"
  22. - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
  23. - docker build -t $IMAGE_TAG_RELEASE ./
  24. - docker push $IMAGE_TAG_RELEASE
  25. build-staging:
  26. image: docker:latest
  27. services:
  28. - docker:18-dind
  29. stage: deploy
  30. only:
  31. - /^RC-[\.\d]*/
  32. except:
  33. - branches
  34. script:
  35. - docker run -v $PWD:/var/www/html donniewest/drupal-node-container:latest /bin/bash -c "composer install && cd ./docroot/themes/custom/THEMENAME/ && npm install && npm run build && npm run compile"
  36. - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
  37. - docker build -t $CI_REGISTRY_IMAGE:staging ./
  38. - docker push $CI_REGISTRY_IMAGE:staging
  39. build-production:
  40. image: docker:latest
  41. services:
  42. - docker:18-dind
  43. stage: deploy
  44. only:
  45. - /^RELEASE-[\.\d]*/
  46. except:
  47. - branches
  48. script:
  49. - docker run -v $PWD:/var/www/html donniewest/drupal-node-container:latest /bin/bash -c "composer install && cd ./docroot/themes/custom/THEMENAME/ && npm install && npm run build && npm run compile"
  50. - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
  51. - docker build -t $CI_REGISTRY_IMAGE:production ./
  52. - docker push $CI_REGISTRY_IMAGE:production