github.com/drud/ddev@v1.21.5-alpha1.0.20230226034409-94fcc4b94453/.circleci/config.yml (about)

     1  version: 2.1
     2  jobs:
     3    build:
     4      machine:
     5        image: ubuntu-2004:current
     6      working_directory: ~/ddev
     7      environment:
     8        DDEV_NONINTERACTIVE: "true"
     9      steps:
    10      - checkout
    11      - run: sudo mkdir /home/linuxbrew && sudo chown $(id -u) /home/linuxbrew
    12      - restore_cache:
    13          keys:
    14          - linux-homebrew-v31
    15      - run:
    16          command: ./.circleci/linux_circle_vm_setup.sh
    17          name: NORMAL Circle VM setup
    18          no_output_timeout: "40m"
    19      - save_cache:
    20          key: linux-homebrew-v31
    21          paths:
    22            - /home/linuxbrew
    23      - run:
    24          command: |
    25            make linux_amd64 linux_arm64 darwin_amd64 darwin_arm64 windows_amd64 windows_install EXTRA_PATH=/home/linuxbrew/.linuxbrew/bin
    26          name: Build the ddev executables
    27      - run:
    28          command: ./.ci-scripts/generate_artifacts.sh ~/artifacts
    29          name: tar/zip up artifacts and make hashes
    30          no_output_timeout: "40m"
    31      - store_artifacts:
    32          path: ~/artifacts
    33          name: Store artifacts
    34      - persist_to_workspace:
    35          root: ~/
    36          paths: ddev
    37  
    38    lx_amd64_fpm_test:
    39      machine:
    40        image: ubuntu-2004:current
    41      working_directory: ~/ddev
    42      environment:
    43        DDEV_TEST_WEBSERVER_TYPE: nginx-fpm
    44        DDEV_NONINTERACTIVE: "true"
    45      steps:
    46      - checkout
    47  
    48        # If this is a PR and the diff doesn't have code, skip it
    49      - run:
    50          name: "Skip if no code changes"
    51          command: |
    52            set -x
    53            if [ "${CIRCLE_PR_NUMBER}" != "" ] ; then
    54              echo "base_revision=<< pipeline.git.base_revision >>"
    55              if ! git diff --name-only "<< pipeline.git.base_revision >>" | egrep "^(Makefile|pkg|cmd|vendor|go\.)"; then
    56                echo "Skipping build since no code changes found"
    57                circleci-agent step halt
    58              fi
    59            fi
    60  
    61      - attach_workspace:
    62          at: ~/
    63      - run: sudo mkdir /home/linuxbrew && sudo chown $(id -u) /home/linuxbrew
    64      - run: 'mkdir -p ~/.ngrok2 && echo "authtoken: ${NGROK_TOKEN}" >~/.ngrok2/ngrok.yml'
    65      - restore_cache:
    66          keys:
    67          - linux-homebrew-v31
    68      - restore_cache:
    69          keys:
    70            - linux-testcache-v31
    71      - run:
    72          command: ./.circleci/linux_circle_vm_setup.sh
    73          name: Circle VM setup
    74          no_output_timeout: "40m"
    75      - save_cache:
    76          key: linux-homebrew-v31
    77          paths:
    78            - /home/linuxbrew
    79      - run: echo "$(docker --version) $(docker-compose --version)"
    80      - run:
    81          name: ddev tests - TestPull and TestDdevFullSiteSetup
    82          command: make -s testpkg TESTARGS='-run "(TestDdevFullSite.*|Test.*Pull)"' EXTRA_PATH=/home/linuxbrew/.linuxbrew/bin
    83          no_output_timeout: "40m"
    84      - store_test_results:
    85          path: /tmp/testresults
    86      - save_cache:
    87          key: linux-testcache-v31
    88          paths:
    89          - /home/circleci/.ddev/testcache
    90  
    91    lx_arm64_fpm_test:
    92      machine:
    93        image: ubuntu-2004:current
    94      resource_class: arm.medium
    95      working_directory: ~/ddev
    96      environment:
    97        DDEV_TEST_WEBSERVER_TYPE: nginx-fpm
    98        DDEV_NONINTERACTIVE: "true"
    99        GOTEST_SHORT: "true"
   100        DDEV_TEST_USE_MUTAGEN: ""
   101      steps:
   102        - checkout
   103        - run:
   104            name: "Skip if no code changes"
   105            command: |
   106              set -x
   107              if [ "${CIRCLE_PR_NUMBER}" != "" ] ; then
   108                echo "base_revision=<< pipeline.git.base_revision >>"
   109                if ! git diff --name-only "<< pipeline.git.base_revision >>" | egrep "^(.circleci|Makefile|pkg|cmd|vendor|go\.)"; then
   110                  echo "Skipping build since no code changes found"
   111                  circleci-agent step halt
   112                fi
   113              fi
   114        - run:
   115            command: ./.ci-scripts/linux_arm64_setup.sh
   116            name: ARM64 VM setup
   117            no_output_timeout: "40m"
   118        - run: echo "$(docker --version) $(docker-compose --version)"
   119        - run: 'mkdir -p ~/.ngrok2 && echo "authtoken: ${NGROK_TOKEN}" >~/.ngrok2/ngrok.yml'
   120        - run:
   121            command: make -s test
   122            name: ddev tests
   123            no_output_timeout: "40m"
   124  
   125    mac_nginx_fpm_test:
   126      macos:
   127        xcode: "11.3.1"
   128      working_directory: ~/ddev
   129      environment:
   130        DDEV_TEST_WEBSERVER_TYPE: nginx-fpm
   131        DDEV_NONINTERACTIVE: "true"
   132        GOTEST_SHORT: "true"
   133      steps:
   134      - attach_workspace:
   135          at: ~/
   136      - restore_cache:
   137          keys:
   138          - macos-v26
   139      # Run the built-in ddev tests with the executables just built.
   140      - run:
   141          command: ./.circleci/macos_circle_vm_setup.sh
   142          name: macOS Circle VM setup
   143          # Now build using the regular ddev-only technique - this results in a fully clean set of executables.
   144      - run:
   145          command: make -s test
   146          name: ddev tests
   147          no_output_timeout: "40m"
   148      - save_cache:
   149          key: macos-v26
   150          paths:
   151          - /home/circleci/.ddev/testcache
   152      - store_test_results:
   153          path: /tmp/testresults
   154  
   155    mac_apache_fpm_test:
   156      macos:
   157        xcode: "11.3.1"
   158      working_directory: ~/ddev
   159      environment:
   160        DDEV_TEST_WEBSERVER_TYPE: apache-fpm
   161        DDEV_NONINTERACTIVE: "true"
   162        GOTEST_SHORT: "true"
   163      steps:
   164      - attach_workspace:
   165          at: ~/
   166      - restore_cache:
   167          keys:
   168          - macos-v26
   169      # Run the built-in ddev tests with the executables just built.
   170      - run:
   171          command: ./.circleci/macos_circle_vm_setup.sh
   172          name: macOS Circle VM setup
   173          # Now build using the regular ddev-only technique - this results in a fully clean set of executables.
   174      - run:
   175          command: make -s test
   176          name: ddev tests
   177          no_output_timeout: "40m"
   178      - store_test_results:
   179          path: /tmp/testresults
   180      - save_cache:
   181          key: macos-v26
   182          paths:
   183          - /home/circleci/.ddev/testcache
   184  
   185    mac_nfsmount_test:
   186      macos:
   187        xcode: "11.3.1"
   188      working_directory: ~/ddev
   189      environment:
   190        DDEV_TEST_USE_NFSMOUNT: "true"
   191        DDEV_NONINTERACTIVE: "true"
   192        GOTEST_SHORT: "true"
   193      steps:
   194      - attach_workspace:
   195          at: ~/
   196      - restore_cache:
   197          keys:
   198          - macos-v26
   199      # Run the built-in ddev tests with the executables just built.
   200      - run:
   201          command: ./.circleci/macos_circle_vm_setup.sh
   202          name: macOS Circle VM setup
   203      - run:
   204          command: make -s test
   205          name: ddev tests
   206          no_output_timeout: "40m"
   207      - store_test_results:
   208          path: /tmp/testresults
   209      - save_cache:
   210          key: macos-v26
   211          paths:
   212          - /home/circleci/.ddev/testcache
   213  
   214    lx_apache_fpm_test:
   215      machine:
   216        image: ubuntu-2004:current
   217      working_directory: ~/ddev
   218      environment:
   219        DDEV_TEST_WEBSERVER_TYPE: apache-fpm
   220        # Experiment with only testing TYPO3 with the apache run.
   221        GOTEST_SHORT: 5
   222        DDEV_NONINTERACTIVE: "true"
   223      steps:
   224      - run: sudo mkdir /home/linuxbrew && sudo chown $(id -u) /home/linuxbrew
   225      - restore_cache:
   226          keys:
   227          - linux-homebrew-v31
   228      - attach_workspace:
   229          at: ~/
   230      - run:
   231          command: ./.circleci/linux_circle_vm_setup.sh
   232          name: Circle VM setup
   233          no_output_timeout: "40m"
   234  
   235      # Now build using the regular ddev-only technique - this results in a fully clean set of executables.
   236      # Run the built-in ddev tests with the executables just built.
   237      - run:
   238          command: make -s test EXTRA_PATH=/home/linuxbrew/.linuxbrew/bin
   239          name: ddev tests
   240          no_output_timeout: "120m"
   241      - store_test_results:
   242          path: /tmp/testresults
   243      - save_cache:
   244          key: linux-homebrew-v31
   245          paths:
   246          - /home/linuxbrew
   247          - /home/circleci/.ddev/testcache
   248  
   249    lx_nfsmount_test:
   250      machine:
   251        image: ubuntu-2004:current
   252      working_directory: ~/ddev
   253      environment:
   254        DDEV_TEST_USE_NFSMOUNT: true
   255        # Test only TYPO3 with the apache run.
   256        GOTEST_SHORT: 5
   257        DDEV_NONINTERACTIVE: "true"
   258      steps:
   259      - run: sudo mkdir /home/linuxbrew && sudo chown $(id -u) /home/linuxbrew
   260      - restore_cache:
   261          keys:
   262          - linux-homebrew-v31
   263      - attach_workspace:
   264          at: ~/
   265      - run:
   266          command: ./.circleci/linux_circle_vm_setup.sh
   267          name: Circle VM setup
   268          no_output_timeout: "40m"
   269  
   270          # Now build using the regular ddev-only technique - this results in a fully clean set of executables.
   271      # Run the built-in ddev tests with the executables just built.
   272      - run:
   273          # CircleCI image ubuntu-2004:202101-01 has umask 002, which results in
   274          # default perms 700 for new directories, which doesn't seem to work with NFS
   275          command: umask u=rwx,g=rwx,o=rx && make -s test EXTRA_PATH=/home/linuxbrew/.linuxbrew/bin
   276          name: ddev tests
   277          no_output_timeout: "120m"
   278      - store_test_results:
   279          path: /tmp/testresults
   280      - save_cache:
   281          key: linux-homebrew-v31
   282          paths:
   283          - /home/linuxbrew
   284          - /home/circleci/.ddev/testcache
   285  
   286    staticrequired:
   287      machine:
   288        image: ubuntu-2004:current
   289      working_directory: ~/ddev
   290      environment:
   291      steps:
   292      - checkout
   293      - run: sudo mkdir /home/linuxbrew && sudo chown $(id -u) /home/linuxbrew
   294      - restore_cache:
   295          keys:
   296          - linux-homebrew-v31
   297      - run:
   298          command: ./.circleci/linux_circle_vm_setup.sh
   299          name: Circle VM setup
   300          no_output_timeout: "40m"
   301      - run:
   302          command: source ~/.bashrc && make staticrequired EXTRA_PATH=/home/linuxbrew/.linuxbrew/bin
   303          name: staticrequired
   304  
   305    lx_amd64_container_test:
   306      machine:
   307        image: ubuntu-2004:current
   308      working_directory: ~/ddev
   309      environment:
   310        GOTEST_SHORT: true
   311        BUILDKIT_PROGRESS: plain
   312        DOCKER_CLI_EXPERIMENTAL: enabled
   313      steps:
   314      - checkout
   315      - run: sudo mkdir /home/linuxbrew && sudo chown $(id -u) /home/linuxbrew
   316      - restore_cache:
   317          keys:
   318          - linux-homebrew-v31
   319      - run:
   320          command: ./.circleci/linux_circle_vm_setup.sh
   321          name: Circle VM setup
   322          no_output_timeout: "40m"
   323  
   324      - run:
   325          command: ./.circleci/linux_docker_buildx_setup.sh
   326          name: Docker buildx setup for multi-arch builds
   327  
   328      - run:
   329          command: |
   330            . ~/.bashrc
   331            for dir in containers/*/
   332                do pushd $dir >/dev/null
   333                echo "--- Build container $dir"
   334                time make container DOCKER_ARGS=--no-cache EXTRA_PATH=/home/linuxbrew/.linuxbrew/bin
   335                echo "--- Test container $dir"
   336                time make test EXTRA_PATH=/home/linuxbrew/.linuxbrew/bin
   337                popd >/dev/null
   338            done
   339          name: linux container test
   340  
   341      - save_cache:
   342          key: linux-homebrew-v31
   343          paths:
   344          - /home/linuxbrew
   345          - /home/circleci/.ddev/testcache
   346  
   347    lx_arm64_container_test:
   348      machine:
   349        image: ubuntu-2004:current
   350      resource_class: arm.medium
   351      working_directory: ~/ddev
   352      environment:
   353        GOTEST_SHORT: true
   354        BUILDKIT_PROGRESS: plain
   355        DOCKER_CLI_EXPERIMENTAL: enabled
   356      steps:
   357        - checkout
   358        - run:
   359            command: ./.ci-scripts/linux_arm64_setup.sh
   360            name: Circle VM setup
   361            no_output_timeout: "40m"
   362  
   363  #      - run:
   364  #          command: ./.circleci/linux_docker_buildx_setup.sh
   365  #          name: Docker buildx setup for multi-arch builds
   366        - run:
   367            command: |
   368              . ~/.bashrc
   369              for dir in containers/*/
   370                  do pushd $dir >/dev/null
   371                  echo "--- Build container $dir"
   372                  time make container DOCKER_ARGS=--no-cache EXTRA_PATH=/home/linuxbrew/.linuxbrew/bin
   373                  echo "--- Test container $dir"
   374                  time make test EXTRA_PATH=/home/linuxbrew/.linuxbrew/bin
   375                  popd >/dev/null
   376              done
   377            name: linux container test
   378  
   379    mac_container_test:
   380      macos:
   381        xcode: "11.3.1"
   382      working_directory: ~/ddev
   383      steps:
   384      - checkout
   385      - run:
   386          command: ./.circleci/macos_circle_vm_setup.sh
   387          name: macOS Circle VM setup
   388  
   389      - run:
   390          command: |
   391            for dir in containers/*
   392                do pushd $dir
   393                echo "--- Build container $dir"
   394                time make container DOCKER_ARGS=--no-cache
   395                echo "--- Test container $dir"
   396                time make test
   397                popd
   398            done
   399          name: macos container test
   400  
   401    artifacts:
   402      machine:
   403        image: ubuntu-2004:current
   404      working_directory: ~/ddev
   405      steps:
   406      - run: sudo mkdir /home/linuxbrew && sudo chown $(id -u) /home/linuxbrew
   407      - restore_cache:
   408          keys:
   409          - linux-homebrew-v31
   410      - attach_workspace:
   411          at: ~/
   412      - run:
   413          command: ./.ci-scripts/generate_artifacts.sh ~/artifacts
   414          name: tar/zip up artifacts and make hashes
   415          no_output_timeout: "40m"
   416      - save_cache:
   417          key: linux-homebrew-v31
   418          paths:
   419          - /home/linuxbrew
   420          - /home/circleci/.ddev/testcache
   421  
   422      - store_artifacts:
   423          path: ~/artifacts
   424          name: Artifact storage
   425  
   426  
   427    release_build:
   428      macos:
   429        xcode: "12.4.0"
   430      working_directory: ~/ddev
   431      environment:
   432        DDEV_DEBUG: "true"
   433      steps:
   434      - checkout
   435      - run:
   436          command: ./.circleci/macos_circle_vm_setup.sh
   437          name: RELEASE BUILD (macOS) Circle VM setup
   438      - run: echo "version=$(make version)  CIRCLE_TAG=${CIRCLE_TAG}"
   439      - run:
   440          command: make -s linux_amd64 linux_arm64 windows_amd64 windows_install chocolatey
   441      - run:
   442          command: make -s darwin_amd64_notarized darwin_arm64_notarized
   443          no_output_timeout: 30m
   444  
   445      # We only build the xz version of the docker images on tag build.
   446      - run:
   447          command: ./.ci-scripts/generate_artifacts.sh ~/artifacts
   448          name: tar/zip up artifacts and make hashes
   449          no_output_timeout: "40m"
   450  
   451      - run:
   452          command: |
   453            if [ ! -z "${DDEV_GITHUB_TOKEN}" ]; then
   454              echo "DDEV_GITHUB_TOKEN provided, pushing release ${CIRCLE_TAG}"
   455              ghr \
   456              -prerelease \
   457              -r $CIRCLE_PROJECT_REPONAME \
   458              -u $CIRCLE_PROJECT_USERNAME \
   459              -b "$(cat ./.github/RELEASE_NOTES_TEMPLATE.md)" \
   460              -t $DDEV_GITHUB_TOKEN \
   461              "${CIRCLE_TAG}" ~/artifacts
   462            else
   463              echo "DDEV_GITHUB_TOKEN not provided, not pushing release $CIRCLE_TAG"
   464            fi
   465          name: Upload artifacts to GitHub release page
   466      - store_artifacts:
   467          path: ~/artifacts
   468          name: Artifact storage
   469      - run:
   470          name: "Bump homebrew edge release"
   471          command: ".ci-scripts/bump_homebrew.sh ${HOMEBREW_EDGE_REPOSITORY} ddev ${CIRCLE_TAG} ~/artifacts"
   472      - run:
   473          name: "Bump homebrew main release if necessary"
   474          command: |
   475            if [ ${CIRCLE_TAG%-*} = ${CIRCLE_TAG} ]; then
   476              .ci-scripts/bump_homebrew.sh ${HOMEBREW_STABLE_REPOSITORY} ddev ${CIRCLE_TAG} ~/artifacts
   477            else
   478              echo "Skipping homebrew main release because ${CIRCLE_TAG} is an edge/prerelease"
   479            fi
   480      - run:
   481          name: Push AUR ddev-bin if necessary
   482          command: |
   483              if [ ! -z "${AUR_SSH_PRIVATE_KEY}" ] && [ "${CIRCLE_TAG%-*}" = "${CIRCLE_TAG}" ] ; then
   484                .ci-scripts/bump_aur.sh ddev-bin ${CIRCLE_TAG} ~/artifacts
   485              else
   486                echo "Skipping AUR ddev-bin push"
   487              fi
   488      - run:
   489          name: Push AUR ddev-edge-bin
   490          command: |
   491            if [ ! -z "${AUR_SSH_PRIVATE_KEY}" ] ; then
   492              .ci-scripts/bump_aur.sh ddev-edge-bin ${CIRCLE_TAG} ~/artifacts
   493            else
   494              echo "Skipping AUR ddev-edge-bin push"
   495            fi
   496      - run:
   497          name: Upload chocolatey windows release
   498          command: |
   499            if [ ! -z "${CHOCOLATEY_API_KEY:-}" ]; then
   500              echo "Pushing release to chocolatey..."
   501              pushd .gotmp/bin/windows_amd64/chocolatey
   502              docker run --rm -v $PWD:/tmp/chocolatey -w /tmp/chocolatey linuturk/mono-choco push -s https://push.chocolatey.org/ --api-key "${CHOCOLATEY_API_KEY}"
   503              popd
   504            else
   505              echo "NOT pushing release to chocolatey because no CHOCOLATEY_API_KEY was provided"
   506            fi
   507  
   508  workflows:
   509    version: 2
   510    normal_build_and_test:
   511      jobs:
   512  #    - build
   513  #    - mac_container_test
   514  #    - lx_amd64_container_test
   515  #    - staticrequired
   516  #    - lx_amd64_fpm_test:
   517  #      branches:
   518  #        ignore:
   519  #          - gh-pages
   520      - lx_arm64_fpm_test:
   521        branches:
   522          ignore:
   523            - gh-pages
   524  #    - lx_arm64_container_test
   525  #        requires:
   526  #        - build
   527  #    - mac_nginx_fpm_test:
   528  #        requires:
   529  #        - build
   530  #    - mac_apache_fpm_test:
   531  #        requires:
   532  #        - build
   533  #    - mac_nfsmount_test:
   534  #        requires:
   535  #        - build
   536  #    - lx_apache_fpm_test:
   537  #        requires:
   538  #        - build
   539  #    - lx_apache_cgi_test:
   540  #        requires:
   541  #        - build
   542  #    - lx_nfsmount_test:
   543  #        requires:
   544  #        - build
   545  #    - artifacts:
   546  #        requires:
   547  #        - build
   548  
   549  #  nightly_build:
   550  #    triggers:
   551  #      - schedule:
   552  #          cron: "0 3 * * *"
   553  #          filters:
   554  #            branches:
   555  #              only:
   556  #                - master
   557  #                - "pull/[0-9]+"
   558  #    jobs:
   559  #    - lx_amd64_container_test
   560  ##    - lx_arm64_container_test
   561  ##    - lx_amd64_fpm_test
   562  #    - lx_arm64_fpm_test
   563  
   564  #  release_build:
   565  #    jobs:
   566  #      - release_build:
   567  #          context: ddev-local
   568  #          filters:
   569  #            tags:
   570  #              only:
   571  #                - "/.*/"
   572  #            branches:
   573  #              ignore: /.*/