This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
image: node:9.11.1 | |
stages: | |
- build | |
- test | |
- deploy | |
before_script: | |
- apt-get update --quiet --yes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
APPHOME=/home/ubuntu/App | |
cd $APPHOME | |
BASE=$APPHOME | |
PID=$BASE/app.pid | |
LOG=$BASE/app.log | |
CMD="$BASE/start.sh" # Point to your program run command |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "Copying files to /var/www/html" | |
sudo cp -R * /var/www/html | |
sudo nginx -s reload | |
echo "NGINX restarted" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
HOME=/home/ubuntu | |
APP=$HOME/App | |
CMD=$APP/app.sh | |
PIDF=$APP/app.pid | |
LOG=$HOME/deploy.log | |
APPLOG=$APP/app.log | |
/bin/echo "$(date '+%Y-%m-%d %X'): ** Validate Service Hook Started **" >> $LOG |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
HOME=/home/ubuntu | |
APP=$HOME/App | |
LOG=$HOME/deploy.log | |
/bin/echo "$(date '+%Y-%m-%d %X'): ** Before Install Hook Started **" >> $LOG | |
# Before the installation code | |
/bin/echo "$(date '+%Y-%m-%d %X'): ** Before Install Hook Completed **" >> $LOG |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
HOME=/home/ubuntu | |
APP=$HOME/App | |
PIDF=$APP/app.pid | |
CMD=$APP/app.sh | |
LOG=$HOME/deploy.log | |
/bin/echo "$(date '+%Y-%m-%d %X'): Initializing Deployment for $APPLICATION_NAME - $DEPLOYMENT_ID " >> $LOG |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
HOME=/home/ubuntu | |
LOG=$HOME/deploy.log | |
# verify that the application directory has the correct owner/group | |
/usr/bin/sudo /bin/chown -R ubuntu:ubuntu /home/ubuntu/App | |
echo -e "Done" >> $LOG | |
/bin/echo "$(date '+%Y-%m-%d %X'): ** After Install Hook Completed **" >> $LOG |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
HOME=/home/ubuntu | |
APP=$HOME/App | |
CMD=$APP/app.sh | |
LOG=$HOME/deploy.log | |
pwd >> $LOG | |
cd $APP |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: 0.0 | |
os: linux | |
files: | |
- source: ./ # This line assumes that your deployment code is located in | |
destination: /home/ubuntu/App | |
permissions: | |
# sets application runner script as executable - This example assumes the sample 'my_app.sh' script has been added to the the directory 'my_app' and serves as the application launcher | |
- object: /home/ubuntu/App/ | |
pattern: "app.sh" | |
owner: ubuntu |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ wget https://INSERT-BUCKET-NAME.s3.amazonaws.com/latest/install | |
$ chmod +x ./install | |
$ sudo ./install auto | |
$ sudo service codedeploy-agent status | |
If the CodeDeploy agent is installed and running, you should see a message like The AWS CodeDeploy agent is running. | |
If you see a message like error: No AWS CodeDeploy agent running, start the service and run the following two commands, one at a time: | |
$ sudo service codedeploy-agent start |