# Project plan — CodeDeployScripts

Evidence date: 2026-10-18.

Source repository: `git@bitbucket.org:overdrive/codedeployscripts.git`.

This plan describes what that repository contains. It does not decide what the toolkit should become.

The scan-host path named on the onboarding issue (`~/projects/sonar_scan/repos/CodeDeployScripts`) is not present on the machine that produced this document. Evidence is a clone of `origin/master` and `origin/development`. Untracked files that existed only on the scan host were not available to read.

## Product

**CodeDeployScripts** is an internal example of two deployment paths from Bitbucket Pipelines:

- `master` zips the repository and deploys that zip to Amazon EC2 through AWS CodeDeploy and S3.
- `development` sends the repository to an FTP host with `git-ftp`.

The only page in the tree is a static HTML banner used to see which branch landed. There is no login, no database, and no domain beyond "did this deploy".

The written guide is `README.md`. It is a console checklist (IAM, S3, EC2, CodeDeploy, Bitbucket variables, then FTP), not a product specification.

| Identity found in the tree | Where |
|---|---|
| Title "CodeDeployScripts / Code Deploy with AWS and FTP Deploy" | `README.md` line 1 |
| Origin `git@bitbucket.org:overdrive/codedeployscripts.git` | clone remote |
| CodeDeploy application name example `CodedeployDev` | `README.md` |
| Deployment group example `DG1` | `README.md` |
| S3 bucket example `codedeploy` | `README.md` |
| EC2 tag example `name` = `CodedeployEC2Dev` | `README.md` |
| Region example `eu-west-1` | `README.md` variables and the CodeDeploy agent URL |
| Page title "Silicon Deployment Testing" | `index.html` |
| Banner on `master`: "Silicon Overdrive" / "Master HELOOOOOOO Branch / Dev Server" | `index.html` at `06626b3` |
| Deploy script identified as Amazon's Bitbucket Builds template v1.0.0 | header of `codedeploy_deploy.py` |

Provenance of those rows: **Documented** or **Implemented** in the named files. Whether the named AWS resources and the FTP host still exist is **Unknown / Requires Confirmation**.

## Branch reality

`git branch -a` on 2026-10-18 showed two remote heads. `origin/HEAD` points at `origin/master`.

| Branch | Tip | Date | Subject |
|---|---|---|---|
| `master` | `06626b32e2a09034b7df2b94b9abae5809bc12e6` | 2019-06-06 14:34:43 +0200 | Test master branch |
| `development` | `dc915f471e87e29b745568c2a5aba62fb0e4dfd7` | 2019-07-26 14:46:41 +0200 | Update Readme file |

They share history through `093d5ab` (2019-05-31, "Readme Update"), then diverge. The three files that differ at the tips are `README.md`, `bitbucket-pipelines.yml`, and `index.html`. `codedeploy_deploy.py`, `appspec.yml`, the three hook scripts, and `silcodedeploy_evolvav.pem` are the same blob on both tips.

Authors on both branches: Jaco Brits and siliconoverdrive, both `jaco@overdrive.co.za`.

There is no commit after 2019-07-26. No milestone list, roadmap, or issue tracker is in the repository.

The onboarding issue (captured 2026-09-28) listed `sonar-project.properties` and `sonarqube_scan.bat` at the repository root, and it recorded the `master` tip as `06626b3`, which matches this clone. Neither Sonar file is in `06626b3` or `dc915f4`. Provenance: **Unknown**. They may have been untracked files on the scan host.

## Scope in the repository

In scope of what is committed:

- A setup checklist for an AWS CodeDeploy practice target and for FTP (`README.md`).
- A Bitbucket Pipelines file with one step for `master` and one step for `development` (`bitbucket-pipelines.yml`).
- A Python uploader that puts `/tmp/artifact.zip` in S3 and starts a CodeDeploy deployment (`codedeploy_deploy.py`).
- An AppSpec that copies the bundle to `/var/www/html` and runs three root hooks (`appspec.yml`, `scripts/`).
- A static HTML smoke page (`index.html`).
- An RSA private key file (`silcodedeploy_evolvav.pem`) that no script references.

Out of scope of the committed tree, or not present as runnable pieces:

- The EC2 instance, the CodeDeploy application, the S3 bucket, and the FTP server. The README names examples. This repo does not create them.
- A PHP application. The README's EC2 install line includes PHP 5.4 packages. No `.php` file is committed.
- Tests, a database, an HTTP API owned by this repository, background workers, and a user account system.
- `sonar-project.properties` and `sonarqube_scan.bat`. Named on the onboarding issue, absent from both tips.
- Any change after 2019-07-26.

## Architecture

```text
Bitbucket Pipelines (image python:3.5.7)
  branch master
    apt: zip
    pip: boto3==1.3.0
    zip -r /tmp/artifact.zip *
    python codedeploy_deploy.py
         S3 put  {APPLICATION_NAME}/{timestamp}-bitbucket_builds.zip
         CodeDeploy create_deployment (in-place, config from env)
              EC2 (tag example name=CodedeployEC2Dev)
                   appspec -> /var/www/html
                   hooks: stop httpd, yum install httpd, start httpd

  branch development
    apt: zip git git-ftp
    master tip of this file:  git ftp init
    development tip:          git ftp push
         ftp://$FTP_HOST

Browser
  index.html served by httpd from /var/www/html   (CodeDeploy path)
  or by whatever the FTP host serves              (FTP path; docroot not stated)
```

