diff --git a/.circleci/ansible/configure-server.yml b/.circleci/ansible/configure-server.yml index 75abca4..e73459e 100644 --- a/.circleci/ansible/configure-server.yml +++ b/.circleci/ansible/configure-server.yml @@ -23,14 +23,14 @@ # Get the environment variables from CircleCI and add to the EC2 instance environment: - - TYPEORM_CONNECTION: "{{ lookup('env', 'TYPEORM_CONNECTION')}}" - - TYPEORM_ENTITIES: "{{ lookup('env', 'TYPEORM_ENTITIES')}}" - - TYPEORM_HOST: "{{ lookup('env', 'TYPEORM_HOST')}}" + - TYPEORM_CONNECTION: "{{ lookup('env.sample', 'TYPEORM_CONNECTION')}}" + - TYPEORM_ENTITIES: "{{ lookup('env.sample', 'TYPEORM_ENTITIES')}}" + - TYPEORM_HOST: "{{ lookup('env.sample', 'TYPEORM_HOST')}}" - TYPEORM_PORT: 5432 - - TYPEORM_USERNAME: "{{ lookup('env', 'TYPEORM_USERNAME')}}" - - TYPEORM_PASSWORD: "{{ lookup('env', 'TYPEORM_PASSWORD')}}" - - TYPEORM_DATABASE: "{{ lookup('env', 'TYPEORM_DATABASE')}}" - - TYPEORM_MIGRATIONS: "{{ lookup('env', 'TYPEORM_MIGRATIONS')}}" - - TYPEORM_MIGRATIONS_DIR: "{{ lookup('env', 'TYPEORM_MIGRATIONS_DIR')}}" + - TYPEORM_USERNAME: "{{ lookup('env.sample', 'TYPEORM_USERNAME')}}" + - TYPEORM_PASSWORD: "{{ lookup('env.sample', 'TYPEORM_PASSWORD')}}" + - TYPEORM_DATABASE: "{{ lookup('env.sample', 'TYPEORM_DATABASE')}}" + - TYPEORM_MIGRATIONS: "{{ lookup('env.sample', 'TYPEORM_MIGRATIONS')}}" + - TYPEORM_MIGRATIONS_DIR: "{{ lookup('env.sample', 'TYPEORM_MIGRATIONS_DIR')}}" roles: - configure-server \ No newline at end of file diff --git a/.circleci/ansible/roles/deploy/tasks/main.yml b/.circleci/ansible/roles/deploy/tasks/main.yml index 1be15ce..cec4c8a 100644 --- a/.circleci/ansible/roles/deploy/tasks/main.yml +++ b/.circleci/ansible/roles/deploy/tasks/main.yml @@ -11,11 +11,11 @@ cd /home/ubuntu tar xvzf artifact.tar.gz -C . -- name: Add environment variable - become: true - shell: | - echo -e "NODE_ENV=local\nVERSION=1\nTYPEORM_CONNECTION=${TYPEORM_CONNECTION}\nTYPEORM_MIGRATIONS_DIR=${TYPEORM_MIGRATIONS_DIR}\nTYPEORM_ENTITIES=${TYPEORM_ENTITIES}\nTYPEORM_MIGRATIONS=${TYPEORM_MIGRATIONS}\nTYPEORM_HOST=${TYPEORM_HOST}\nTYPEORM_PORT=${TYPEORM_PORT}\nTYPEORM_USERNAME=${TYPEORM_USERNAME}\nTYPEORM_PASSWORD=${TYPEORM_PASSWORD}\nTYPEORM_DATABASE=${TYPEORM_DATABASE}" - >> /home/ubuntu/.env +# - name: Add environment variable +# become: true +# shell: | +# echo -e "NODE_ENV=local\nVERSION=1\nTYPEORM_CONNECTION=${TYPEORM_CONNECTION}\nTYPEORM_MIGRATIONS_DIR=${TYPEORM_MIGRATIONS_DIR}\nTYPEORM_ENTITIES=${TYPEORM_ENTITIES}\nTYPEORM_MIGRATIONS=${TYPEORM_MIGRATIONS}\nTYPEORM_HOST=${TYPEORM_HOST}\nTYPEORM_PORT=${TYPEORM_PORT}\nTYPEORM_USERNAME=${TYPEORM_USERNAME}\nTYPEORM_PASSWORD=${TYPEORM_PASSWORD}\nTYPEORM_DATABASE=${TYPEORM_DATABASE}" +# >> /home/ubuntu/.env - name: "start server" become: true