Giter VIP home page Giter VIP logo

hands-on-auto-devops-with-gitlab-ci's Introduction

Hands-On Auto DevOps with GitLab CI [Video]

This is the code repository for Hands-On Auto DevOps with GitLab CI [Video], published by Packt. It contains all the supporting project files necessary to work through the video course from start to finish.

About the Video Course

Developing modern software requires an automated pipeline that builds, tests, and deploys your application, complete with its required infrastructure.

GitLab is a Git-based version control server, available at gitlab.com or as a private server. GitLab CI is automated build and deployment built right into GitLab. With GitLab CI, it is easy to add build and deployment automation that triggers on every code change, helping you build high-quality, reliable software and deploy it to production at speed.

This course will give you a hands-on tutorial with GitLab CI. You will use GitLab CI to create a DevOps Pipeline to automatically build, test, and deploy software to virtual machines and container environments. You will explore the features of GitLab CI, including using runners to execute build jobs, creating multi-stage builds, deploying to virtualized and containerized environments, and automatically building and updating documentation with GitLab Pages.

You will see how easy it is to get started with GitLab CI by deploying your own runners in cloud environments or on your own servers, using Docker and Kubernetes or ordinary scripting. By the end of this course, you’ll be ready to use GitLab CI for your own application, automating your build and deployment pipeline.

What You Will Learn

  • Automate your application builds, tests, and deployments through a simple configuration of GitLab CI.
  • Build confidence in your software by integrating test and quality checking into your development process.
  • Deploy your application automatically to virtualized and containerized cloud environments so your software is always up-to-date
  • Integrate monitoring so you can be sure your application is working well in production
  • Create your own automated build infrastructure fully under your control.

Instructions and Navigation

Assumed Knowledge

To fully benefit from the coverage included in this course, you will need:
To fully benefit from the coverage included in this course, you will need:

● An understanding of building and deploying software

● Basic knowledge of Git and version control tools. You don’t need any prior experience building with GitLab CI.

Technical Requirements

This course has the following software requirements:
This course has the following software requirements:

● An editor (Atom suggested)

● Recommended packages: atom-ide-ui, ide-yaml

● Git (either Git for Windows or a Git command-line client)

● To run GitLab and GitLab Runner:

● Access to at least one physical or virtual machine running Linux

● See README.md in the exercise files for next steps

You can get started with automated builds with GitLab CI with no more than a web browser! However, to get the most out of this course, we recommend enough hardware to run a private GitLab server. This course has been tested on the following system configuration:

● OS: Ubuntu 18.04

● Processor: Quad Core Intel

● Memory: 8GB

● Hard Disk Space: 100GB

This course demonstrates using the resources available on gitlab.com, for which only access to the Internet is needed. This course also demonstrates building private GitLab infrastructure. The examples use Amazon Web Services to create the needed computing resources, but other cloud providers or local hardware will work as well.

Related Products

hands-on-auto-devops-with-gitlab-ci's People

Contributors

alanhohn avatar packt-itservice avatar packtutkarshr avatar siddheshkavle avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hands-on-auto-devops-with-gitlab-ci's Issues

kube-deploy project fails on db-migrate up

Seems to be generally fine until db-migrate up and then the step fails:

image