The pipeline file on a branch is the file on that branch. A push to `master` does not run the `development` step, and the reverse is also true. Provenance: **Implemented** (`pipelines.branches` keys).

## Milestones

The repository has no written milestone list. The commit dates are the only schedule on record.

| When | What landed |
|---|---|
| 2019-05-29 | Two initial commits, then the same-day tuning of the pipeline, the deploy script, the AppSpec, and the hook scripts. A boto3 `retries` block (`max_attempts = 10`) was added in `a502df7` and removed in `f5dbcf4` |
| 2019-05-30 | HTML smoke page edits. `silcodedeploy_evolvav.pem` added in `88a609e` ("New updates pem") |
| 2019-05-31 | README update. Banner set to "Master Branch / Production Deployment" |
| 2019-06-02 | Branches diverge. `master` gains the FTP section in the README and a `development` pipeline step that runs `git ftp init`. `development` gains its own banner and the same FTP step |
| 2019-06-06 | `master` banner becomes "Master HELOOOOOOO Branch / Dev Server" (`06626b3`). `development` banner becomes "Development YEAHHHHH Branch / QA Enviroment : Push" (`bebe1d0`) |
| 2019-06-02 to 2019-06-06 on `development` | `git ftp push` is the live command; `git ftp init` is commented (`cae93aa`) |
| 2019-07-26 | `development` only: README restyled. The checklist facts are unchanged (`773f0b1`, `dc915f4`) |

## Implementation plan

No implementation plan is written in the repository. There is no TODO, FIXME, or unfinished feature flag.

What the tree already is:

1. Checklist in `README.md` for a human to create IAM, S3, EC2, CodeDeploy, and Bitbucket variables.
2. `master` pipeline packages and deploys.
3. `development` pipeline runs `git-ftp`.
4. EC2 hooks install and start `httpd` and publish the HTML banner.

Nothing in the repo describes a next phase.

## Dependencies

| Dependency | How it appears | Provenance |
|---|---|---|
| Bitbucket Pipelines | `bitbucket-pipelines.yml` | Implemented |
| Docker image `python:3.5.7` | pipeline `image` | Implemented |
| `boto3==1.3.0` | `pip install` on the `master` step | Implemented |
| AWS SDK credentials and `AWS_DEFAULT_REGION` | README variable list; boto3 default client | Documented variables. The script does not pass `region_name` |
| S3, CodeDeploy, EC2, IAM | README and `codedeploy_deploy.py` | Documented and implemented |
| CodeDeploy agent install script for `eu-west-1` | README `wget` URL | Documented manual step. Not run by the pipeline |
| `httpd` via `yum` | hook scripts | Implemented |
| `git-ftp` | `development` pipeline step | Implemented |
| Amazon sample script | `codedeploy_deploy.py` header and the README link to `awslabs/aws-codedeploy-bitbucket-pipelines-python` | Documented |

Whether `python:3.5.7` still pulls, and whether `boto3==1.3.0` still installs, is **Unknown / Requires Confirmation** as of 2026-10-18. This clone did not run the pipeline.

## Current project status

Frozen example. Last change on the default branch is 2019-06-06. Last change on `development` is 2019-07-26. No Silicon Ark directory for this project existed before this onboarding.

## Known gaps (not a plan)

- The `master` zip command is `zip -r /tmp/artifact.zip *`. The private key file sits at the repo root, so a pipeline run packages it and the AppSpec publishes the bundle under `/var/www/html`. Provenance: **Inferred** from those two files. No script names the pem.
- `scripts/stop_server` assigns `isExistApp` with spaces around `=`. That is not a shell assignment. Provenance: **Implemented** text. The runtime effect is **Inferred** (see business rules).
- `scripts/stop_server` then runs `chmod 777` on `/var/www/html`. `scripts/start_server` runs `chmod 755`. Neither mode is explained in the README.
- The README opens TCP port 3000. No file listens on 3000.
- The README installs PHP 5.4 packages by hand. The committed page is HTML only.

## Human confirmation

1. Do CodeDeploy application `CodedeployDev`, group `DG1`, bucket `codedeploy`, and EC2 tag `name=CodedeployEC2Dev` still exist, and is the region still `eu-west-1`?
2. Does either pipeline still run, and which branch do operators push?
3. Do image `python:3.5.7` and `boto3==1.3.0` still install?
4. What is `silcodedeploy_evolvav.pem` for? No file references it. If it was a live key, treat the committed file as exposed and rotate it outside this documentation task.
5. Is publishing the whole zip, including that pem, under `/var/www/html` accepted?
6. Are the `stop_server` assignment and the `chmod 777` accepted, or are they defects?
7. Why does the checklist open TCP 3000?
8. Is the PHP 5.4 install line still required?
9. Were `sonar-project.properties` and `sonarqube_scan.bat` local-only files on the scan host?
10. Has `git ftp init` already been run against `FTP_HOST`? `master`'s pipeline file still runs init for the `development` key. `development`'s file runs push.
