Created
June 12, 2020 17:59
-
-
Save ipedrazas/417bcf2a40a1e2218f5d22a1cc2c9fa6 to your computer and use it in GitHub Desktop.
Gitops training - vue.js
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
html, body { | |
margin: 0px; | |
} | |
h1{ | |
background-color: #3a5e84; | |
color: white; | |
padding: 10; | |
margin-bottom: 20px; | |
} |
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
<html> | |
<head> | |
<link rel="stylesheet" href="https://unpkg.com/spectre.css/dist/spectre.min.css"> | |
<link rel="stylesheet" href="https://unpkg.com/spectre.css/dist/spectre-exp.min.css"> | |
<link rel="stylesheet" href="https://unpkg.com/spectre.css/dist/spectre-icons.min.css"> | |
<link rel="stylesheet" href="index.css"> | |
<script src="https://kit.fontawesome.com/35b0b4d9fd.js" crossorigin="anonymous"></script> | |
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script> | |
<script src="https://unpkg.com/axios/dist/axios.min.js"></script> | |
</head> | |
<body> | |
<h1>Twitter friends</h1> | |
<div class="container" id="app-7"> | |
<div class="columns" v-for="(item, index) in twitterHandlers"> | |
<div class="column col-lg-auto col-3"></div> | |
<div class="column"> | |
<i class="fab fa-twitter-square"></i> <a href="https://twitter.com/{{ item }}">{{ item }}</a> | |
</div> | |
</div> | |
</div> | |
<script src="route/urls.js"></script> | |
<script src="index.js"></script> | |
</body> | |
</html> |
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
Vue.component('todo-item', { | |
props: ['todo'], | |
template: '<li>{{ todo.text }}</li>' | |
}) | |
var app7 = new Vue({ | |
el: '#app-7', | |
data: { | |
twitterHandlers: [] | |
}, | |
mounted() { | |
this.fetchAPIData(); | |
}, | |
methods: { | |
fetchAPIData( ) { | |
axios.get(APIURL) | |
.then(response => {this.twitterHandlers = response.data.results}) | |
} | |
} | |
}) |
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
package: | |
nginx: | |
installed: true | |
versions: | |
- 1.17.10-r1 |
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
FROM nginx:alpine as app | |
COPY . /usr/share/nginx/html | |
RUN \ | |
addgroup --system --gid 30000 user && \ | |
adduser --system --shell /sbin/nologin -u 30000 -G user user | |
RUN chown -R user.user /usr/share/nginx/html | |
# Unit test | |
FROM app as test | |
ENV GOSS_VERSION="v0.3.6" | |
USER root | |
RUN \ | |
set -x; \ | |
\ | |
apk add curl && \ | |
curl --fail -L "https://github.com/aelsabbahy/goss/releases/download/${GOSS_VERSION}/goss-linux-amd64" \ | |
-o /usr/local/bin/goss \ | |
&& chmod +rx /usr/local/bin/goss | |
USER user | |
COPY nginx-goss.yaml goss.yaml | |
RUN goss -g - validate < goss.yaml | |
# Metadata | |
FROM app as final | |
ARG vcs_ref=unespecied | |
LABEL org.label-schema.name="Control Plane nginx image" \ | |
org.label-schema.description="Control Plane Base ngnix image" \ | |
org.label-schema.build-date="${build_date}" \ | |
org.label-schema.vcs-url="https://github.com/controlplaneio/docker-base-images" \ | |
org.label-schema.vcs-ref="${vcs_ref}" \ | |
io.control-plane.ci-agent="circleci" \ | |
io.control-plane.test="goss-passed" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment