Anda di halaman 1dari 30

SCSCM Team Stash Training

FY2015 Q3

Edward Quail, Mark Lang, Amos Baker


Software Engineers

January 2015

Intro What is Stash?

2013-2014 Cisco and/or its affiliates. All rights reserved.

Cisco Confidential

What is Stash?

Stash is an SCM tool built around Git.


Built with Cgit to communicate with Git on the system level.
Web frontend for Git and comes packaged as a Tomcat service.

Similar qualities to Gitlab, Github, and Gerrit.

Can be used as a code review tool for developers.

Made and supported by Atlassian.

Part of an integration suite with other Atlassian products such as


Bamboo, Jira, and confluence.

2013-2014 Cisco and/or its affiliates. All rights reserved.

Cisco Confidential

Whats the big deal?

Stash offers a new workflow for developers and code review


process.

Easily integrated
With 3rd party CI systems such as Jenkins.
Out of the box integrations to JIRA, Confluence, and Bamboo

Plugin/Hook model for implementing repo based policies.

Integration with custom web services.

Easy to use webUI and access control.

Easily integrated with ADAM LDAP model.

Easily migrate from Raw Git infrastructure to Stash.

Cisco wants it!

2013-2014 Cisco and/or its affiliates. All rights reserved.

Cisco Confidential

Its possible to not be perfect!

Scalability limited to a single drive.

Maintains high scalability in other areas such as Stash Data Center,


a multi host, load-balanced solution.

No path for migrating metadata with repositories between


Stash instances.

Leans toward a central application model rather than


distributed infra.

Some lacking UI benefits.


Code searching.
Filtering list pages.
Slightly confusing new Pull Request model.

2013-2014 Cisco and/or its affiliates. All rights reserved.

Cisco Confidential

Exercise 1
Logging into a Stash Server

2013-2014 Cisco and/or its affiliates. All rights reserved.

Cisco Confidential

Logging into a Stash server

In your favorite web browser, open the following link in a


separate tab or window:
https://rtp-scm-atl1.cisco.com:8443/stash/login

NOTE You may have to accept the certificate validation.

You should see a login window, where you will then enter your
CEC username and password credentials.

2013-2014 Cisco and/or its affiliates. All rights reserved.

Cisco Confidential

Exercise 2
Adding SSH Keys

2013-2014 Cisco and/or its affiliates. All rights reserved.

Cisco Confidential

Adding SSH Keys

Log into the stash server:


https://rtp-scm-atl1.cisco.com:8443/stash/login

Click the avatar on the top right and select manage account.

On the next page click on SSH keys.

Click on the Add key button.

Paste your SSH public key in the box and click Add key.

2013-2014 Cisco and/or its affiliates. All rights reserved.

Cisco Confidential

Exercise 3
Setting up AD integration

2013-2014 Cisco and/or its affiliates. All rights reserved.

Cisco Confidential

10

Exercise 3a - Creating ADAM AD User Group

The name of the group you will be using will be $USERstashtraining


Example: amobaker-stashtraining

Navigate you web browser to http://adam.cisco.com

In the left menu bar expand Group and select Create.

Fill in the required fields:


Group Name
Group Owner (defaults to self)
User Members and Group Members can be added in their respective
fields.

2013-2014 Cisco and/or its affiliates. All rights reserved.

Cisco Confidential

11

Exercise 3b - Adding user and user group to


Stash instance AD group

Navigate your web browser to http://adam.cisco.com

In the left menu bar expand Group and select Search.

In the text box search for scmstashtraining and click


Search.

Click Modify Members

In the Group Members textbox fill in your user group name.

User group name should be $USER-stashtraining.

2013-2014 Cisco and/or its affiliates. All rights reserved.

Cisco Confidential

12

Exercise 3c - Synchronizing Stash LDAP User


group

Login to the stash instance as a user with administrative


privileges.

Click the gear icon in the top right menu.

Select User Directories under the Accounts section.

In the Operations column for the LDAP server click


Synchronize.

A progress indicator will display until the synchronization is


complete.

2013-2014 Cisco and/or its affiliates. All rights reserved.

Cisco Confidential

13

Exercise 3d - Setting LDAP permissions in


Stash

Login to the stash instance as a user with administrative


privileges.

Click the gear icon in the top right menu.

Select Global permissions

Type the name of the group in the Group access section.

Select the level of access from the drop-down.

Should be Stash User.

When finished, click Add, and modify settings as needed.

All groups should be Stash User except for SCSCM Admin groups.

2013-2014 Cisco and/or its affiliates. All rights reserved.

