Skip to content
Snippets Groups Projects
Commit be84cce5 authored by Jose Torres's avatar Jose Torres
Browse files

Add Eclipse content

parent fdb6ad07
No related branches found
No related tags found
No related merge requests found
Pipeline #
Loading
Loading
@@ -28,4 +28,3 @@ pages:
- public/
only:
- master
[![build status](https://gitlab.com/gitlab-org/ci-training-slides/badges/master/build.svg)](https://gitlab.com/gitlab-org/ci-training-slides/commits/master)
[![build status](https://gitlab.com/balameb/eclipse-gitlab-slides/badges/master/build.svg)](https://gitlab.com/balameb/eclipse-gitlab-slides/commits/master)
 
# CI/CD GitLab Training
# Eclipse & GitLab
 
This project hosts the RevelJS framework and content that renders the CI/CD trainingt slides. Presentation behavior and
functionality is better understood by reading the [reveal.js](https://github.com/hakimel/reveal.js) instructions.
functionality is better understood by reading the [reveal.js](https://github.com/hakimel/reveal.js) instructions.
 
These slides also have Speaker Notes to guide the instructor, you can access them by pressing `s` on the presenetation's
These slides also have Speaker Notes to guide the instructor, you can access them by pressing `s` on the presentation's
browser window.
 
## Syllabus
 
Content is design to be served in one session of about three or three and a half hours.
Content is design to be served in one session of about three or three and a half hours.
 
- What is CI/CD
- What can you do with CI
- Sample app
- Activate builds
- Adding a gitlab-ci.yml file
- Configuring and Setup CI
- Gitlab-ci.yml
- Jobs
- Services
- Stages
- Only and except
- When
- CI Lint
- Pipelines and builds
- Artifacts
- What are Runners
- Setup and configure your Runner
### Sample Application
The slides require using a sample CI application which can be found at https://gitlab.com/gitlab-org/ci-training-sample
- Introduction to Eclipse
- Setting up Eclipse with Git
- Working with repositories
- Git Stages
- Branching and Workflow
 
## reveal.js References:
- [Installation](https://github.com/hakimel/reveal.js/#installation): Step-by-step instructions for getting reveal.js
- [Installation](https://github.com/hakimel/reveal.js/#installation): Step-by-step instructions for getting reveal.js
running on your computer.
- [Browser Support](https://github.com/hakimel/reveal.js/wiki/Browser-Support): Explanation of browser support and
- [Browser Support](https://github.com/hakimel/reveal.js/wiki/Browser-Support): Explanation of browser support and
fallbacks.
- [Speaker Notes](https://github.com/hakimel/reveal.js/#speaker-notes): Plugin to view speaker notes on a different
- [Speaker Notes](https://github.com/hakimel/reveal.js/#speaker-notes): Plugin to view speaker notes on a different
browser window.
- [PDF Export](https://github.com/hakimel/reveal.js/#pdf-export): Export slides to a PDF.
## Git Branches
----------
### Branching
- Top menu Branch icon or Git dropdown branch icon.
- Choose create new branch (you can also checkout one from here)
- Select a source branch
- Create a new branch
----------
### Feature and Fix Branches
- Start with an issue
- Create a new branch
- Fetch it
- Check out branch
- Work on stuff
- Add and commit
- Push back to remote
- Open a Merge request
----------
### Git Workflows
- GitHub flow
- Git Flow
- GitLab Flow
----------
### Git Flow
- Git Flow init setup
- Right click on project and select git flow
- What it does and how it helps
----------
### Resources
- https://about.gitlab.com/2014/09/29/gitlab-flow/
## Docker
Download and modify a Docker image:
```
docker images
docker run -t -i ruby:2.3 /bin/bash
$ apt-get update
$ apt-get install nodejs -y
$ gem install bundler --no-ri --no-rdoc
# A Dockerfile is a great option for the following line or
# maybe integrate with our current CI script?
$ bundle install
$ exit
# Log back in?
docker ps -a # and get container sha
docker start -i <container-sha>
```
----------
## Create a custom image
```
# Commit a new image
docker commit -m "Adds dependencies" -a "Peter Parker" \
<container-sha> registry.gitlab.com/<group-name>/projectname:v2
# Or commit the image and tag it later
docker tag <image id> <url>:<port>/<user/project>:<tag>
# Login in to GitLab registry
# docker login registry.gitlab.com
docker login <url>:<port>
# Push image to registry
# docker push registry.gitlab.com/gitlab-org/ci-training-sample
docker push <registry-url>/<group-name>/<project-name>:<tag>
```
[Back](#/agenda)
## Git Stages
----------
### Git Workflow
- Work on something:
- ignoring
- Add to Index
- Commit and write message
- Push to Remote
----------
### Git Workflow
- Get stuff from the server
- Fetch updates
- Pull to master
- Merge into ...
- Rebase master to your branch
----------
### Eclipse Views
- Repository view
- Manage repos
- Staging view
- Workflow: Index, Commits and Push
- History View
- Audit
- Review branches
----------
### Noteworthy Resources
- http://www.ndpsoftware.com/git-cheatsheet.html#loc=workspace;
- http://learngitbranching.js.org/?demo
## Configurations: gitlab-ci.yml
----------
### Let's start building the app
- What is the `gitlab-ci.yml` file?
- Review the file with CI Lint at Pipelines
- Our plan:
- Image
- Services
- Environments
- Stages
- Jobs
----------
- Before and After Scripts
- Caching
- Artifacts & On Success
- Only and except
- When
- Pages
----------
### Docker Image & Registry
Use a public image:
```
image: ruby:2.3
```
Use a custom image:
```
image: "registry.gitlab.com/gitlab-org/ci-training-sample:ruby-and-gems"
```
----------
### Services and Variables
- Pre defined vars: https://docs.gitlab.com/ce/ci/variables/README.html
```
services:
- postgres
variables:
POSTGRES_DB: rails-sample-1_test
POSTGRES_USER: root
POSTGRES_PASSWORD: ""
```
----------
### Stages
- Default stages: build, test, deploy
- User can define any custom stage and any number of jobs per stage
```
stages:
- build
- test
- deploy
```
----------
### Before and After Scripts
```
before_script:
- echo CI_BUILD_STAGE
- apt-get update
- apt-get install nodejs -y
- gem install bundler --no-ri --no-rdoc
- bundle install
```
----------
### Caching
```
cache:
key: "%CI_BUILD_STAGE%/%CI_BUILD_REF_NAME%"
paths:
- vendor/ruby
```
----------
### Templates
- Anchors, aliases and merging with yml
```
.hidden_anchor: &ruby_info
script:
- echo ruby -v
- echo which ruby
env_info:
<<: *ruby_info
stage: build
```
----------
### Artifacts & On Success
```
system_specs:
stage: build
script:
- echo "author:"
- echo GITLAB_USER_EMAIL
- touch system_info
- uname -a > system_info
artifacts:
when: on_success
paths:
- system_info
```
----------
### Tests and Manual trigger
```
rspec:
stage: test
when: manual
script:
- "sed -i 's/host:.*/host: postgres/g' config/database.yml"
- "sed -i 's/username:.*/username: root/g' config/database.yml"
- bundle exec rake db:migrate RAILS_ENV=test
- bundle exec rake spec
```
----------
### Environments, Only and Deploying
```
pseudo-deploy:
stage: deploy
script:
- echo "Deploying ... not really"
only:
- production
environment:
name: production
```
----------
### Pages
```
pages:
stage: deploy
script:
- echo 'Publishing pages'
artifacts:
paths:
- public
only:
- master
```
## GitLab CI/CD
- Test result visibility and validation
- Application Lifecycle
- Continuous Delivery: multiple stages, manual deploys, environments, and
variables
- Open source
Note:
- How does the CI/CD functionality that GitLab offers help the team?
- May be useful to get some ideas about what they are building
----------
- CI is fully integrated with GitLab
- Scalable: Tests run distributed on separate machines of which you can add as
many as you need
- Jobs run in parallel on multiple machines
![CI Architecture](https://about.gitlab.com/images/ci/arch-1.jpg)
Note:
- Mention examples such as building binaries, app packing and delivery, deployment, etc
Loading
Loading
@@ -6,22 +6,23 @@
- Vast variety of tools and IDEs
- 250 Open Source projects
 
---
----------
 
### Setup
- Download Eclipse http://www.eclipse.org/
- Look for the environment tha best matches your project
- Look for the environment the best matches your project
- Download EGit if it's not included already http://www.eclipse.org/egit/
 
----------
 
### Configure
- Global author
Window Preferences Team Git Configuration
- Global author
```
Window -> Preferences -> Team -> Git -> Configuration
```
- Git on the toolbar
Window ▸ Perspective ▸ Customize perspective
```
Window -> Perspective -> Customize perspective
```
- Action Set Availability tab select Git stuff
- Toll bar visibility and again Git stuff
- Tool bar visibility and again Git stuff
Loading
Loading
@@ -11,25 +11,29 @@
 
### Clone a project
- Open project
File ▸ Import ▸ Git ▸ Project from Git
```
File -> Import -> Git -> Project from Git
```
- Chose clone URI
- Look for the URI of your project and paste it on the window
- If you don't have a credential set stored add one now
- Import using a new project wizard
- Choose to create a project from existing source and select the cloned git
- Choose to create a project from existing source and select the cloned git
project
 
----------
### New Project with Git Enabled
- Create a project
- Right click on the project
Team ▸ Share Project
- Create. Leave the path and add theproject's name
- Right click on the project
```
Team -> Share Project
```
- Create. Leave the path and add the project's name
- Add changes to index and make your first commit to kick off the master branch
 
----------
### Adding a Remote
- Press on the cloud and up arrow icon
- Press on the cloud and up arrow icon
- If no remote is setup you'll get a config window
- Stick with the origin name
- Add URL, protocol and credentials
Loading
Loading
@@ -38,6 +42,7 @@ project
 
### Troubleshooting
- Some certificates are not accepted such as self signed certs
git config --global http.sslVerify "false"
- Please consider the security implication of using this approach
```
git config --global http.sslVerify "false"
```
- Please consider the security implication of using this approach
Loading
Loading
@@ -79,6 +79,9 @@
<section data-markdown>
- Introduction
- Setup
- Repositories
- Stages
- Branches
- Questions
</section>
 
Loading
Loading
@@ -92,7 +95,7 @@
data-charset="iso-8859-15">
</section>
 
<!-- Why use CI -->
<!-- Repos -->
<section data-markdown="content/repos.md"
data-separator="^\n\n\n"
data-separator-vertical="^----------"
Loading
Loading
@@ -100,24 +103,16 @@
data-charset="iso-8859-15">
</section>
 
<!-- Sample Application -->
<section data-markdown="content/sample_app.md"
<!-- Stages -->
<section data-markdown="content/git-stages.md"
data-separator="^\n\n\n"
data-separator-vertical="^----------"
data-separator-notes="^Note:"
data-charset="iso-8859-15">
</section>
 
<!-- GitLab ci yml file -->
<section data-markdown="content/gitlab-ci-yml.md"
data-separator="^\n\n\n"
data-separator-vertical="^----------"
data-separator-notes="^Note:"
data-charset="iso-8859-15">
</section>
<!-- Runners-->
<section data-markdown="content/runners.md"
<!-- Git Branches -->
<section data-markdown="content/branches.md"
data-separator="^\n\n\n"
data-separator-vertical="^----------"
data-separator-notes="^Note:"
Loading
Loading
0 info it worked if it ends with ok
1 verbose cli [ '/Users/uno/.nvm/versions/node/v4.2.3/bin/node',
1 verbose cli '/Users/uno/.nvm/versions/node/v4.2.3/bin/npm',
1 verbose cli 'start' ]
2 info using npm@2.14.7
3 info using node@v4.2.3
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info prestart reveal.js@3.2.0
6 info start reveal.js@3.2.0
7 verbose unsafe-perm in lifecycle true
8 info reveal.js@3.2.0 Failed to exec start script
9 verbose stack Error: reveal.js@3.2.0 start: `grunt serve`
9 verbose stack Exit status 1
9 verbose stack at EventEmitter.<anonymous> (/Users/uno/.nvm/versions/node/v4.2.3/lib/node_modules/npm/lib/utils/lifecycle.js:214:16)
9 verbose stack at emitTwo (events.js:87:13)
9 verbose stack at EventEmitter.emit (events.js:172:7)
9 verbose stack at ChildProcess.<anonymous> (/Users/uno/.nvm/versions/node/v4.2.3/lib/node_modules/npm/lib/utils/spawn.js:24:14)
9 verbose stack at emitTwo (events.js:87:13)
9 verbose stack at ChildProcess.emit (events.js:172:7)
9 verbose stack at maybeClose (internal/child_process.js:818:16)
9 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
10 verbose pkgid reveal.js@3.2.0
11 verbose cwd /Users/uno/GitLab/ci-training-slides
12 error Darwin 16.1.0
13 error argv "/Users/uno/.nvm/versions/node/v4.2.3/bin/node" "/Users/uno/.nvm/versions/node/v4.2.3/bin/npm" "start"
14 error node v4.2.3
15 error npm v2.14.7
16 error code ELIFECYCLE
17 error reveal.js@3.2.0 start: `grunt serve`
17 error Exit status 1
18 error Failed at the reveal.js@3.2.0 start script 'grunt serve'.
18 error This is most likely a problem with the reveal.js package,
18 error not with npm itself.
18 error Tell the author that this fails on your system:
18 error grunt serve
18 error You can get their info via:
18 error npm owner ls reveal.js
18 error There is likely additional logging output above.
19 verbose exit [ 1, true ]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment