Initial Commit.
Some checks reported errors
Home Cluster Builds/Image-ElixirPhoenix-1.11.3/pipeline/head Something is wrong with the build of this commit
Some checks reported errors
Home Cluster Builds/Image-ElixirPhoenix-1.11.3/pipeline/head Something is wrong with the build of this commit
This commit is contained in:
58
cicd/Jenkinsfile
vendored
Normal file
58
cicd/Jenkinsfile
vendored
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
#!groovy
|
||||||
|
|
||||||
|
pipeline {
|
||||||
|
agent {
|
||||||
|
kubernetes {
|
||||||
|
defaultContainer 'jnlp'
|
||||||
|
yaml """
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Pod
|
||||||
|
metadata:
|
||||||
|
name: elixir-test-"""+env.BRANCH_NAME+"""-build
|
||||||
|
spec:
|
||||||
|
serviceAccountName: jenkins-admin
|
||||||
|
nodeSelector:
|
||||||
|
kubernetes.io/arch: amd64
|
||||||
|
containers:
|
||||||
|
- name: kaniko
|
||||||
|
image: gcr.io/kaniko-project/executor:debug
|
||||||
|
command: ["tail"]
|
||||||
|
args: ["-f", "/dev/null"]
|
||||||
|
volumeMounts:
|
||||||
|
- name: kaniko-secret
|
||||||
|
mountPath: /kaniko/.docker
|
||||||
|
- name: deploy
|
||||||
|
image: 192.168.195.195:30000/nginx:latest
|
||||||
|
command: ["tail"]
|
||||||
|
args: ["-f", "/dev/null"]
|
||||||
|
restartPolicy: Never
|
||||||
|
volumes:
|
||||||
|
- name: kaniko-secret
|
||||||
|
secret:
|
||||||
|
secretName: dockercred
|
||||||
|
items:
|
||||||
|
- key: .dockerconfigjson
|
||||||
|
path: config.json
|
||||||
|
"""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stages {
|
||||||
|
stage('Build') {
|
||||||
|
steps {
|
||||||
|
sh 'No build steps configured.'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stage('Test') {
|
||||||
|
steps {
|
||||||
|
sh 'echo "No test steps configured."'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stage('Docker Build and Push') {
|
||||||
|
steps {
|
||||||
|
container("kaniko") {
|
||||||
|
sh '/kaniko/executor --dockerfile `pwd`/cicd/'+env.BRANCH_NAME+'/Dockerfile --context `pwd` --destination 192.168.195.195:30000/elixir-phoenix:11.3.3'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
24
cicd/main/Dockerfile
Normal file
24
cicd/main/Dockerfile
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
# Elixir + Phoenix
|
||||||
|
|
||||||
|
FROM elixir:1.11.3
|
||||||
|
|
||||||
|
# Install debian packages
|
||||||
|
RUN apt-get update
|
||||||
|
RUN apt-get install --yes build-essential inotify-tools postgresql-client openssh-client
|
||||||
|
|
||||||
|
# Install node
|
||||||
|
RUN curl -sL https://deb.nodesource.com/setup_12.x -o nodesource_setup.sh
|
||||||
|
RUN bash nodesource_setup.sh
|
||||||
|
RUN apt-get install --yes nodejs
|
||||||
|
|
||||||
|
RUN useradd -m user
|
||||||
|
|
||||||
|
USER root
|
||||||
|
RUN mkdir _build deps \
|
||||||
|
&& chown user:user _build deps \
|
||||||
|
&& chmod 777 _build deps
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# install Hex + Rebar
|
||||||
|
RUN mix do local.hex --force, local.rebar --force
|
||||||
Reference in New Issue
Block a user