Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
LongRoute
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Frank Sauerburger
LongRoute
Commits
07d4473b
Verified
Commit
07d4473b
authored
1 year ago
by
Frank Sauerburger
Browse files
Options
Downloads
Patches
Plain Diff
Add new pipeline
parent
6e00fd62
No related branches found
No related tags found
No related merge requests found
Pipeline
#14280
passed
1 year ago
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.gitlab-ci.yml
+30
-76
30 additions, 76 deletions
.gitlab-ci.yml
Dockerfile
+12
-0
12 additions, 0 deletions
Dockerfile
ci/sftp.Dockerfile
+0
-6
0 additions, 6 deletions
ci/sftp.Dockerfile
kubernetes.yaml
+97
-0
97 additions, 0 deletions
kubernetes.yaml
with
139 additions
and
82 deletions
.gitlab-ci.yml
+
30
−
76
View file @
07d4473b
variables
:
LOCAL_DIR
:
public
stages
:
-
build
-
test_deployment
-
production_deployment
stages
:
-
build
-
deploy
.sftp
:
&sftp_template
image
:
${CI_REGISTRY_IMAGE}/ubuntu_sftp
tags
:
-
wasenweiler.sit-servers.net
script
:
-
mkdir -p ~/.ssh
-
echo "${SFTP_KEY}" > ~/.ssh/id_rsa
-
echo "${SFTP_HOSTCERT}" > ~/.ssh/known_hosts
-
chmod 600 ~/.ssh/*
-
mv ${LOCAL_DIR} ${REMOTE_DIR}
-
>
if [ ! -z "${PREVIEW}" ]; then
find ${REMOTE_DIR} -type f -print0 | xargs -0 sed -i 's;</body>;<script src="/.version.js"></script></body>;g';
echo "document.body.innerHTML += '<div style=\"position:fixed; bottom:60px; right:-60px; background-color:#d34; padding: 6px 100px; transform: rotate(-45deg); border-top: 1px solid #400; border-bottom: 1px solid #400;\"><a href=\"${CI_PROJECT_URL}/commit/${CI_COMMIT_SHA}\" style=\"color:#fff;\">Preview: ${CI_COMMIT_SHA:0:8}</a></div>';" > ${REMOTE_DIR}/.version.js;
fi;
-
sftp ${SFTP_USERNAME}@${SFTP_HOST} <<< "put -r ${REMOTE_DIR}"
brunch_build
:
build
:
stage
:
build
image
:
node
before_script
:
-
npm i -g brunch
allow_failure
:
false
image
:
name
:
gcr.io/kaniko-project/executor:v1.14.0-debug
entrypoint
:
[
"
"
]
rules
:
-
if
:
$CI_COMMIT_TAG
script
:
-
npm i
-
brunch b --production
artifacts
:
paths
:
-
public/*
expire_in
:
3 days
test_deploy
:
stage
:
test_deployment
dependencies
:
-
brunch_build
variables
:
SFTP_USERNAME
:
${TEST_USERNAME}
SFTP_KEY
:
${TEST_KEY}
SFTP_HOST
:
${TEST_HOST}
SFTP_HOSTCERT
:
${TEST_HOSTCERT}
REMOTE_DIR
:
${TEST_DIR}
GIT_STRATEGY
:
none
PREVIEW
:
"
true"
environment
:
name
:
Preview
url
:
https://longroute.preview.sauerburger.com/
<<
:
*sftp_template
production_deploy
:
stage
:
production_deployment
dependencies
:
-
brunch_build
-
echo "{\"auths\":{\"$CI_REGISTRY\":{\"auth\":\"$(printf "%s:%s" "${CI_REGISTRY_USER}" "${CI_REGISTRY_PASSWORD}" | base64 | tr -d '\n')\"}}}" > /kaniko/.docker/config.json
-
/kaniko/executor
--context "${CI_PROJECT_DIR}"
--dockerfile "${CI_PROJECT_DIR}/Dockerfile"
--destination "${CI_REGISTRY_IMAGE}:${CI_COMMIT_TAG}"
deploy
:
stage
:
deploy
image
:
name
:
bitnami/kubectl:1.27.5-debian-11-r2
entrypoint
:
[
'
'
]
variables
:
SFTP_USERNAME
:
${PRODUCTION_USERNAME}
SFTP_KEY
:
${PRODUCTION_KEY}
SFTP_HOST
:
${PRODUCTION_HOST}
SFTP_HOSTCERT
:
${PRODUCTION_HOSTCERT}
REMOTE_DIR
:
${PRODUCTION_DIR}
GIT_STRATEGY
:
none
only
:
-
master
when
:
manual
environment
:
name
:
Production
url
:
https://longroute.sauerburger.com/
<<
:
*sftp_template
HOST
:
"
longroute.sauerburger.com"
script
:
-
sed -i "s;CI_COMMIT_TAG;${CI_COMMIT_TAG};" kubernetes.yaml
-
sed -i "s;CI_REGISTRY_IMAGE;${CI_REGISTRY_IMAGE};" kubernetes.yaml
-
sed -i "s;HOST;${HOST};" kubernetes.yaml
-
kubectl config use-context frank/longroute:cumulus-agent
-
kubectl apply -n longroute -f kubernetes.yaml
rules
:
-
if
:
$CI_COMMIT_TAG
This diff is collapsed.
Click to expand it.
Dockerfile
0 → 100644
+
12
−
0
View file @
07d4473b
FROM
node:21.1.0-bullseye-slim
AS
builder
WORKDIR
/build
COPY
package-lock.json package.json /build/
RUN
npm i
-g
brunch
RUN
npm i
COPY
brunch-config.js .eslintrc.js /build/
COPY
app /build/app
RUN
brunch build
--production
FROM
busybox
COPY
--from=builder /build/public /public
\ No newline at end of file
This diff is collapsed.
Click to expand it.
ci/sftp.Dockerfile
deleted
100644 → 0
+
0
−
6
View file @
6e00fd62
FROM
ubuntu:16.04
RUN
apt-get update
\
&&
apt-get
install
-y
openssh-client
\
&&
rm
-rf
/var/lib/apt/lists/
*
This diff is collapsed.
Click to expand it.
kubernetes.yaml
0 → 100644
+
97
−
0
View file @
07d4473b
apiVersion
:
apps/v1
kind
:
Deployment
metadata
:
name
:
longroute-web
labels
:
app
:
longroute-web
spec
:
replicas
:
1
selector
:
matchLabels
:
app
:
longroute-web
template
:
metadata
:
labels
:
app
:
longroute-web
spec
:
imagePullSecrets
:
-
name
:
gitlab-token
initContainers
:
-
name
:
init
image
:
CI_REGISTRY_IMAGE:CI_COMMIT_TAG
command
:
-
cp
-
-a
-
/public
-
/user/share/nginx/
volumeMounts
:
-
name
:
web
mountPath
:
/usr/share/nginx
containers
:
-
name
:
web
image
:
nginx:1.25.3-bookworm
ports
:
-
containerPort
:
80
resources
:
requests
:
memory
:
"
20M"
cpu
:
20m
limits
:
memory
:
"
4000M"
cpu
:
2000m
readinessProbe
:
httpGet
:
path
:
"
/"
port
:
80
initialDelaySeconds
:
15
periodSeconds
:
30
livenessProbe
:
httpGet
:
path
:
"
/"
port
:
80
initialDelaySeconds
:
120
periodSeconds
:
60
volumeMounts
:
-
name
:
web
mountPath
:
/usr/share/nginx/public
subPath
:
public
volumes
:
-
name
:
web
emptyDir
:
{}
---
apiVersion
:
v1
kind
:
Service
metadata
:
name
:
lougroute-web
spec
:
type
:
ClusterIP
ports
:
-
port
:
80
protocol
:
TCP
targetPort
:
80
selector
:
app
:
lougroute-web
---
apiVersion
:
networking.k8s.io/v1
kind
:
Ingress
metadata
:
annotations
:
cert-manager.io/cluster-issuer
:
letsencrypt-production
name
:
lougroute-ingress
spec
:
ingressClassName
:
nginx
rules
:
-
host
:
HOST
http
:
paths
:
-
path
:
"
/"
pathType
:
Prefix
backend
:
service
:
name
:
web
port
:
number
:
80
tls
:
-
hosts
:
-
HOST
secretName
:
longroute-ingress-tls-secret
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment