Giter Site home page Giter Site logo

subpointsolutions / uplift-packer Goto Github PK

View Code? Open in Web Editor NEW
13.0 5.0 1.0 285 KB

Packer templates and build workflows for SharePoint professionals - Windows 2016, SQL 2016, SharePoint 2016 and Visual Studio 2017.

PowerShell 80.73% Ruby 18.88% Batchfile 0.39%
powershell powershell-module sharepoint sharepoint-2016 automation vagrant packer infrastructure infrastructure-as-code uplift-project

uplift-packer's Introduction

uplift-packer

This repository contains Packer templates and build workflows designed for SharePoint professionals.

The uplift project offers consistent Packer/Vagrant workflows and Vagrant boxes specifically designed for SharePoint professionals. It heavy lifts low-level details of the creation of domain controllers, SQL servers, SharePoint farms and Visual Studio installs by providing a codified workflow using Packer/Vagrant tooling.

Build status

Branch Status
master Build status
beta Build status
dev Build status

How this works

The uplift project is split into several repositories to address particular a piece of functionality:

The current repository houses Packer templates and automation which is used to produces Vagrant boxes across the uplift project.

Packer builds

Local development automation uses Invoke-Build based tasks.

To get started, get the latest dev branch or fork the repo on the GitHub:

# get the source code
git clone https://github.com/SubPointSolutions/uplift-packer.git
cd uplift-packer

# checkout the dev branch
git checkout dev

# make sure we are on dev branch
git status

# optionally, pull the latest
git pull

Local development experience consists of Invoke-Build tasks. Two main files are .build.ps1 and .build-helpers.ps1. Use the following tasks to get started and refer to Invoke-Build documentation for additional help.

Run invoke-build ? in the corresponding folder to see available tasks.

# show available tasks
invoke-build ?

Creating packer templates

All packer templates are pre-generated via powershell based automation. This way enables code reuse, helps to produce packer template adding as many provision steps as needed.

# rebuild all packer templates
cd packer
invoke-build 

# rebuild individual packer template
cd packer/win-2016-datacenter-app
pwsh -f '.build.ps1'
powershell -File '.build.ps1'

Preparing local file repository

Some of the templates rely on external binaries. Transferring of the binaries into packer VMs is done via the local HTTP server. Build automation detects if a local HTTP server is required, automatically stands up a new server on random port padding server URL into packer builds. It automatically detects local file repository produced by invoke-uplift PowerShell module and uses it to server binaries for all packer builds. Refer to uplift-powershell project for more details.

Preparing local file repository with invoke-uplift module:

Installing Invoke-Uplift

# subpointsolutions-staging on myget.org
# https://www.myget.org/feed/subpointsolutions-staging/package/nuget/InvokeUplift

# register 'subpointsolutions-staging' repository
Register-PSRepository -Name "subpointsolutions-staging" -SourceLocation "https://www.myget.org/F/subpointsolutions-staging/api/v2"

# install module under PowerShell 6
pwsh -c 'Install-Module -Name "InvokeUplift" -Repository "subpointsolutions-staging"'

Downloading binaries

# list Microsoft binaries and updates
pwsh -c invoke-uplift resource list ms-
pwsh -c invoke-uplift resource list ms-sharepoint2016-update

# download SharePoint binaries, patches and lang packs
# wildcard match is used here
pwsh -c invoke-uplift resource download ms-sharepoint2016-rtm
pwsh -c invoke-uplift resource download ms-sharepoint2016-lang-pack
pwsh -c invoke-uplift resource download ms-sharepoint2016-update-2019

# download sql16
pwsh -c invoke-uplift resource download ms-sql-server2016-rtm

# download Visual Studio 2017
pwsh -c invoke-uplift resource download ms-visualstudio-2017.ent-installer
pwsh -c invoke-uplift resource download ms-visualstudio-2017.ent-dist-office-dev

# download Windows 2016 patches
pwsh -c invoke-uplift resource download ms-win2016-ssu-
pwsh -c invoke-uplift resource download ms-win2016-lcu-2019.01

Building packer templates

Building packer templates are handled via invoke-build automation at the root folder of the project. While all packer templates can be built manually within a corresponding template folder, it is highly discouraged.

Build automation runs builds in a temporary build-packer-ci-local folder. Every build gets an isolated folder with a branch tag. All artefacts produced by the build are stored within this folder - final packer template, packer variables file, built box and others.

To build packer VMs which require external binaries, uplift-local-repository folder should exist on any of the drives. Build automation scans all drives trying to find uplift-local-repository folder, it serves HTTP server using node js http-server package.

# check which tasks are out there
invoke-build ?

# build minimal ubuntu-trusty64 box to validate all installs
invoke-build 
invoke-build -packerImageName ubuntu-trusty64

# forcing packer rebuild even if box exists
invoke-build -packerImageName ubuntu-trusty64 -Task PackerRebuild

# build windows base boxes
invoke-build -packerImageName win-2016-datacenter-soe         
invoke-build -packerImageName win-2016-datacenter-soe-latest  

# build application base boxes
# -UPLF_INPUT_BOX_NAME points to the Vagrant box to be used as a starting point
# all these boxes requires a local file repository built by invoke-uplift

invoke-build -packerImageName win-2016-datacenter-app `
  -UPLF_INPUT_BOX_NAME uplift-local/win-2016-datacenter-soe-latest-master

invoke-build -packerImageName win-2016-datacenter-app-sql16 `
  -UPLF_INPUT_BOX_NAME uplift-local/win-2016-datacenter-soe-latest-master

# build SharePoint base boxes
invoke-build -packerImageName  win-2016-datacenter-sp2016rtm-sql16-vs17 `
  -UPLF_INPUT_BOX_NAME uplift-local/win-2016-datacenter-app-sql16-master

invoke-build -packerImageName  win-2016-datacenter-sp2016fp1-sql16-vs17 `
  -UPLF_INPUT_BOX_NAME  uplift-local/win-2016-datacenter-app-sql16-master

invoke-build -packerImageName  win-2016-datacenter-sp2016fp2-sql16-vs17 `
  -UPLF_INPUT_BOX_NAME  uplift-local/win-2016-datacenter-app-sql16-master

invoke-build -packerImageName  win-2016-datacenter-sp2016latest-sql16-vs17 `
  -UPLF_INPUT_BOX_NAME  uplift-local/win-2016-datacenter-app-sql16-master

Feature requests, support and contributions

All contributions are welcome. If you have an idea, create a new GitHub issue. Feel free to edit existing content and make a PR for this as well.

uplift-packer's People

Contributors

subpointsupport avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

manbhar

uplift-packer's Issues

Generated packer templates doesn't work with packer 1.3.5

Hi,

I found this repo and it looks really promising. Thank you for making this open source! But as I tried to use it I found that you depend on some tools like packer (I want't familiar with them before) and it was not clear for me which tools you depend on from README file.

What I would suggest, adding Prerequisite section in your README file, which lists the tools and version which you use to build this vagrant boxes.

And maybe adding a License file :)

What do you thinks?

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.