From 8d90215cf9885bd06c189458f9b8b88d95b644b7 Mon Sep 17 00:00:00 2001
From: Diego Giovane Pasqualin <dpasqualin@c3sl.ufpr.br>
Date: Tue, 12 Jan 2016 14:14:13 -0200
Subject: [PATCH] =?UTF-8?q?Servi=C3=A7os?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .gitlab-ci.yml |  43 +++++++++++++++++++++++++------------------
 Makefile       |  19 -------------------
 hello.c        |   6 ------
 hello.o        | Bin 1504 -> 0 bytes
 run-test.sh    |  36 ------------------------------------
 5 files changed, 25 insertions(+), 79 deletions(-)
 delete mode 100644 Makefile
 delete mode 100644 hello.c
 delete mode 100644 hello.o
 delete mode 100755 run-test.sh

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 57faefa..fd79072 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,24 +1,31 @@
-# Usando cache
+# Serviços
 
-before_script:
-    - apt-get update && apt-get install -y build-essential
+# Serviços são imagens Docker que será 'linkadas' aos containers que
+# executarão as builds. Pode ser qualquer imagem do dockerhub.com.
+# Também é possível definir os serviços individualmente para cada job,
+# especificando o serviço dentro dele.
+services:
+    # Se quiser outra versão do postgres use postgres:9.3, por exemplo.
+    # Também estão disponíveis serviços para mysql, mongodb, redis e outros.
+    - postgres:latest
+
+# Essas são variáveis de ambiente que serão passadas para a build. Como
+# normalmente você irá utilizar um banco de dados de testes, não deve ser
+# problema passar senhas por aqui. Mas se preferir também é possível definir
+# variáveis secretas no Gitlab, em <project>/Settings/Variables
+variables:
+  POSTGRES_DB: simmc
+  POSTGRES_USER: simmc
+  POSTGRES_PASSWORD: "123mudar"
 
 job1:
     script:
-        - make
-    artifacts:
-        paths:
-            - build/
-    cache:
-        # Todos os arquivos não monitorados pelo git serão 'cacheados',
-        # significando que serão copiados e (potencialmente) reutilizados em
-        # builds futuras.
-        untracked: true
-        # Também é possível utilizar o campo 'paths', como em 'artifacts'.
-        # Muito útil para fazer cache do vendor/ em aplicações rails,
-        # node_modules/ em aplicações node, ou até cache do apt.
-        paths:
-            - /var/cache/apt/archives/
+        # Exibe as variáveis de ambiente configuradas
+        - env
+        # Mostra que o serviço está configurado no /etc/hosts como uma
+        # máquina de mesmo nome (postgres, no caso)
+        - cat /etc/hosts
+        # Mostra que o serviço está acessível
+        - ping -W1 -c1 postgres
     tags:
         - debian
-
diff --git a/Makefile b/Makefile
deleted file mode 100644
index 36b5417..0000000
--- a/Makefile
+++ /dev/null
@@ -1,19 +0,0 @@
-CC=gcc
-CFLAGS=-I.
-OBJ = hello.o
-BIN = hello
-DEST = build
-
-all: hello
-	mkdir -p $(DEST)
-	mv $(BIN) $(DEST)
-
-%.o: %.c
-	$(CC) -c -o $@ $< $(CFLAGS)
-
-$(BIN): $(OBJ)
-	$(CC) -o $@ $^ $(CFLAGS)
-
-clean:
-	rm -f $(OBJ)
-	rm -rf $(DEST)
diff --git a/hello.c b/hello.c
deleted file mode 100644
index 5e3ef85..0000000
--- a/hello.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <stdio.h>
-
-int main(int argc, char** argv) {
-    printf("hello world\n");
-    return (0);
-}
diff --git a/hello.o b/hello.o
deleted file mode 100644
index 71e4bd747d5c33101988f2086a43bc31545c6975..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001

literal 1504
zcmb<-^>JfjWMqH=Mg}_u1P><4z+izS=l~XWVBlroVhHu<eCpBsMxe9yk4I<ehy5U_
z7a(E>h&XvTBQ+-{U!gp|C?|!1!QI)}N<kwusWh*oRKY~gLeE6ks1(dItTQyxGceJF
zh%zuRh=8;+FfcGy1u-yI2rx?XuyagcWMGhCfMAfc0*G+r6KG>{=4FfKVdntx^@=NV
zOA?b9^omQ0Aan+dRg{{Os8^C&QNo~?l30?+pqEr!%%E4458))|=jNv7l`!b#<(H)D
zx%-9c7MCO@XEW%5wWVgnrxhjUrh=@X1_rqu6r^luhC#xXfdM3sECo`F%$H_hU|>NO
zfU;+>LKp@Rih&yxh71f0;ILs}V32@{t3kz?p?nyX0Arxh==SSC%_LX9A=G{*G<#t7
z^Pq{N+iwZg5A!EXc@C7J1*KsWOh1fvg6fCK!{})+1{w|12NMp5>PL6~45$JNC=H`v
z;Sb{n;fTKz(D;MJ6Da;bdO;YZ7bY&qz`%eW_8|ESAcBE`ArVT$D0KIO_~>p2sjYw}
zDh`kW1_lODJa9te8YB<1A0&p&{syS~g+YpuFw{6C5$sHmIu?eH|FOw3V=b9L;egF0
zAaST?&<tZ{fI1RGoE=RB!exf%9ta;sGBcp(UIqqGxCkM+6PAzp7#J7?U>cEWZ~>{8
s%#fRyna5C2T2c&=gsJ6XU_f!LC`6h86n7xGKmQ>BW)DalgrUk90B|;4sQ>@~

diff --git a/run-test.sh b/run-test.sh
deleted file mode 100755
index 3ca8c00..0000000
--- a/run-test.sh
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/bin/bash
-
-# Script que testa o hello. Esse é só um exemplo, existem inúmeras ferramentas de testes
-# por aí, procure não reinventar a roda.
-
-BIN="build/hello"
-
-# Testa se arquivo existe e é executável
-if ! test -x $BIN; then
-    echo "Binário inexistente"
-    exit 1
-fi
-
-# Testa código de retorno
-res=$(./$BIN)
-ret=$?
-echo -n "Testando código de retorno... "
-if test $ret -ne 0; then
-    echo "ERRO: Programa retornou erro $ret: $res"
-    exit 1
-fi
-echo "OK"
-
-# Testa valor de retorno
-expected="hello world"
-echo -n "Testando valor de retorno... "
-if test "$res" != "$expected"; then
-    echo "ERRO: Programa deveria retornar $expected, mas retornou \"$res\"."
-    exit 1
-fi
-echo "OK"
-
-# Se chegou até aqui, sucesso!
-echo "Todos os testes passaram!"
-
-exit 0
-- 
GitLab