From 0c92b571c51e304f25d58eb8dc80b7d5783f86ac Mon Sep 17 00:00:00 2001 From: Jasder <2053003901@@qq.com> Date: Wed, 21 Oct 2020 18:07:18 +0800 Subject: [PATCH] FIX perfect devops languages formate --- lib/tasks/dev_ops_languages.rake | 1023 ++++++++++++++++-------------- 1 file changed, 530 insertions(+), 493 deletions(-) diff --git a/lib/tasks/dev_ops_languages.rake b/lib/tasks/dev_ops_languages.rake index 59b99413a..fdac65cae 100644 --- a/lib/tasks/dev_ops_languages.rake +++ b/lib/tasks/dev_ops_languages.rake @@ -18,697 +18,734 @@ namespace :dev_ops_languages do [ { name: "C", - content: "kind: pipeline - name: default + content: " +kind: pipeline +name: default - platform: - os: linux - arch: arm64 +platform: + os: linux + arch: arm64 - steps: - - name: test - image: gcc - commands: - - ./configure - - make - - make test" +steps: +- name: test + image: gcc + commands: + - ./configure + - make + - make test" }, { name: "C++", - content: "kind: pipeline - name: default + content: " +kind: pipeline +name: default - platform: - os: linux - arch: arm64 +platform: + os: linux + arch: arm64 - steps: - - name: test - image: gcc - commands: - - ./configure - - make - - make test" +steps: +- name: test + image: gcc + commands: + - ./configure + - make + - make test" }, { name: "Docker", - content: "kind: pipeline - name: default + content: " +kind: pipeline +name: default - platform: - os: linux - arch: arm64 +platform: + os: linux + arch: arm64 - steps: - - name: test - image: docker:dind - volumes: - - name: dockersock - path: /var/run/docker.sock - commands: - - docker ps -a +steps: +- name: test + image: docker:dind + volumes: + - name: dockersock + path: /var/run/docker.sock + commands: + - docker ps -a - volumes: - - name: dockersock - host: - path: /var/run/docker.sock" +volumes: +- name: dockersock + host: + path: /var/run/docker.sock" }, { name: "Java", - content: "kind: pipeline - name: default + content: " +kind: pipeline +name: default - platform: - os: linux - arch: arm64 +platform: + os: linux + arch: arm64 - steps: - - name: test - image: maven:3-jdk-10 - commands: - - mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V - - mvn test -B" +steps: +- name: test + image: maven:3-jdk-10 + commands: + - mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V + - mvn test -B" }, { name: "R", - content: "kind: pipeline - name: default + content: ` +kind: pipeline +name: default - platform: - os: linux - arch: arm64 +platform: + os: linux + arch: arm64 - steps: - - name: test - image: r-base - commands: - - R -e 'install.packages(c('package1','package2'))' - - R CMD build ." +steps: +- name: test + image: r-base + commands: + - R -e 'install.packages(c("package1","package2"))' + - R CMD build .` }, { name: "Ruby", - content: "kind: pipeline - name: default + content: ` +kind: pipeline +name: default - platform: - os: linux - arch: arm64 +platform: + os: linux + arch: arm64 - steps: - - name: test - image: ruby - commands: - - bundle install --jobs=3 --retry=3 - - rake" +steps: +- name: test + image: ruby + commands: + - bundle install --jobs=3 --retry=3 + - rake` }, { name: "PHP", - content: "kind: pipeline - name: default + content: ` +kind: pipeline +name: default - platform: - os: linux - arch: arm64 +platform: + os: linux + arch: arm64 - steps: - - name: install - image: composer - commands: - - composer install +steps: +- name: install + image: composer + commands: + - composer install - - name: test - image: php:7 - commands: - - vendor/bin/phpunit --configuration config.xml" +- name: test + image: php:7 + commands: + - vendor/bin/phpunit --configuration config.xml` }, { name: "Python", - content: "kind: pipeline - name: default + content: ` +kind: pipeline +name: default - platform: - os: linux - arch: arm64 +platform: + os: linux + arch: arm64 - steps: - - name: test - image: python - commands: - - pip install -r requirements.txt - - pytest" +steps: +- name: test + image: python + commands: + - pip install -r requirements.txt + - pytest` }, { name: "MySQL", - content: "kind: pipeline - name: default + content: ` +kind: pipeline +name: default - platform: - os: linux - arch: arm64 +platform: + os: linux + arch: arm64 - steps: - - name: test - image: mysql - commands: - - sleep 15 - - mysql -u root -h database --execute='SELECT VERSION();' +steps: +- name: test + image: mysql + commands: + - sleep 15 + - mysql -u root -h database --execute="SELECT VERSION();" - services: - - name: database - image: mysql - environment: - MYSQL_ALLOW_EMPTY_PASSWORD: 'yes' - MYSQL_DATABASE: test" +services: +- name: database + image: mysql + environment: + MYSQL_ALLOW_EMPTY_PASSWORD: 'yes' + MYSQL_DATABASE: test` }, { name: "MongoDB", - content: 'kind: pipeline - name: default + content: ` +kind: pipeline +name: default - platform: - os: linux - arch: arm64 +platform: + os: linux + arch: arm64 - steps: - - name: ping - image: mongo:4 - commands: - - sleep 5 - - mongo --host mongo --eval "db.version()" +steps: +- name: ping + image: mongo:4 + commands: + - sleep 5 + - mongo --host mongo --eval "db.version()" - services: - - name: mongo - image: mongo:4 - command: [ --smallfiles ]' +services: +- name: mongo + image: mongo:4 + command: [ --smallfiles ]` }, { name: "Clojure", - content: "kind: pipeline - name: default + content: ` +kind: pipeline +name: default - platform: - os: linux - arch: arm64 +platform: + os: linux + arch: arm64 - steps: - - name: test - image: clojure - commands: - - lein test" +steps: +- name: test + image: clojure + commands: + - lein test` }, { name: "CouchDB", - content: "kind: pipeline - name: default + content: ` +kind: pipeline +name: default - platform: - os: linux - arch: arm64 +platform: + os: linux + arch: arm64 - steps: - - name: test - image: couchdb:2.2 - commands: - - sleep 15 - - curl http://database:5984 +steps: +- name: test + image: couchdb:2.2 + commands: + - sleep 15 + - curl http://database:5984 - services: - - name: database - image: couchdb:2.2" +services: +- name: database + image: couchdb:2.2` }, { name: "Crystal", - content: "kind: pipeline - name: default + content: ` +kind: pipeline +name: default - platform: - os: linux - arch: arm64 +platform: + os: linux + arch: arm64 - steps: - - name: test - image: crystallang/crystal - commands: - - shards install - - crystal spec.2" +steps: +- name: test + image: crystallang/crystal + commands: + - shards install + - crystal spec.2` }, { name: "D", - content: "kind: pipeline - name: default + content: ` +kind: pipeline +name: default - platform: - os: linux - arch: arm64 +platform: + os: linux + arch: arm64 - steps: - - name: test - image: dlanguage/dmd - commands: - - dub test" +steps: +- name: test + image: dlanguage/dmd + commands: + - dub test` }, { name: "Dart", - content: "kind: pipeline - name: default + content: ` +kind: pipeline +name: default - platform: - os: linux - arch: arm64 +platform: + os: linux + arch: arm64 - steps: - - name: test - image: google/dart - commands: - - pub get - - pub run test" +steps: +- name: test + image: google/dart + commands: + - pub get + - pub run test` }, { name: "Docker (dind)", - content: "kind: pipeline - name: default + content: ` +kind: pipeline +name: default - platform: - os: linux - arch: arm64 +platform: + os: linux + arch: arm64 - steps: - - name: test - image: docker:dind - volumes: - - name: dockersock - path: /var/run - commands: - - sleep 5 # give docker enough time to start - - docker ps -a +steps: +- name: test + image: docker:dind + volumes: + - name: dockersock + path: /var/run + commands: + - sleep 5 # give docker enough time to start + - docker ps -a - services: - - name: docker - image: docker:dind - privileged: true - volumes: - - name: dockersock - path: /var/run +services: +- name: docker + image: docker:dind + privileged: true + volumes: + - name: dockersock + path: /var/run - volumes: - - name: dockersock - temp: {}" +volumes: +- name: dockersock + temp: {}` }, { name: "Elasticsearch", - content: "kind: pipeline - name: default + content: ` +kind: pipeline +name: default - platform: - os: linux - arch: arm64 +platform: + os: linux + arch: arm64 - steps: - - name: test - image: alpine:3.8 - commands: - - apk add curl - - sleep 45 - - curl http://database:9200 +steps: +- name: test + image: alpine:3.8 + commands: + - apk add curl + - sleep 45 + - curl http://database:9200 - services: - - name: database - image: elasticsearch:5-alpine" +services: +- name: database + image: elasticsearch:5-alpine` }, { name: "Elixir", - content: "kind: pipeline - name: default + content: ` +kind: pipeline +name: default - platform: - os: linux - arch: arm64 +platform: + os: linux + arch: arm64 - steps: - - name: test - image: elixir:1.5 - commands: - - mix local.rebar --force - - mix local.hex --force - - mix deps.get - - mix test" +steps: +- name: test + image: elixir:1.5 + commands: + - mix local.rebar --force + - mix local.hex --force + - mix deps.get + - mix test` }, { name: "Erlang", - content: "kind: pipeline - name: default + content: ` +kind: pipeline +name: default - platform: - os: linux - arch: arm64 +platform: + os: linux + arch: arm64 - steps: - - name: test - image: erlang:21 - commands: - - rebar get-deps - - rebar compile - - rebar skip_deps=true eunit" +steps: +- name: test + image: erlang:21 + commands: + - rebar get-deps + - rebar compile + - rebar skip_deps=true eunit` }, { name: "20.Go (with Gopath)", - content: "kind: pipeline - name: default + content: ` +kind: pipeline +name: default - platform: - os: linux - arch: arm64 +platform: + os: linux + arch: arm64 - workspace: - base: /go - path: src/hello-world +workspace: + base: /go + path: src/hello-world - steps: - - name: test - image: golang - commands: - - go get - - go test" +steps: +- name: test + image: golang + commands: + - go get + - go test` }, { name: "21.Go (with Modules)", - content: "kind: pipeline - name: default + content: ` +kind: pipeline +name: default - platform: - os: linux - arch: arm64 +platform: + os: linux + arch: arm64 - steps: - - name: test - image: golang - commands: - - go test - - go build" +steps: +- name: test + image: golang + commands: + - go test + - go build` }, { name: "Gradle", - content: "kind: pipeline - name: default + content: ` +kind: pipeline +name: default - platform: - os: linux - arch: arm64 +platform: + os: linux + arch: arm64 - steps: - - name: test - image: gradle:jdk10 - commands: - - gradle assemble - - gradle check" +steps: +- name: test + image: gradle:jdk10 + commands: + - gradle assemble + - gradle check` }, { name: "Groovy", - content: "kind: pipeline - name: default + content: ` +kind: pipeline +name: default - platform: - os: linux - arch: arm64 +platform: + os: linux + arch: arm64 - steps: - - name: test - image: gradle:2.5-jdk8 - commands: - - ./gradlew assemble - - ./gradlew check" +steps: +- name: test + image: gradle:2.5-jdk8 + commands: + - ./gradlew assemble + - ./gradlew check` }, { name: "Haskell", - content: "kind: pipeline - name: default + content: ` +kind: pipeline +name: default - platform: - os: linux - arch: arm64 +platform: + os: linux + arch: arm64 - steps: - - name: test - image: haskell - commands: - - cabal install --only-dependencies --enable-tests - - cabal configure --enable-tests - - cabal build - - cabal test" +steps: +- name: test + image: haskell + commands: + - cabal install --only-dependencies --enable-tests + - cabal configure --enable-tests + - cabal build + - cabal test` }, { name: "Haxe", - content: "kind: pipeline - name: default + content: ` +kind: pipeline +name: default - platform: - os: linux - arch: arm64 +platform: + os: linux + arch: arm64 - steps: - - name: test - image: haxe - commands: - - haxelib install build.hxml - - haxe build.hxml" +steps: +- name: test + image: haxe + commands: + - haxelib install build.hxml + - haxe build.hxml` }, { name: "MariaDB", - content: 'kind: pipeline - name: default + content: ` +kind: pipeline +name: default - platform: - os: linux - arch: arm64 +platform: + os: linux + arch: arm64 - steps: - - name: test - image: mariadb - commands: - - sleep 15 - - mysql -u root -h database --execute="SELECT VERSION();" +steps: +- name: test + image: mariadb + commands: + - sleep 15 + - mysql -u root -h database --execute="SELECT VERSION();" - services: - - name: database - image: mariadb - environment: - MYSQL_ALLOW_EMPTY_PASSWORD: "yes" - MYSQL_DATABASE: test' +services: +- name: database + image: mariadb + environment: + MYSQL_ALLOW_EMPTY_PASSWORD: 'yes' + MYSQL_DATABASE: test` }, { name: "Maven", - content: "kind: pipeline - name: default + content: ` +kind: pipeline +name: default - platform: - os: linux - arch: arm64 +platform: + os: linux + arch: arm64 - steps: - - name: test - image: maven:3-jdk-10 - commands: - - mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V - - mvn test -B" +steps: +- name: test + image: maven:3-jdk-10 + commands: + - mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V + - mvn test -B` }, { name: "Memcached", - content: 'kind: pipeline - name: default + content: ` +kind: pipeline +name: default - platform: - os: linux - arch: arm64 +platform: + os: linux + arch: arm64 - steps: - - name: test - image: ubuntu - commands: - - apt-get update -qq - - apt-get install -y -qq telnet > /dev/null - - (sleep 1; echo "stats"; sleep 2; echo "quit";) | telnet cache 11211 || true +steps: +- name: test + image: ubuntu + commands: + - apt-get update -qq + - apt-get install -y -qq telnet > /dev/null + - (sleep 1; echo "stats"; sleep 2; echo "quit";) | telnet cache 11211 || true - services: - - name: cache - image: memcached:alpine - command: [ -vv ]' +services: +- name: cache + image: memcached:alpine + command: [ -vv ]` }, { name: "Nats", - content: "kind: pipeline - name: default + content: ` +kind: pipeline +name: default - platform: - os: linux - arch: arm64 +platform: + os: linux + arch: arm64 - steps: - - name: test - image: ruby:2 - commands: - - gem install nats - - nats-pub -s tcp://nats:4222 greeting 'hello' - - nats-pub -s tcp://nats:4222 greeting 'world' +steps: +- name: test + image: ruby:2 + commands: + - gem install nats + - nats-pub -s tcp://nats:4222 greeting 'hello' + - nats-pub -s tcp://nats:4222 greeting 'world' - services: - - name: nats - image: nats:1.3.0" +services: +- name: nats + image: nats:1.3.0` }, { name: "Node", - content: "kind: pipeline - name: default + content: ` +kind: pipeline +name: default - platform: - os: linux - arch: arm64 +platform: + os: linux + arch: arm64 - steps: - - name: test - image: node - commands: - - npm install - - npm test" +steps: +- name: test + image: node + commands: + - npm install + - npm test` }, { name: "Perl", - content: "kind: pipeline - name: default + content: ` +kind: pipeline +name: default - platform: - os: linux - arch: arm64 +platform: + os: linux + arch: arm64 - steps: - - name: test - image: perl - commands: - - cpanm --quiet --installdeps --notest . - - perl Build.PL - - ./Build test" +steps: +- name: test + image: perl + commands: + - cpanm --quiet --installdeps --notest . + - perl Build.PL + - ./Build test` }, { name: "Postgres", - content: "kind: pipeline - name: default + content: ` +kind: pipeline +name: default - platform: - os: linux - arch: arm64 +platform: + os: linux + arch: arm64 - steps: - - name: test - image: postgres:9-alpine - commands: - - psql -U postgres -d test -h database +steps: +- name: test + image: postgres:9-alpine + commands: + - psql -U postgres -d test -h database - services: - - name: database - image: postgres:9-alpine - environment: - POSTGRES_USER: postgres - POSTGRES_DB: test" +services: +- name: database + image: postgres:9-alpine + environment: + POSTGRES_USER: postgres + POSTGRES_DB: test` }, { name: "Redis", - content: "kind: pipeline - name: default + content: ` +kind: pipeline +name: default - platform: - os: linux - arch: arm64 +platform: + os: linux + arch: arm64 - steps: - - name: test - image: redis - commands: - - sleep 5 - - redis-cli -h redis ping - - redis-cli -h redis set FOO bar - - redis-cli -h redis get FOO +steps: +- name: test + image: redis + commands: + - sleep 5 + - redis-cli -h redis ping + - redis-cli -h redis set FOO bar + - redis-cli -h redis get FOO - services: - - name: redis - image: redis" +services: +- name: redis + image: redis` }, { name: "RethinkDB", - content: "kind: pipeline - name: default + content: ` +kind: pipeline +name: default - platform: - os: linux - arch: arm64 +platform: + os: linux + arch: arm64 - steps: - - name: test - image: node:9 - commands: - - npm install -s -g recli - - recli -h database -j" + 'r.db("rethinkdb").table("stats")' + +steps: +- name: test + image: node:9 + commands: + - npm install -s -g recli + - recli -h database -j 'r.db("rethinkdb").table("stats")' - "services: - - name: database - image: rethinkdb:2 - command: [ rethinkdb, --bind, all ]" +services: +- name: database + image: rethinkdb:2 + command: [ rethinkdb, --bind, all ]` }, { name: "Rust", - content: "kind: pipeline - name: default + content: ` +kind: pipeline +name: default - platform: - os: linux - arch: arm64 +platform: + os: linux + arch: arm64 - steps: - - name: test - image: rust:1.30 - commands: - - cargo build --verbose --all - - cargo test --verbose --all" +steps: +- name: test + image: rust:1.30 + commands: + - cargo build --verbose --all + - cargo test --verbose --all` }, { name: "Swift", - content: "kind: pipeline - name: default + content: ` +kind: pipeline +name: default - platform: - os: linux - arch: arm64 +platform: + os: linux + arch: arm64 - steps: - - name: test - image: swift:4 - commands: - - swift build - - swift test" +steps: +- name: test + image: swift:4 + commands: + - swift build + - swift test` }, { name: "Vault", - content: "kind: pipeline - name: default + content: ` +kind: pipeline +name: default - platform: - os: linux - arch: arm64 +platform: + os: linux + arch: arm64 - steps: - - name: test - image: vault:1.0.0-beta2 - environment: - VAULT_ADDR: http://vault:8200 - VAULT_TOKEN: dummy - commands: - - sleep 5 - - vault kv put secret/my-secret my-value=s3cr3t - - vault kv get secret/my-secret +steps: +- name: test + image: vault:1.0.0-beta2 + environment: + VAULT_ADDR: http://vault:8200 + VAULT_TOKEN: dummy + commands: + - sleep 5 + - vault kv put secret/my-secret my-value=s3cr3t + - vault kv get secret/my-secret - services: - - name: vault - image: vault:1.0.0-beta2 - environment: - VAULT_DEV_ROOT_TOKEN_ID: dummy" +services: +- name: vault + image: vault:1.0.0-beta2 + environment: + VAULT_DEV_ROOT_TOKEN_ID: dummy` } ] end