Skip to content
This repository has been archived by the owner on Nov 4, 2022. It is now read-only.

Commit

Permalink
Fixed some issues I found during dry-run (#61)
Browse files Browse the repository at this point in the history
* Link not working from setup instructions

* Remove GitHub download approval

In my testing it doesn't happen on AL2 Cloud9 on SAM CLI version 1.16.0

* git global config already preconfigured on Cloud9 AL2

* Use codecommit:// path for git remote

* Make resize.sh work on xfs volumes as well

* Commit the pipeline definition after creating it

Otherwise it is only pushed as part of the next lab section

* SAM deploy guided arguments have changed; updated screenshot

* Updated screenshot; was still showing node v10

* Some minor issues found by Thomas in his dry-run today

Co-authored-by: Gerhard Poul <[email protected]>
  • Loading branch information
gpoul and gpoul authored Feb 18, 2021
1 parent a320c98 commit fde8fc2
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 27 deletions.
11 changes: 2 additions & 9 deletions workshop/content/java/buildpipe/credhelper/_index.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,7 @@ weight = 10

One of the cool things about CodeCommit is the support for IAM authentication. And if you are running this workshop from a Cloud9 workspace, you can leverage the fact that your terminal is already pre-authenticated with valid AWS credentials.

Run the following commands from your terminal:

```
git config --global credential.helper '!aws codecommit credential-helper $@'
git config --global credential.UseHttpPath true
```

Now configure the git client with username and email, so your commits have an author defined.
Configure the git client with username and email, so your commits have an author defined.

```
git config --global user.name "Replace with your name"
Expand All @@ -22,4 +15,4 @@ git config --global user.email "[email protected]"

Example:

![CredsHelper](/images/java/chapter4/credhelper/cred-helper.png)
![CredsHelper](/images/java/chapter4/credhelper/cred-helper.png)
10 changes: 3 additions & 7 deletions workshop/content/java/buildpipe/gitpush/_index.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,10 @@ Example:
![GitCommit](/images/java/chapter4/gitpush/initial-commit.png)

### Push the code
Add your CodeCommit repository URL as a _remote_ on your local git project. This is the `cloneUrlHttp` value that you got back after creating the repository in Step 1 of this chapter.

{{% notice tip %}}
If you can't find the CodeCommit repository URL, you can find it by running this command: `aws codecommit get-repository --repository-name sam-app`.
{{% /notice %}}
Add your CodeCommit repository URL as a _remote_ on your local git project.

```
git remote add origin REPLACE_WITH_HTTP_CLONE_URL
git remote add origin codecommit://sam-app
```

{{% notice tip %}}
Expand All @@ -69,4 +65,4 @@ Example:
### Verify in CodeCommit
Navigate to the [AWS CodeCommit console](https://console.aws.amazon.com/codesuite/codecommit/home), find your _sam-app_ repository and click on it to view its contents. Make sure your code is there. You should see a screen like the following:

![VerifyCodeCommit](/images/java/chapter4/gitpush/code-commit.png)
![VerifyCodeCommit](/images/java/chapter4/gitpush/code-commit.png)
12 changes: 11 additions & 1 deletion workshop/content/javascript/buildpipe/done/_index.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,14 @@ Let your pipline run every stage. After it finishes it will look all green like

![VerifyPipelineRunning](/images/chapter4/screenshot-pipeline-verify-3.png)

#### Congratulations! You have created a CI/CD pipeline for a Serverless application!
### Push the changes

In the terminal, run the following commands from the root directory of your `sam-app` project.

```
git add .
git commit -m "CI/CD Pipeline definition"
git push
```

#### Congratulations! You have created a CI/CD pipeline for a Serverless application!
4 changes: 2 additions & 2 deletions workshop/content/javascript/manualdeploy/deploy/_index.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ The guided deployment does few things for you. Let's take a quick look at what h
**1)** Your codebase gets packaged in a zip file.
**2)** SAM creates an S3 bucket in your account, if it doesn't already exist.
**3)** Zip file is uploaded to the S3 bucket.
**4)** SAM creates the [packaged template](/manualdeploy/bucket.html) that references the location of the zip file on S3.
**4)** SAM creates the [packaged template](/javascript/manualdeploy/bucket.html#the-packaged-template) that references the location of the zip file on S3.
**5)** This template is also uploaded to the S3 bucket.
**6)** SAM starts the deployment via CloudFormation ChangeSets.

The first time you do a guided deployment, a new file `samconfig.toml` is created in the root of your project with your specified deployment parameters, this is so that the next time you execute `sam deploy`, it uses the same parameters without having you to enter them again.

![SamDeploy](/images/screenshot-sam-config-toml.png)

If you want to learn more about guided deployments and the samconfig.toml file, here is a good Blog Post: https://aws.amazon.com/blogs/compute/a-simpler-deployment-experience-with-aws-sam-cli.
If you want to learn more about guided deployments and the samconfig.toml file, here is a good Blog Post: https://aws.amazon.com/blogs/compute/a-simpler-deployment-experience-with-aws-sam-cli.
5 changes: 1 addition & 4 deletions workshop/content/javascript/sam/init/_index.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ It will prompt for project configuration parameters:
#### Leave default `sam-app` for project name
![samInit](/images/screenshot-sam-init-2.png)

#### Type `Y` to accept download from GitHub
![samInit](/images/screenshot-sam-init-3.png)

#### Type `1` to select the `Hello World Example`
![samInit](/images/screenshot-sam-init-5.png)

Expand All @@ -40,4 +37,4 @@ This command supports cookiecutter templates, so you could write your own custom
You should see a new folder `sam-app` created with a basic Hello World scaffolding.
![samInit](/images/screenshot-sam-init-7.png)

If you are interested in learning more about initializing SAM projects, you can find the full reference for the `sam init` command in the [SAM CLI reference](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-cli-command-reference-sam-init.html).
If you are interested in learning more about initializing SAM projects, you can find the full reference for the `sam init` command in the [SAM CLI reference](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-cli-command-reference-sam-init.html).
2 changes: 1 addition & 1 deletion workshop/content/javascript/setup/_index.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ If you prefer to run the workshop from your local computer without using Cloud9,
* [Git Client](https://git-scm.com/downloads) - To interact with the CodeCommit repository by pushing code changes.
* [NodeJS and npm](https://www.npmjs.com/get-npm) - The sample app you will create is NodeJs-based.

Once you have installed all requirements, you can start the workshop here: [Start workshop](/sam.html).
Once you have installed all requirements, you can start the workshop here: [Start workshop](/javascript/sam.html).
16 changes: 13 additions & 3 deletions workshop/static/assets/resize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,22 @@ then
sudo growpart /dev/xvda 1

# Expand the size of the file system.
sudo resize2fs /dev/xvda1
if [ $(mount |grep xvda1 | cut -d " " -f 5) = "xfs" ]
then
sudo xfs_growfs /dev/xvda1
else
sudo resize2fs /dev/xvda1
fi

else
# Rewrite the partition table so that the partition takes up all the space that it can.
sudo growpart /dev/nvme0n1 1

# Expand the size of the file system.
sudo resize2fs /dev/nvme0n1p1
fi
if [ $(mount |grep nvme0n1 | cut -d " " -f 5) = "xfs" ]
then
sudo xfs_growfs /dev/nvme0n1p1
else
sudo resize2fs /dev/nvme0n1p1
fi
fi
Binary file modified workshop/static/images/screenshot-canary-sam.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified workshop/static/images/screenshot-sam-deploy-guided.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed workshop/static/images/screenshot-sam-init-3.png
Binary file not shown.

0 comments on commit fde8fc2

Please sign in to comment.