Cisco Confidential

14

Exercise 4
Creating Stash Projects and
Repositories

2013-2014 Cisco and/or its affiliates. All rights reserved.

Cisco Confidential

15

Exercise 4a - Creating a Stash Project

Once logged into Stash server click on Projects on the top


navbar.

Click Create Project.

Fill in fields with an asterisk.

Lets name it $USER-Project

Click Create Project.

2013-2014 Cisco and/or its affiliates. All rights reserved.

Cisco Confidential

16

Exercise 4b Modifying permission Stash


projects

Navigate to your respective project.

Click Settings or the gear icon on the left bar under project
avatar.

Click Permissions.

Add groups in Group Access for respective access level.

2013-2014 Cisco and/or its affiliates. All rights reserved.

Cisco Confidential

17

Exercise 4c Creating Stash Repositories

Navigate to your respective project.

From the left pane select Create repository.

Fill in the Name section for the repository you are creating.

Click Create.

2013-2014 Cisco and/or its affiliates. All rights reserved.

Cisco Confidential

18

Exercise 4d Setting access to Stash


repositories

Navigate to your respective project and repository.

From the left pane select Settings.

Click Permissions.

Set permissions for users, groups, or branches.

2013-2014 Cisco and/or its affiliates. All rights reserved.

Cisco Confidential

19

Exercise 5
Checking out code

2013-2014 Cisco and/or its affiliates. All rights reserved.

Cisco Confidential

20

Git Clone

Navigate to your respective project and repository.

From the left pane hover over the three small dots and click
Clone.

From the left drop-down select HTTP or SSH

2013-2014 Cisco and/or its affiliates. All rights reserved.

Cisco Confidential

21

Exercise 6
User Abilities Creating
Branches, pull requests,
forking.

2013-2014 Cisco and/or its affiliates. All rights reserved.

Cisco Confidential

22

Exercise 7
Migrating a Git repo to
Stash

2013-2014 Cisco and/or its affiliates. All rights reserved.

Cisco Confidential

23

My code is already tracked by Git but want to


move to Stash

Clone your source repo using the bare option and push to
Stash.

git clone -bare ssh://wwwin-git-rtp/git/scmci/repo.git


cd repo
git remote add stash ssh://git@rtp-scm-atl1/repo.git
git push --all stash
git push --tags stash

Push Specific Branch

git push -u stash my_very_special_branch_name

2013-2014 Cisco and/or its affiliates. All rights reserved.

Cisco Confidential

24

Exercise 8
Stash Administration

2013-2014 Cisco and/or its affiliates. All rights reserved.

Cisco Confidential

25

File System Layout

STASH_HOME=/data/atlassian/stash-home

STASH_INSTALL=data/atlassian/stash/current

2013-2014 Cisco and/or its affiliates. All rights reserved.

Cisco Confidential

26

Configuration Files

Environment settings for Stash

/data/atlassian/stash/current/bin/setenv.sh

Tomcat Settings
/data/atlassian/stash/current/conf/server.xml
/data/atlassian/stash/current/conf/web.xml

Apache Configuration(WIP)

/local/httpd/conf/$HOSTNAME.conf

Core Stash configuration file

/data/atlassian/stash-home/shared/stash-config.properties

2013-2014 Cisco and/or its affiliates. All rights reserved.

Cisco Confidential

27

Important log location

/data/atlassian/stash-home/logs

/data/atlassian/stash/current/logs

2013-2014 Cisco and/or its affiliates. All rights reserved.

Cisco Confidential

28

References and Links

Stash server tracking page: http://wikicentral.cisco.com/x/tdZUG

Setup AD integration http://wikicentral.cisco.com/x/Wbt6Gg

Creating Stash projects http://wikicentral.cisco.com/x/sjoGGg

Creating Stash repositories http://wikicentral.cisco.com/x/ljsGGg

Stash Rest API docs https://developer.atlassian.com/static/rest/stash/3.6.1/stash-rest.html

Stash Pull Request https://confluence.atlassian.com/display/STASH/Using+pull+requests+in+Stash

Stash Config Properties https://confluence.atlassian.com/display/STASH/Stash+config+properties

Atlassian Application Links https://confluence.atlassian.com/display/APPLINKS/Application+Links+User+Guide

Atlassian SDK for Add-On Development https://


developer.atlassian.com/docs/getting-started/set-up-the-atlassian-plugin-sdk-and-build-a-project

2013-2014 Cisco and/or its affiliates. All rights reserved.

Cisco Confidential

29

Thanks

Anda mungkin juga menyukai