Skip to content

Commit

Permalink
Develop (#29)
Browse files Browse the repository at this point in the history
* Adapt data sync engine to run on jenkins (#18)

#5: Adapt Engine to run on Jenkins Cron

* #19 Include Compliance YAML to project to track risks and Privacy Impact Assessment status (#21)

* #13 Include Badge for project Status (#24)

* Feature/27/marcio/jenkins convert to polaris (#28)

* #27 - Including JenkinsFile for Polaris Jenkins Server

* #27 - Including some changes to test Polaris Features

* #27 Updating agent configuration

* #27 Remove unnecessary python checking

* #27 Including post conditions

* #27 Including 1st test to determine readiness of code

* #27 Fixing missing single quote

* #27 pwd + dir

* #27 Including Docker file for podman build containerization

* #27 Hello World message to guarantee no error message in pipeline, for now.
  • Loading branch information
marcionemec-daitan authored Feb 4, 2024
1 parent 181153e commit eb0f420
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 1 deletion.
22 changes: 22 additions & 0 deletions Dockerfile_Polaris
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# pull official base image
FROM python:3.9-bookworm

# set work directory
WORKDIR /usr/src/app

# set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1

# install psycopg2 dependencies
#RUN apk update \
# && apk add postgresql-dev gcc python3-dev

# install dependencies
RUN pip install --upgrade pip
COPY ./requirements.txt .
RUN pip install -r requirements.txt

# copy project
COPY . .
RUN python3 src/main.py
72 changes: 72 additions & 0 deletions Jenkinsfile_Polaris
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
@Library('polaris')
import ca.bc.gov.nrids.polaris.Podman
import ca.bc.gov.nrids.polaris.BrokerIntention
import ca.bc.gov.nrids.polaris.Vault

def podman

pipeline {
agent none
stages {
stage('Checkout code') {
agent {
label Podman.AGENT_LABEL_APP
}
steps {
checkout scm
}
}
stage('Run Compose') {
agent {
label Podman.AGENT_LABEL_APP
}
steps {
sh 'pwd'
sh 'dir'
sh 'podman build --file=Dockerfile_Polaris .'
}
}
}
/* post {
unstable {
node(Podman.AGENT_LABEL_APP) {
script {
if (intention) {
println intention.close(false)
}
}
}
}
failure {
node(Podman.AGENT_LABEL_APP) {
script {
if (intention) {
println intention.close(false)
}
}
}
}
aborted {
node(Podman.AGENT_LABEL_APP) {
script {
if (intention) {
println intention.close(true)
}
}
}
}
always {
node(Podman.AGENT_LABEL_APP) {
cleanWs(
cleanWhenAborted: true,
cleanWhenFailure: false,
cleanWhenSuccess: true,
cleanWhenUnstable: false,
deleteDirs: true
)
}
}
}*/
}


3 changes: 2 additions & 1 deletion src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ def main() -> None:
data_sync.data_sync()

if __name__ == '__main__':
main()
print("I'm containerized now. So what?")
#main()

0 comments on commit eb0f420

Please sign in to comment.