Skip to content

Instantly share code, notes, and snippets.

@ipedrazas
Created June 12, 2020 17:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ipedrazas/417bcf2a40a1e2218f5d22a1cc2c9fa6 to your computer and use it in GitHub Desktop.
Save ipedrazas/417bcf2a40a1e2218f5d22a1cc2c9fa6 to your computer and use it in GitHub Desktop.
Gitops training - vue.js
html, body {
margin: 0px;
}
h1{
background-color: #3a5e84;
color: white;
padding: 10;
margin-bottom: 20px;
}
<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>
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})
}
}
})
package:
nginx:
installed: true
versions:
- 1.17.10-r1
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