Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prueba #37

Draft
wants to merge 34 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
731ff56
Create buildspec.yml
el-barto007 Nov 1, 2022
e4bac15
Update buildspec.yml
el-barto007 Nov 1, 2022
63e7f1d
Update buildspec.yml
el-barto007 Nov 1, 2022
e366d44
Update buildspec.yml
el-barto007 Nov 1, 2022
0a8e7b5
Update buildspec.yml
el-barto007 Nov 2, 2022
23c0d89
Update buildspec.yml
el-barto007 Nov 2, 2022
bc6d911
Update buildspec.yml
el-barto007 Nov 2, 2022
73d5c8e
Update buildspec.yml
el-barto007 Nov 2, 2022
2de82c6
Update buildspec.yml
el-barto007 Nov 2, 2022
59e46e4
Update buildspec.yml
el-barto007 Nov 2, 2022
5e65cf3
Update buildspec.yml
el-barto007 Nov 2, 2022
a461956
Update buildspec.yml
el-barto007 Nov 2, 2022
507e7c5
Update buildspec.yml
el-barto007 Nov 2, 2022
767f9f8
Update index.html
el-barto007 Nov 2, 2022
ca6b6bd
Update index.html
el-barto007 Nov 2, 2022
34f181b
Update index.html
el-barto007 Nov 2, 2022
a4d3978
Update index.html
el-barto007 Nov 3, 2022
d118b3f
Update index.html
el-barto007 Nov 3, 2022
e9c285e
Update index.html
el-barto007 Nov 3, 2022
5323668
Update index.html
el-barto007 Nov 3, 2022
84dd809
Update index.html
el-barto007 Nov 3, 2022
547a38f
Update index.html
el-barto007 Nov 4, 2022
62b6b65
Update index.html
el-barto007 Nov 4, 2022
6c4fceb
Update index.html
el-barto007 Nov 17, 2022
ddb9dd2
Update buildspec.yml
el-barto007 Nov 22, 2022
5ba01f6
variables
el-barto007 Nov 22, 2022
03ac14a
Update buildspec.yml
el-barto007 Nov 22, 2022
9d60ffb
Update index.html
el-barto007 Nov 24, 2022
44775de
Create appspec.yaml
el-barto007 Nov 28, 2022
703665a
Create taskdef.json
el-barto007 Nov 28, 2022
2dbfdec
Update taskdef.json
el-barto007 Nov 28, 2022
3c91671
Update appspec.yaml
el-barto007 Nov 28, 2022
a96ff79
Update taskdef.json
el-barto007 Nov 29, 2022
8470d63
Update appspec.yaml
el-barto007 Nov 29, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions appspec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: 0.0
Resources:
- TargetService:
Type: AWS::ECS::Service
Properties:
TaskDefinition: <TASK_DEFINITION>
LoadBalancerInfo:
ContainerName: "29-conteiner"
ContainerPort: 9080
50 changes: 50 additions & 0 deletions buildspec.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
version: 0.2

env:
variables:
AWS_ACCOUNT_ID: "452911533244"
CLUSTER: "poc"
SERVICE: "poc-service"
IMAGE_REPO_NAME: "myapp"
IMAGE_TAG: "v1.0.0"
AWS_DEFAULT_REGION: "us-west-2"

phases:
install:
commands:
- echo Entered the install phase...
- wget https://download.java.net/java/GA/jdk13.0.1/cec27d702aa74d5a8630c65ae61e4305/9/GPL/openjdk-13.0.1_linux-x64_bin.tar.gz
- tar -xvf openjdk-13.0.1_linux-x64_bin.tar.gz
- mv jdk-13.0.1 /opt/
- JAVA_HOME='/opt/jdk-13.0.1'
- PATH="$JAVA_HOME/bin:$PATH"
- export PATH
- echo java termina install
- wget https://mirrors.estointernet.in/apache/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz
- tar -xvf apache-maven-3.6.3-bin.tar.gz
- mv apache-maven-3.6.3 /opt/
- M2_HOME='/opt/apache-maven-3.6.3'
- PATH="$M2_HOME/bin:$PATH"
- export PATH
finally:
- echo This always runs even if the update or install command fails
pre_build:
commands:
- echo Ingresando a AWS ECR...
- aws ecr get-login-password --region $AWS_DEFAULT_REGION | docker login --username AWS --password-stdin $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com

build:
commands:
- echo Maven empezar clean and install
- mvn clean
- mvn install
- echo Creando imagen Docker
- docker build -t myapp:v1.0.0 .
- docker tag $IMAGE_REPO_NAME:$IMAGE_TAG $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/$IMAGE_REPO_NAME:$IMAGE_TAG
- echo Copiando imagen de Docker a repositorio...
- docker push $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/$IMAGE_REPO_NAME:$IMAGE_TAG

post_build:
commands:
- echo actualizando servicio fargate...
- aws ecs update-service --cluster $CLUSTER --service $SERVICE --force-new-deployment
2 changes: 1 addition & 1 deletion src/main/webapp/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
$( document ).ready(function() {
$.i18n().load( {
en: {
"welcome": "Welcome.",
"welcome": "Welcome PoC.",
"name": "name",
"what_is_your_name": "What is your name?",
"hello": "Hello $1",
Expand Down
28 changes: 28 additions & 0 deletions taskdef.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"executionRoleArn": "arn:aws:iam::452911533244:role/ecsTaskExecutionRole",
"containerDefinitions": [
{
"portMappings": [
{
"hostPort": 9080,
"protocol": "tcp",
"containerPort": 9080
}
],
"image": "452911533244.dkr.ecr.us-west-2.amazonaws.com/myapp:v1.0.0",
"essential": true,
"name": "29-conteiner"
}
],
"memory": "512",
"compatibilities": [
"EC2",
"FARGATE"
],
"family": "first-run-task-definition",
"requiresCompatibilities": [
"FARGATE"
],
"networkMode": "awsvpc",
"cpu": "256"
}