Skip to content

Commit

Permalink
Update code from main project (TonyMckes#9)
Browse files Browse the repository at this point in the history
* Add testid to signup error message

* Test docker compose (#1)

* Change docker compose to pull app image

* Remove unnecessary code on workflow

* Minor changes

* Remove users seeder

* Add script to push app image to Docker Hub

* Minor changes

* Minor changes
  • Loading branch information
hugoguillin authored Mar 25, 2024
1 parent ef8bd17 commit f5a126c
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 2 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
node_modules/
frontend/node_modules/
backend/.env
push-image-dh.sh
2 changes: 1 addition & 1 deletion backend/seeders/20220427123216-create-users.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use strict";

const { faker } = require('@faker-js/faker');
const { faker } = require("@faker-js/faker");

module.exports = {
async up(queryInterface, Sequelize) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function AuthPageContainer({ children, error, path, text, title }) {

{error && (
<ul className="error-messages">
<li>{error}</li>
<li data-testid="signup-error">{error}</li>
</ul>
)}

Expand Down
23 changes: 23 additions & 0 deletions push-image-dh.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

# Get env variables to login in Docker Hub
DOCKER_HUB_USERNAME=$DOCKER_HUB_USERNAME
DOCKER_HUB_PASSWORD=$DOCKER_HUB_PASSWORD

# Check if the environment variables are set
if [ -z "$DOCKER_HUB_USERNAME" ] || [ -z "$DOCKER_HUB_PASSWORD" ]; then
echo "Error: Environment variables DOCKER_HUB_USERNAME and DOCKER_HUB_PASSWORD are not set."
exit 1
fi

# Compila la imagen
docker build -t realworldapp-for-test-automation:latest .

# Etiqueta la imagen con el nombre de usuario de Docker Hub
docker tag realworldapp-for-test-automation:latest $DOCKER_HUB_USERNAME/realworldapp-for-test-automation:latest

# Inicia sesión en Docker Hub
docker login --username $DOCKER_HUB_USERNAME --password $DOCKER_HUB_PASSWORD

# Sube la imagen a Docker Hub
docker push $DOCKER_HUB_USERNAME/realworldapp-for-test-automation:latest

0 comments on commit f5a126c

Please sign in to comment.