Last active
August 17, 2021 22:18
-
-
Save d0x2f/0e5549bba6d7fa5b8c3bbab27ff3dbae to your computer and use it in GitHub Desktop.
Revisions
-
d0x2f revised this gist
Mar 17, 2018 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -148,6 +148,9 @@ pipeline: -Dsonar.projectVersion=$(cat VERSION) -Dsonar.login=$SONAR_TOKEN -Dsonar.projectBaseDir=. -Dsonar.gitlab.commit_sha=${DRONE_COMMIT} -Dsonar.gitlab.ref_name=${DRONE_BRANCH} -Dsonar.gitlab.project_id=2 publish: image: docker -
d0x2f revised this gist
Mar 17, 2018 . 1 changed file with 86 additions and 29 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,6 +3,45 @@ workspace: pipeline: dbnode1: detach: true image: mysql/mysql-cluster:7.5 commands: - sleep 5 - > ndbd --nodaemon --ndb-nodeid=2 --connect-string="nodeid=2\;host=dbmanager" dbnode2: detach: true image: mysql/mysql-cluster:7.5 commands: - sleep 5 - > ndbd --nodaemon --ndb-nodeid=3 --connect-string="nodeid=3\;host=dbmanager" dbserver: detach: true image: mysql/mysql-cluster:7.5 environment: - MYSQL_DATABASE=encapto_ci_testing - MYSQL_ROOT_PASSWORD=mysql - MYSQL_ROOT_HOST=% commands: - cp /build/src/(snip)/back/API/container/drone/my.cnf /etc/my.cnf - sleep 10 - /entrypoint.sh mysqld --ndb-nodeid=4 --ndb-connectstring="nodeid=4\;host=dbmanager" dbmanager: detach: true image: mysql/mysql-cluster:7.5 commands: - cp /build/src/(snip)/back/API/container/drone/my.cnf /etc/my.cnf - > ndb_mgmd --nodaemon --ndb-nodeid=1 --connect-string="nodeid=1\;host=dbmanager" --config-file=/build/src/(snip)/back/API/container/drone/mysql-cluster.cnf build-image: image: docker commands: @@ -18,13 +57,18 @@ pipeline: image: "api-build:${DRONE_BUILD_NUMBER}" group: parallel-1 environment: - ENCAPTO_DATABASE_USER=root - ENCAPTO_DATABASE_PASSWORD=mysql - ENCAPTO_DATABASE_HOST=dbserver - ENCAPTO_DATABASE_NAME=encapto_ci_testing commands: # Ensure all db nodes are still running - ping -c1 dbnode1 - ping -c1 dbnode2 - ping -c1 dbmanager - ping -c1 dbserver # Wait for the mysql service to be ready. - while (! mysqladmin ping -hdbserver --silent); do sleep 1; done # Seed database with initial data. - composer run seed-db @@ -40,10 +84,10 @@ pipeline: generate-swagger: image: "api-build:${DRONE_BUILD_NUMBER}" environment: - ENCAPTO_DATABASE_USER=root - ENCAPTO_DATABASE_PASSWORD=mysql - ENCAPTO_DATABASE_HOST=dbserver - ENCAPTO_DATABASE_NAME=encapto_ci_testing commands: # Generate swagger.json. - composer run swagger-generate @@ -68,16 +112,14 @@ pipeline: image: "api-build:${DRONE_BUILD_NUMBER}" group: parallel-2 environment: - ENCAPTO_DATABASE_USER=root - ENCAPTO_DATABASE_PASSWORD=mysql - ENCAPTO_DATABASE_HOST=dbserver - ENCAPTO_DATABASE_NAME=encapto_ci_testing secrets: - source: meraki_api_key target: MERAKI_API_KEY commands: # The tests read the meraki key from a file. - echo $MERAKI_API_KEY > tests/meraki_api_key.txt # Run the tests. @@ -110,14 +152,34 @@ pipeline: publish: image: docker group: parallel-3 secrets: - source: portus_token target: PORTUS_TOKEN commands: # Login to the registry - docker login portus.(snip) -u drone-ci -p $PORTUS_TOKEN # Build production image, which includes the code and without xdebug. - > docker build . --target production -t portus.(snip)/build/api-php-fpm:latest -t portus.(snip)/build/api-php-fpm:$(cat VERSION) # Build the nginx proxy image. - > docker build ./nginx -t portus.(snip)/build/api-nginx:latest -t portus.(snip)/build/api-nginx:$(cat VERSION) # Build the db image. - > docker build ./db -t portus.(snip)/build/db:latest -t portus.(snip)/build/db:$(cat VERSION) # Publish to the registry - docker push portus.(snip)/build/api-php-fpm:latest - docker push portus.(snip)/build/api-php-fpm:$(cat VERSION) - docker push portus.(snip)/build/api-nginx:latest - docker push portus.(snip)/build/api-nginx:$(cat VERSION) - docker push portus.(snip)/build/db:latest - docker push portus.(snip)/build/db:$(cat VERSION) volumes: - /var/run/docker.sock:/var/run/docker.sock when: @@ -128,7 +190,8 @@ pipeline: delete-build-image: image: docker err_ignore: true ommands: # Delete the build image. - docker rmi api-build:${DRONE_BUILD_NUMBER} volumes: @@ -140,16 +203,10 @@ pipeline: slack: image: plugins/slack err_ignore: true webhook: https://hooks.slack.com/services/(snip) channel: ci when: status: - success - failure -
d0x2f revised this gist
Jan 28, 2018 . 1 changed file with 32 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,7 +6,11 @@ pipeline: build-image: image: docker commands: # Build development target, which includes xdebug. # Tag with both api-build:<build_number> and api-build:latest. # The <build_number> tag will be removed after the build # and the latest tag will stay as a cache. - docker build . --target development -t api-build:${DRONE_BUILD_NUMBER} -t api-build:latest volumes: - /var/run/docker.sock:/var/run/docker.sock @@ -19,7 +23,9 @@ pipeline: - DATABASE_HOST=mysql - DATABASE_NAME=(snip) commands: # Wait for the mysql service to be ready. - while (! mysqladmin ping -hmysql --silent); do sleep 1; done # Seed database with initial data. - composer run seed-db build: @@ -28,6 +34,7 @@ pipeline: volumes: - composer-cache:/root/.composer commands: # Install dependencies. - composer install --no-interaction --no-progress --no-suggest generate-swagger: @@ -38,6 +45,7 @@ pipeline: - DATABASE_HOST=mysql - DATABASE_NAME=(snip) commands: # Generate swagger.json. - composer run swagger-generate validate-swagger: @@ -46,6 +54,7 @@ pipeline: volumes: - npm-cache:/root/.npm commands: # Install swagger validator and validate swagger.json - "npm install -g swagger-cli" - "swagger-cli validate ./swagger.json" @@ -67,8 +76,11 @@ pipeline: - source: meraki_api_key target: MERAKI_API_KEY commands: # This php.ini contains settings to disable html_errors and to enable apcu for cli. - cp container/php.ini /etc/php7/php.ini # The tests read the meraki key from a file. - echo $MERAKI_API_KEY > tests/meraki_api_key.txt # Run the tests. - composer run test sonarqube: @@ -99,8 +111,13 @@ pipeline: image: docker group: parallel-3 commands: # Build production image, which includes the code and without xdebug. - docker build . --target production -t registry.(snip)/api:latest # Build the nginx proxy image. - docker build ./nginx -t registry.(snip)/api-nginx:latest # Publish both to the registry - docker push registry.(snip)/api:latest - docker push registry.(snip)/api-nginx:latest volumes: - /var/run/docker.sock:/var/run/docker.sock when: @@ -109,9 +126,20 @@ pipeline: status: - success delete-build-image: image: docker commands: # Delete the build image. - docker rmi api-build:${DRONE_BUILD_NUMBER} volumes: - /var/run/docker.sock:/var/run/docker.sock when: status: - success - failure slack: image: plugins/slack webhook: https://hooks.slack.com/services/(snip) channel: ci when: -
d0x2f renamed this gist
Jan 27, 2018 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
d0x2f created this gist
Jan 27, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,127 @@ workspace: base: /build pipeline: build-image: image: docker commands: - docker build . --target development -t api-build:${DRONE_BUILD_NUMBER} volumes: - /var/run/docker.sock:/var/run/docker.sock seed-db: image: "api-build:${DRONE_BUILD_NUMBER}" group: parallel-1 environment: - DATABASE_USER=root - DATABASE_PASSWORD=msyql - DATABASE_HOST=mysql - DATABASE_NAME=(snip) commands: - while (! mysqladmin ping -hmysql --silent); do sleep 1; done - composer run seed-db build: image: "api-build:${DRONE_BUILD_NUMBER}" group: parallel-1 volumes: - composer-cache:/root/.composer commands: - composer install --no-interaction --no-progress --no-suggest generate-swagger: image: "api-build:${DRONE_BUILD_NUMBER}" environment: - DATABASE_USER=root - DATABASE_PASSWORD=msyql - DATABASE_HOST=mysql - DATABASE_NAME=(snip) commands: - composer run swagger-generate validate-swagger: image: "node:alpine" group: parallel-2 volumes: - npm-cache:/root/.npm commands: - "npm install -g swagger-cli" - "swagger-cli validate ./swagger.json" sniff: image: "api-build:${DRONE_BUILD_NUMBER}" group: parallel-2 commands: - "composer run sniff" test: image: "api-build:${DRONE_BUILD_NUMBER}" group: parallel-2 environment: - DATABASE_USER=root - DATABASE_PASSWORD=msyql - DATABASE_HOST=mysql - DATABASE_NAME=(snip) secrets: - source: meraki_api_key target: MERAKI_API_KEY commands: - cp container/php.ini /etc/php7/php.ini - echo $MERAKI_API_KEY > tests/meraki_api_key.txt - composer run test sonarqube: image: newtmitch/sonar-scanner group: parallel-3 secrets: - source: sonar_token target: SONAR_TOKEN volumes: - sonar-cache:/root/.sonar/cache when: branch: - master - staging status: - success commands: - > sonar-scanner -Dsonar.projectName="API (${DRONE_BRANCH})" -Dsonar.host.url=https://sonarqube.(snip) -Dsonar.projectKey=api:${DRONE_BRANCH} -Dsonar.projectVersion=$(cat VERSION) -Dsonar.login=$SONAR_TOKEN -Dsonar.projectBaseDir=. publish: image: docker group: parallel-3 commands: - docker tag api-build:${DRONE_BUILD_NUMBER} registry.(snip):5000/api:latest - docker push registry.(snip):5000/api:latest volumes: - /var/run/docker.sock:/var/run/docker.sock when: branch: - master status: - success slack: image: plugins/slack group: parallel-3 webhook: https://hooks.slack.com/services/(snip) channel: ci when: status: - success - failure services: mysql: image: mysql:5.6 environment: - MYSQL_DATABASE=(snip) - MYSQL_ROOT_PASSWORD=msyql