stash training

30
SCSCM Team Stash Training Edward Quail, Mark Lang, Amos Baker Software Engineers January 2015 FY2015 Q3

Upload: rasurend

Post on 03-Oct-2015

238 views

Category:

Documents


2 download

DESCRIPTION

Stash SCM Tool

TRANSCRIPT

Quick Start Steps

SCSCM Team Stash TrainingEdward Quail, Mark Lang, Amos BakerSoftware EngineersJanuary 2015FY2015 Q3Cisco Confidential# 2013-2014 Cisco and/or its affiliates. All rights reserved.Intro What is Stash?Cisco Confidential# 2013-2014 Cisco and/or its affiliates. All rights reserved.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.

What is Stash?Cisco Confidential# 2013-2014 Cisco and/or its affiliates. All rights reserved.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 BambooPlugin/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!

Whats the big deal?Cisco Confidential# 2013-2014 Cisco and/or its affiliates. All rights reserved.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.

Its possible to not be perfect!Cisco Confidential# 2013-2014 Cisco and/or its affiliates. All rights reserved.Exercise 1Logging into a Stash ServerCisco Confidential# 2013-2014 Cisco and/or its affiliates. All rights reserved.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.

Logging into a Stash serverCisco Confidential# 2013-2014 Cisco and/or its affiliates. All rights reserved.Exercise 2Adding SSH KeysCisco Confidential# 2013-2014 Cisco and/or its affiliates. All rights reserved.Log into the stash server: https://rtp-scm-atl1.cisco.com:8443/stash/loginClick 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.

Adding SSH KeysCisco Confidential# 2013-2014 Cisco and/or its affiliates. All rights reserved.Exercise 3Setting up AD integrationCisco Confidential# 2013-2014 Cisco and/or its affiliates. All rights reserved.The name of the group you will be using will be $USER-stashtraining Example: amobaker-stashtrainingNavigate you web browser to http://adam.cisco.comIn the left menu bar expand Group and select Create.Fill in the required fields:Group NameGroup Owner (defaults to self)User Members and Group Members can be added in their respective fields.

Exercise 3a - Creating ADAM AD User GroupCisco Confidential# 2013-2014 Cisco and/or its affiliates. All rights reserved.Navigate your web browser to http://adam.cisco.comIn the left menu bar expand Group and select Search.In the text box search for scmstashtraining and click Search.Click Modify MembersIn the Group Members textbox fill in your user group name.User group name should be $USER-stashtraining.

Exercise 3b - Adding user and user group to Stash instance AD groupCisco Confidential# 2013-2014 Cisco and/or its affiliates. All rights reserved.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.

Exercise 3c - Synchronizing Stash LDAP User groupCisco Confidential# 2013-2014 Cisco and/or its affiliates. All rights reserved.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.

Exercise 3d - Setting LDAP permissions in StashCisco Confidential# 2013-2014 Cisco and/or its affiliates. All rights reserved.Exercise 4Creating Stash Projects and RepositoriesCisco Confidential# 2013-2014 Cisco and/or its affiliates. All rights reserved.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-ProjectClick Create Project.

Exercise 4a - Creating a Stash ProjectCisco Confidential# 2013-2014 Cisco and/or its affiliates. All rights reserved.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.

Exercise 4b Modifying permission Stash projectsCisco Confidential# 2013-2014 Cisco and/or its affiliates. All rights reserved.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.

Exercise 4c Creating Stash RepositoriesCisco Confidential# 2013-2014 Cisco and/or its affiliates. All rights reserved.Navigate to your respective project and repository. From the left pane select Settings.Click Permissions.Set permissions for users, groups, or branches.

Exercise 4d Setting access to Stash repositoriesCisco Confidential# 2013-2014 Cisco and/or its affiliates. All rights reserved.Exercise 5Checking out codeCisco Confidential# 2013-2014 Cisco and/or its affiliates. All rights reserved.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

Git CloneCisco Confidential# 2013-2014 Cisco and/or its affiliates. All rights reserved.Exercise 6User Abilities Creating Branches, pull requests, forking.Cisco Confidential# 2013-2014 Cisco and/or its affiliates. All rights reserved.Exercise 7Migrating a Git repo to StashCisco Confidential# 2013-2014 Cisco and/or its affiliates. All rights reserved.Clone your source repo using the bare option and push to Stash.git clone -bare ssh://wwwin-git-rtp/git/scmci/repo.gitcd repogit remote add stash ssh://git@rtp-scm-atl1/repo.gitgit push --all stashgit push --tags stashPush Specific Branchgit push -u stash my_very_special_branch_name

My code is already tracked by Git but want to move to StashCisco Confidential# 2013-2014 Cisco and/or its affiliates. All rights reserved.Exercise 8Stash AdministrationCisco Confidential# 2013-2014 Cisco and/or its affiliates. All rights reserved.STASH_HOME=/data/atlassian/stash-homeSTASH_INSTALL=data/atlassian/stash/current

File System LayoutCisco Confidential# 2013-2014 Cisco and/or its affiliates. All rights reserved.Environment settings for Stash/data/atlassian/stash/current/bin/setenv.shTomcat Settings/data/atlassian/stash/current/conf/server.xml/data/atlassian/stash/current/conf/web.xmlApache Configuration(WIP)/local/httpd/conf/$HOSTNAME.confCore Stash configuration file/data/atlassian/stash-home/shared/stash-config.properties

Configuration FilesCisco Confidential# 2013-2014 Cisco and/or its affiliates. All rights reserved./data/atlassian/stash-home/logs/data/atlassian/stash/current/logsImportant log locationCisco Confidential# 2013-2014 Cisco and/or its affiliates. All rights reserved.Stash server tracking page: http://wikicentral.cisco.com/x/tdZUGSetup AD integration http://wikicentral.cisco.com/x/Wbt6GgCreating Stash projects http://wikicentral.cisco.com/x/sjoGGgCreating Stash repositories http://wikicentral.cisco.com/x/ljsGGgStash Rest API docs https://developer.atlassian.com/static/rest/stash/3.6.1/stash-rest.htmlStash Pull Request https://confluence.atlassian.com/display/STASH/Using+pull+requests+in+StashStash Config Properties https://confluence.atlassian.com/display/STASH/Stash+config+propertiesAtlassian Application Links https://confluence.atlassian.com/display/APPLINKS/Application+Links+User+GuideAtlassian SDK for Add-On Development https://developer.atlassian.com/docs/getting-started/set-up-the-atlassian-plugin-sdk-and-build-a-project

References and LinksCisco Confidential# 2013-2014 Cisco and/or its affiliates. All rights reserved.ThanksCisco Confidential# 2013-2014 Cisco and/or its affiliates. All rights reserved.