# How to deploy a custom build on production?

**URL:** <https://forum.ghost.org/t/how-to-deploy-a-custom-build-on-production/2446>\
**Category:** Installation\
**Created:** [August 16, 2018, 8:11am UTC](https://forum.ghost.org/t/how-to-deploy-a-custom-build-on-production/2446 "2018-08-16T08:11:03Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![gpsarkar](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/gpsarkar/32/1133_2.png) [@gpsarkar](https://forum.ghost.org/u/gpsarkar)\
**Post date:** [August 16, 2018, 8:11am UTC](https://forum.ghost.org/t/how-to-deploy-a-custom-build-on-production/2446/1 "2018-08-16T08:11:03Z")

</div>

I made some changes in core (both server and client) to support ldap authentication and then created prod build by running `grunt prod`. I also already have a prod instance running which was deployed earlier using ghost-cli by runing `ghost install`.

How do i deploy my custom build over the current running prod build? Can i simply put them in a new folder under `versions` and update the `current` folder’s symlink? Will that work?

---

<div class="post-metadata">

**Author:** ![beefon](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/beefon/32/879_2.png) [@beefon](https://forum.ghost.org/u/beefon)\
**Post date:** [August 16, 2018, 2:08pm UTC](https://forum.ghost.org/t/how-to-deploy-a-custom-build-on-production/2446/2 "2018-08-16T14:08:58Z")

</div>

Offtopic, but if you could share your LDAP auth implementation it would be wonderful!

---

<div class="post-metadata">

**Author:** ![vikaspotluri123](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/vikaspotluri123/32/24_2.png) [@vikaspotluri123](https://forum.ghost.org/u/vikaspotluri123)\
**Post date:** [August 16, 2018, 2:49pm UTC](https://forum.ghost.org/t/how-to-deploy-a-custom-build-on-production/2446/3 "2018-08-16T14:49:51Z")

</div>

You can zip your build and run `ghost update --zip /path/to/zip`

---

<div class="post-metadata">

**Author:** ![gpsarkar](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/gpsarkar/32/1133_2.png) [@gpsarkar](https://forum.ghost.org/u/gpsarkar)\
**Post date:** [August 16, 2018, 6:53pm UTC](https://forum.ghost.org/t/how-to-deploy-a-custom-build-on-production/2446/4 "2018-08-16T18:53:31Z")

</div>

yes, they are here.

> **[GitHub - gpsarkar/Ghost at 2.0.0pr1](https://github.com/gpsarkar/Ghost/tree/2.0.0pr1)**
>
> 2.0.0pr1

> **[GitHub - gpsarkar/Ghost-Admin at 2.0.0pr1](https://github.com/gpsarkar/Ghost-Admin/tree/2.0.0pr1)**
>
> 2.0.0pr1

It is not clean though. Lots of patching and duct tape job to make it work (not a js dev here). Active directory details goes in config `(config.development.js`).

```
"ad": { 
   "url": "ldap://dc.domain.com",
   "baseDN": "dc=domain,dc=com",
   "username: "username@domain.com",
   "password": "password"
 }

```

The auth happens in `oauth.js`. Basically, i take email id and query AD for the email field, if found then validate its sAMAccountName with given password. This part is easy, but new user registration on blog is not straightforward.

New users on blog, on first time login using their AD credential, if AD validates, then they would receive invitation on their mail. They need to complete registration using this invitation in order to use the blog. This step basically creates that user in blog db.

You can diff with master branch and check what files are changed. Do note that this is meant to be run in local environment (LAN) only as few security restrictions are relaxed, like the new user invitation goes out without a need for authentication. Getting the default role id for new user invitation without authentication. etc. Default role for all new users in `contributor`, so that they cannot publish post as soon as they get access.

---

<div class="post-metadata">

**Author:** ![gpsarkar](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/gpsarkar/32/1133_2.png) [@gpsarkar](https://forum.ghost.org/u/gpsarkar)\
**Post date:** [August 16, 2018, 6:54pm UTC](https://forum.ghost.org/t/how-to-deploy-a-custom-build-on-production/2446/5 "2018-08-16T18:54:14Z")

</div>

`ghost update --zip /path/to/zip` - didn’t work for me. Getting version mismatch error.

---

<div class="post-metadata">

**Author:** ![vikaspotluri123](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/vikaspotluri123/32/24_2.png) [@vikaspotluri123](https://forum.ghost.org/u/vikaspotluri123)\
**Post date:** [August 16, 2018, 6:59pm UTC](https://forum.ghost.org/t/how-to-deploy-a-custom-build-on-production/2446/6 "2018-08-16T18:59:38Z")

</div>

Could you paste the error? Looking at your branch, I think it might be because it’s not semver compliant

---

<div class="post-metadata">

**Author:** ![gpsarkar](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/gpsarkar/32/1133_2.png) [@gpsarkar](https://forum.ghost.org/u/gpsarkar)\
**Post date:** [August 16, 2018, 7:45pm UTC](https://forum.ghost.org/t/how-to-deploy-a-custom-build-on-production/2446/7 "2018-08-16T19:45:31Z")

</div>

You are right. The version no was not proper in my case.  
But even after fixing that `ghost update` doesn’t update with my zip file. It checks for the latest version and then says, `All up to date !`. I will try to deploy manually now.

---

<div class="post-metadata">

**Author:** ![vikaspotluri123](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/vikaspotluri123/32/24_2.png) [@vikaspotluri123](https://forum.ghost.org/u/vikaspotluri123)\
**Post date:** [August 16, 2018, 8:18pm UTC](https://forum.ghost.org/t/how-to-deploy-a-custom-build-on-production/2446/8 "2018-08-16T20:18:52Z")

</div>

That suggests your current version is greater than the zip version (i.e. you’re on Ghost 2.0.0 and the release is Ghost 2.0.0-rc.1). You need to make sure it’s a newer version. Use `ghost update --rollback` to rollback to an older version if needed, or just update the version of the new zip.

---

<div class="post-metadata">

**Author:** ![gpsarkar](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/gpsarkar/32/1133_2.png) [@gpsarkar](https://forum.ghost.org/u/gpsarkar)\
**Post date:** [August 18, 2018, 2:46pm UTC](https://forum.ghost.org/t/how-to-deploy-a-custom-build-on-production/2446/9 "2018-08-18T14:46:36Z")

</div>

Thanks. Rollback to 1.25.5 and then update with zip worked.

**Note:** zip created by `grunt release`

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex015/uploads/ghost2/original/2X/b/ba9ce5100b8bb264586f4f572545596b2ce3f081.png) [@system](https://forum.ghost.org/u/system)\
**Post date:** [September 1, 2018, 2:46pm UTC](https://forum.ghost.org/t/how-to-deploy-a-custom-build-on-production/2446/10 "2018-09-01T14:46:36Z")

</div>

Closed on September 1, 2018, 2:46pm UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