�[0KRunning with gitlab-runner 12.3.0 (a8a019e0)
�[0;m�[0K  on docker-auto-scale fa6cab46
�[0;msection_start:1569362829:prepare_executor
�[0K�[0KUsing Docker executor with image node:10 ...
�[0;m�[0KStarting service postgres:10 ...
�[0;m�[0KPulling docker image postgres:10 ...
�[0;m�[0KUsing docker image sha256:ee2097dc5afabe77aee5d1872e2e838848659bb1ecfef0a78bd824b6e3feb159 for postgres:10 ...
�[0;m�[0KWaiting for services to be up and running...
�[0;m�[0KPulling docker image node:10 ...
�[0;m�[0KUsing docker image sha256:636ef87129d69cb758968d81123a1d15a521a24eeab35c2d63ebb41c0f87b0ad for node:10 ...
�[0;msection_end:1569362887:prepare_executor
�[0Ksection_start:1569362887:prepare_script
�[0KRunning on runner-fa6cab46-project-14482361-concurrent-0 via runner-fa6cab46-srm-1569362779-378f0ae1...
section_end:1569362891:prepare_script
�[0Ksection_start:1569362891:get_sources
�[0K�[32;1mFetching changes with git depth set to 50...�[0;m
Initialized empty Git repository in /builds/todd-dsm/kube-deploy/.git/
�[32;1mCreated fresh repository.�[0;m
From https://gitlab.com/todd-dsm/kube-deploy
 * [new branch]      master     -> origin/master
�[32;1mChecking out aa410c47 as master...�[0;m

�[32;1mSkipping Git submodules setup�[0;m
section_end:1569362893:get_sources
�[0Ksection_start:1569362893:restore_cache
�[0K�[32;1mChecking cache for master...�[0;m
�[31;1mFATAL: file does not exist                        �[0;m 
�[0;33mFailed to extract cache�[0;m
section_end:1569362894:restore_cache
�[0Ksection_start:1569362894:download_artifacts
�[0Ksection_end:1569362896:download_artifacts
�[0Ksection_start:1569362896:build_script
�[0K�[32;1m$ ./ci-test.sh�[0;m
Running npm install on application
added 278 packages from 640 contributors and audited 561 packages in 8.389s
found 16 vulnerabilities (1 low, 2 moderate, 13 high)
  run `npm audit fix` to fix them, or `npm audit` for details

> [email protected] grunt /builds/todd-dsm/kube-deploy
> grunt

Running "clean:vendor-js" (clean) task
>> 0 paths cleaned.

Running "clean:vendor-css" (clean) task
>> 0 paths cleaned.

Running "bowercopy:js" (bowercopy) task
bower not-cached https://github.com/jquery/jquery-dist.git#~2.0.0
bower resolve https://github.com/jquery/jquery-dist.git#~2.0.0
bower not-cached https://github.com/jashkenas/backbone.git#~1.1.1
bower resolve https://github.com/jashkenas/backbone.git#~1.1.1
bower not-cached https://github.com/jashkenas/underscore.git#~1.6.0
bower resolve https://github.com/jashkenas/underscore.git#~1.6.0
bower not-cached https://github.com/tastejs/todomvc-common.git#~0.1.4
bower resolve https://github.com/tastejs/todomvc-common.git#~0.1.4
bower download https://github.com/tastejs/todomvc-common/archive/v0.1.11.tar.gz
bower download https://github.com/jquery/jquery-dist/archive/2.0.3.tar.gz
bower download https://github.com/jashkenas/backbone/archive/1.1.2.tar.gz
bower download https://github.com/jashkenas/underscore/archive/1.6.0.tar.gz
bower extract archive.tar.gz
bower extract archive.tar.gz
bower extract archive.tar.gz
bower resolved https://github.com/tastejs/todomvc-common.git#0.1.11
bower extract archive.tar.gz
bower resolved https://github.com/jashkenas/underscore.git#1.6.0
bower resolved https://github.com/jquery/jquery-dist.git#2.0.3
bower resolved https://github.com/jashkenas/backbone.git#1.1.2
bower install todomvc-common#0.1.11
bower install underscore#1.6.0
bower install jquery#2.0.3
bower install backbone#1.1.2
/builds/todd-dsm/kube-deploy/bower_components/todomvc-common/base.js -> public/js/vendor/todomvc-common.js
/builds/todd-dsm/kube-deploy/bower_components/jquery/jquery.js -> public/js/vendor/jquery.js
/builds/todd-dsm/kube-deploy/bower_components/underscore/underscore.js -> public/js/vendor/underscore.js
/builds/todd-dsm/kube-deploy/bower_components/backbone/backbone.js -> public/js/vendor/backbone.js

Running "bowercopy:css" (bowercopy) task
/builds/todd-dsm/kube-deploy/bower_components/todomvc-common/base.css -> public/css/vendor/todomvc-common.css
>> All modules accounted for

Done.
Capturing npm audit results
Running database migration

> [email protected] prestart /builds/todd-dsm/kube-deploy
> db-migrate up

[ERROR] AssertionError [ERR_ASSERTION]: ifError got unwanted exception: no PostgreSQL user name specified in startup packet
    at module.exports (/builds/todd-dsm/kube-deploy/node_modules/db-migrate/lib/commands/helper/assert.js:9:14)
    at /builds/todd-dsm/kube-deploy/node_modules/db-migrate/lib/commands/up.js:19:14
    at /builds/todd-dsm/kube-deploy/node_modules/db-migrate/connect.js:17:7
    at /builds/todd-dsm/kube-deploy/node_modules/db-migrate/lib/driver/index.js:95:9
    at /builds/todd-dsm/kube-deploy/node_modules/db-migrate-pg/index.js:653:7
    at Connection.connectingErrorHandler (/builds/todd-dsm/kube-deploy/node_modules/pg/lib/client.js:123:14)
    at Connection.emit (events.js:198:13)
    at Socket.<anonymous> (/builds/todd-dsm/kube-deploy/node_modules/pg/lib/connection.js:123:12)
    at Connection.parseE (/builds/todd-dsm/kube-deploy/node_modules/pg/lib/connection.js:553:11)
    at Connection.parseMessage (/builds/todd-dsm/kube-deploy/node_modules/pg/lib/connection.js:378:19)
    at Socket.<anonymous> (/builds/todd-dsm/kube-deploy/node_modules/pg/lib/connection.js:119:22)
    at Socket.emit (events.js:198:13)
    at addChunk (_stream_readable.js:288:12)
    at readableAddChunk (_stream_readable.js:269:11)
    at Socket.Readable.push (_stream_readable.js:224:10)
    at TCP.onStreamRead [as onread] (internal/stream_base_commons.js:94:17)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] prestart: `db-migrate up`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] prestart script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2019-09-24T22_08_30_945Z-debug.log
Running test

> [email protected] test /builds/todd-dsm/kube-deploy
> mocha --exit

Todo service listening on port 5000


  Todo API 
    the pre-requisites
      ✓ the api root responds to a GET (i.e. the server is up and accessible, CORS headers are set up)
      1) the api root responds to a POST with the todo which was posted to it
      ✓ the api root responds successfully to a DELETE
      2) after a DELETE the api root responds to a GET with a JSON representation of an empty array
    storing new todos by posting to the root url
      3) adds a new todo to the list of todos at the root url
      4) sets up a new todo as initially not completed
      5) each new todo has a url
      6) each new todo has a url, which returns a todo
    working with an existing todo
      7) can navigate from a list of todos to an individual todo via urls
      8) can change the todo's title by PATCHing to the todo's url
      9) can change the todo's completedness by PATCHing to the todo's url
      10) changes to a todo are persisted and show up when re-fetching the todo
      11) can delete a todo making a DELETE request to the todo's url
    tracking todo order
      12) can create a todo with an order field
      13) can PATCH a todo to change its order
      14) remembers changes to a todo's order


  2 passing (188ms)
  14 failing

  1) Todo API 
       the pre-requisites
         the api root responds to a POST with the todo which was posted to it:
     AssertionError: expected {} to have property 'title'
      at getBasePromise.then.then.newArgs (node_modules/chai-as-promised/lib/chai-as-promised.js:302:22)
      at process._tickCallback (internal/process/next_tick.js:68:7)

  2) Todo API 
       the pre-requisites
         after a DELETE the api root responds to a GET with a JSON representation of an empty array:
     AssertionError: expected {} to deeply equal []
      at Proxy.assertEqual (node_modules/chai/lib/chai/core/assertions.js:1020:19)
      at Proxy.methodWrapper (node_modules/chai/lib/chai/utils/addMethod.js:57:25)
      at getBasePromise.then.then.newArgs (node_modules/chai-as-promised/lib/chai-as-promised.js:302:22)
      at process._tickCallback (internal/process/next_tick.js:68:7)

  3) Todo API 
       storing new todos by posting to the root url
         adds a new todo to the list of todos at the root url:
     AssertionError: expected {} to have property 'length'
      at /builds/todd-dsm/kube-deploy/test/test-server.js:95:38
      at process._tickCallback (internal/process/next_tick.js:68:7)

  4) Todo API 
       storing new todos by posting to the root url
         sets up a new todo as initially not completed:
     AssertionError: expected {} to have property 'completed'
      at /builds/todd-dsm/kube-deploy/test/test-server.js:111:30
      at process._tickCallback (internal/process/next_tick.js:68:7)

  5) Todo API 
       storing new todos by posting to the root url
         each new todo has a url:
     AssertionError: expected {} to have property 'url'
      at /builds/todd-dsm/kube-deploy/test/test-server.js:118:32
      at process._tickCallback (internal/process/next_tick.js:68:7)

  6) Todo API 
       storing new todos by posting to the root url
         each new todo has a url, which returns a todo:
     TypeError [ERR_INVALID_ARG_TYPE]: The "url" argument must be of type string. Received type undefined
      at Url.parse (url.js:154:11)
      at Object.urlParse [as parse] (url.js:148:13)
      at getRaw (test/test-server.js:22:39)
      at get (test/test-server.js:18:10)
      at /builds/todd-dsm/kube-deploy/test/test-server.js:125:18
      at process._tickCallback (internal/process/next_tick.js:68:7)

  7) Todo API 
       working with an existing todo
         can navigate from a list of todos to an individual todo via urls:
     AssertionError: expected {} to have property 'length'
      at /builds/todd-dsm/kube-deploy/test/test-server.js:144:34
      at _fulfilled (node_modules/q/q.js:854:54)
      at /builds/todd-dsm/kube-deploy/node_modules/q/q.js:883:30
      at Promise.promise.promiseDispatch (node_modules/q/q.js:816:13)
      at /builds/todd-dsm/kube-deploy/node_modules/q/q.js:624:44
      at runSingle (node_modules/q/q.js:137:13)
      at flush (node_modules/q/q.js:125:13)
      at process._tickCallback (internal/process/next_tick.js:61:11)

  8) Todo API 
       working with an existing todo
         can change the todo's title by PATCHing to the todo's url:
     TypeError [ERR_INVALID_ARG_TYPE]: The "url" argument must be of type string. Received type undefined
      at Url.parse (url.js:154:11)
      at Object.urlParse [as parse] (url.js:148:13)
      at patch (test/test-server.js:34:41)
      at patchJson (test/test-server.js:38:10)
      at /builds/todd-dsm/kube-deploy/test/test-server.js:154:18
      at process._tickCallback (internal/process/next_tick.js:68:7)

  9) Todo API 
       working with an existing todo
         can change the todo's completedness by PATCHing to the todo's url:
     TypeError [ERR_INVALID_ARG_TYPE]: The "url" argument must be of type string. Received type undefined
      at Url.parse (url.js:154:11)
      at Object.urlParse [as parse] (url.js:148:13)
      at patch (test/test-server.js:34:41)
      at patchJson (test/test-server.js:38:10)
      at /builds/todd-dsm/kube-deploy/test/test-server.js:163:18
      at process._tickCallback (internal/process/next_tick.js:68:7)

  10) Todo API 
       working with an existing todo
         changes to a todo are persisted and show up when re-fetching the todo:
     TypeError [ERR_INVALID_ARG_TYPE]: The "url" argument must be of type string. Received type undefined
      at Url.parse (url.js:154:11)
      at Object.urlParse [as parse] (url.js:148:13)
      at patch (test/test-server.js:34:41)
      at patchJson (test/test-server.js:38:10)
      at /builds/todd-dsm/kube-deploy/test/test-server.js:172:18
      at process._tickCallback (internal/process/next_tick.js:68:7)

  11) Todo API 
       working with an existing todo
         can delete a todo making a DELETE request to the todo's url:
     TypeError [ERR_INVALID_ARG_TYPE]: The "url" argument must be of type string. Received type undefined
      at Url.parse (url.js:154:11)
      at Object.urlParse [as parse] (url.js:148:13)
      at delete_ (test/test-server.js:42:42)
      at /builds/todd-dsm/kube-deploy/test/test-server.js:202:18
      at process._tickCallback (internal/process/next_tick.js:68:7)

  12) Todo API 
       tracking todo order
         can create a todo with an order field:
     AssertionError: expected {} to have property 'order'
      at getBasePromise.then.then.newArgs (node_modules/chai-as-promised/lib/chai-as-promised.js:302:22)
      at process._tickCallback (internal/process/next_tick.js:68:7)

  13) Todo API 
       tracking todo order
         can PATCH a todo to change its order:
     TypeError [ERR_INVALID_ARG_TYPE]: The "url" argument must be of type string. Received type undefined
      at Url.parse (url.js:154:11)
      at Object.urlParse [as parse] (url.js:148:13)
      at patch (test/test-server.js:34:41)
      at patchJson (test/test-server.js:38:10)
      at /builds/todd-dsm/kube-deploy/test/test-server.js:218:18
      at process._tickCallback (internal/process/next_tick.js:68:7)

  14) Todo API 
       tracking todo order
         remembers changes to a todo's order:
     TypeError [ERR_INVALID_ARG_TYPE]: The "url" argument must be of type string. Received type undefined
      at Url.parse (url.js:154:11)
      at Object.urlParse [as parse] (url.js:148:13)
      at patch (test/test-server.js:34:41)
      at patchJson (test/test-server.js:38:10)
      at /builds/todd-dsm/kube-deploy/test/test-server.js:227:18
      at process._tickCallback (internal/process/next_tick.js:68:7)



npm ERR! Test failed.  See above for more details.
section_end:1569362913:build_script
�[0Ksection_start:1569362913:after_script
�[0Ksection_end:1569362914:after_script
�[0Ksection_start:1569362914:upload_artifacts_on_failure
�[0K�[32;1mUploading artifacts...�[0;m
package-lock.json: found 1 matching files         �[0;m 
npm-audit.json: found 1 matching files            �[0;m 
Uploading artifacts to coordinator... ok          �[0;m  id�[0;m=303039710 responseStatus�[0;m=201 Created token�[0;m=WsU118q6
section_end:1569362917:upload_artifacts_on_failure
�[0K�[31;1mERROR: Job failed: exit code 1
�[0;m

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.